Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login
    1. Maxon Developers Forum
    2. AiMiDi
    3. Posts
    A
    • Profile
    • Following 1
    • Followers 0
    • Topics 21
    • Posts 54
    • Best 2
    • Controversial 0
    • Groups 0

    Posts made by AiMiDi

    • How should I download Cineware sdk?

      I can't download the Cineware sdk via the link below, is there any other way to download it?

      https://developers.maxon.net/forum/topic/15234/cineware-22-downloads/1

      Thank,
      AiMiDi

      posted in Cineware SDK windows s22
      A
      AiMiDi
    • RE: How to redraw F-Curve Spline by using keyFrames data from Animation Curve?

      @ferdinand Could you please check this out? This is quite important for me! Appreciation for your time!

      Thank,
      AiMiD

      posted in Cinema 4D SDK
      A
      AiMiDi
    • How to redraw F-Curve Spline by using keyFrames data from Animation Curve?

      For only x-axis, there are two points defined (0,0) with right tangent(14.49, 0) and (60,47.869) with left tangent(-39, -1.532), and It is clear that the value at frame 23 is 31.49iwEcAqNwbmcDAQTRAYwF0QD3BrCBiDZ2pD2RpQUWYrDrAJ4DB9IGvVRoCAAJomltCgAL0UOH.png_720x720q90.jpg
      But After I use these information to try to recreate the curve with Bezier algorithm myself, I somehow get the value 26.379:
      fb5ff079-5dad-4e61-9ab2-ed7bf11e56a5-image.png
      And I have tried Hermite algorithm, but it's still wrong 26.5:126d3da5-b9db-4e26-8ac0-a33a57630e19-image.png
      Can you reveal your way of interpolation?

      Thank,
      AiMiD

      posted in Cinema 4D SDK
      A
      AiMiDi
    • RE: Crash when calling TreeViewFunctions::DrawCell

      Hi @m_adam , thanks for your apply. I have solved this problem. The reason is I used maxon::BaseArray to store tree node data. When I append the array, the address of node may change, but the next pointer in node remain unchanged. And this cause the crash.

      posted in Cinema 4D SDK
      A
      AiMiDi
    • Crash when calling TreeViewFunctions::DrawCell

      I'm going to set a tree view as shown below. After adding items into the tree view for several times, it suddenly crashed in DrawText. This issue happens stably.
      f0cdc856-582a-4526-b216-0ae3845dc2f9-image.png

      42bad5c9-0d59-4ab2-b051-43baf46948f5-image.png

      struct MyItem
      {
      	enum
      	{
      		MATERIAL,
      		MESH,
      		CAMERA,
      		LIGTH
      	};
      
      	enum
      	{
      		OK,
      		WARNING,
      		ERROR
      	};
      
      	Int32 state = OK;
      	Int32 type = MATERIAL;
      	BaseList2D* element;
      	String parameter;
      	String problem;
      };
      
      struct MyItem
      {
      	Int32 state = OK;
      	Int32 type = MATERIAL;
      	BaseList2D* element;
      	String parameter;
      	String problem;
      };
      
      struct MyItemNode
      {
      	MyItem item; //data
      	MyItemNode* down = nullptr;
      	MyItemNode* next = nullptr;
      };
      
      using MyItemArray = maxon::BaseArray<MyItemNode>;
      
      class MyTreeViewFunctions final : public TreeViewFunctions
      {
      	void* m_selected_node = nullptr;
      public:
      	static MyTreeViewFunctions& GetFunction()
      	{
      		static MyTreeViewFunctions func;
      		return func;
      	}
      
      	void* GetFirst(void* root, void* userdata) override
      	{
      		return static_cast<MyItemArray*>(root)->GetFirst();
      	}
      
      	void* GetDown(void* root, void* userdata, void* obj) override
      	{
      		return nullptr;
      	}
      
      	void* GetNext(void* root, void* userdata, void* obj) override
      	{
      		if (const auto node = static_cast<MyItemNode*>(obj))
      			return node->next;
      		return nullptr;
      	}
      
      	Bool IsSelected(void* root, void* userdata, void* obj) override
      	{
      		return m_selected_node == obj;
      	}
      
      	Int32 GetLineHeight(void* root, void* userdata, void* obj, Int32 col, GeUserArea* area) override
      	{
      		return 20;
      	}
      
      	Int32 GetColumnWidth(void* root, void* userdata, void* obj, Int32 col, GeUserArea* area) override
      	{
      		return 65;
      	}
      
      	void DrawCell(void* root, void* userdata, void* obj, const Int32 col, DrawInfo* drawinfo, const GeData& bgColor) override
      	{
      		if(!obj)
      			return;
      		const auto& item = static_cast<MyItemNode*>(obj)->item;
      		switch (col)
      		{
      		case MyDialog::LIST_COL_TYPE:
      		{
      			BaseBitmap* bm = nullptr;
      			switch (item.type)
      			{
      			case MyItem::MATERIAL:
      				bm = m_material_bitmap;
      				break;
      			case MyItem::MESH:
      				bm = m_mesh_bitmap;
      				break;
      			case MyItem::CAMERA:
      				bm = m_camera_bitmap;
      				break;
      			case MyItem::LIGTH:
      				bm = m_light_bitmap;
      				break;
      			default:;
      			}
      			drawinfo->frame->DrawBitmap(bm, drawinfo->xpos + drawinfo->width / 4, drawinfo->ypos + 2, ICON_SIZE, ICON_SIZE, 0, 0, bm->GetBw(), bm->GetBh(), BMP_NORMALSCALED);
      			break;
      		}
      		case MyDialog::LIST_COL_ELEMENT:
      		{
      			if (item.type == MyItem::MATERIAL)
      			{
      				if (auto* mat = reinterpret_cast<BaseMaterial*>(item.element); mat) 
      				{
      					if (BaseBitmap* bm = mat->GetPreview(0); bm)
      					{
      						drawinfo->frame->DrawBitmap(bm, drawinfo->xpos, drawinfo->ypos + 2, ICON_SIZE, ICON_SIZE, 0, 0, bm->GetBw(), bm->GetBh(), BMP_NORMALSCALED);
      					}
      				}
      			}
      			drawinfo->frame->DrawSetTextCol(IsSelected(root, userdata, obj) ? COLOR_TEXT_SELECTED : COLOR_TEXT, COLOR_TRANS);
      			drawinfo->frame->DrawText(item.GetName(), drawinfo->xpos + ICON_SIZE + 2,drawinfo->ypos + drawinfo->height / 2, DRAWTEXT_VALIGN_CENTER);
      			break;
      		}
      		case MyDialog::LIST_COL_PARAMETER:
      		{
      			drawinfo->frame->DrawSetTextCol(IsSelected(root, userdata, obj) ? COLOR_TEXT_SELECTED : COLOR_TEXT, COLOR_TRANS);
      			drawinfo->frame->DrawText(item.parameter, drawinfo->xpos + 2,
      				drawinfo->ypos + (drawinfo->height - drawinfo->frame->DrawGetFontHeight()) / 2 + 2);
      			break;
      		}
      		case MyDialog::LIST_COL_PROBLEM:
      		{
      			drawinfo->frame->DrawSetTextCol(IsSelected(root, userdata, obj) ? COLOR_TEXT_SELECTED : COLOR_TEXT, COLOR_TRANS);
      			drawinfo->frame->DrawText(item.problem, drawinfo->xpos + 2, drawinfo->ypos + drawinfo->height / 2, DRAWTEXT_VALIGN_CENTER);
      			break;
      		}
      		default:;
      		}
      	}
      
      	Bool IsOpened(void* root, void* userdata, void* obj) override
      	{
      		return true;
      	}
      
      	String GetName(void* root, void* userdata, void* obj) override
      	{
      		return {};
      	}
      
      	Int	GetId(void* root, void* userdata, void* obj) override
      	{
      		return 0;
      	}
      
      	Int32 GetDragType(void* root, void* userdata, void* obj) override
      	{
      		return NOTOK;
      	}
      
      	void Select(void* root, void* userdata, void* obj, Int32 mode) override
      	{
      		if(mode == SELECTION_SUB)
      			m_selected_node = nullptr;
      		else
      			m_selected_node = obj;
      	}
      };
      
      posted in Cinema 4D SDK r23 c++
      A
      AiMiDi
    • RE: How to track user changes to parameter animation

      @kbar and @m_magalhaes, Thank you for your reply.
      I know that parameter changes can be determined by overriding SetDParameter().
      But I don't know how to override SetDParameter() to know whether the user has added / deleted keyframes, or changed the value of keyframes (whether the small button next to the parameter is pressed). Thank you again for your help.

      Thank,
      AiMiD

      posted in Cinema 4D SDK
      A
      AiMiDi
    • How to track user changes to parameter animation

      x8qas-6obj9.gif
      As I demonstrated above, how to track the user's changes to the parameter animation in a custom ObjectPlugin, or receive a message when the user changes the animation. Do I need to listen to the above events in ObjectData::Message()?Can someone help me?

      Thank,
      AiMiD

      posted in Cinema 4D SDK r21 c++
      A
      AiMiDi
    • RE: How do I get GvNodeMaster stored in Redshift material

      @ferdinand Thank you for your reply.
      My plugin is written in C++. Is there a way to call redshift.GetRSMaterialNodeMaster() in C++ 's existing sdk? (or call the python code through C++)

      Thank,
      AiMiD

      posted in Cinema 4D SDK
      A
      AiMiDi
    • How do I get GvNodeMaster stored in Redshift material

      I need to get the node information on the Redshift material for a plugin that automatically adds maps, reads maps, and converts Redshift materials to default materials.
      I don't know how to get the XPresso stored on the Redshift material. Can someone help me?

      Thank,
      AiMiD

      posted in Cinema 4D SDK r21 c++
      A
      AiMiDi
    • ZipFile::CopyInFileInZip() file names

      I use ZipFile::CopyInFileInZip() to compress the file into a zip package. However, when the file name contains non ASCII characters, the file name is replaced with an underscore. Is there a way to use non ASCII file names in zip without using external libraries?
      04ff1a02-b2f7-402a-8330-eae42c1adaf5-image.png

      AutoAlloc<ZipFile> zf;
        if (zf == nullptr)
          return maxon::OutOfMemoryError(MAXON_SOURCE_LOCATION);
       
        if (!zf->Open(fnZip, false, ZIP_APPEND_CREATE))
          return maxon::UnknownError(MAXON_SOURCE_LOCATION);
      
      Filename fnCopy;
        while (fnCopy.FileSelect(FILESELECTTYPE::ANYTHING, FILESELECT::LOAD, "Select file to add to Zip File"_s))
        {
          zf->CopyInFileInZip(fnCopy, "textures/" + fnCopy.GetFileString());
        }
      

      Thank,
      AiMiDi

      posted in Cinema 4D SDK c++ r21
      A
      AiMiDi
    • RE: How do dynamical systems update objects?

      @m_magalhaes Thank you for your advice.
      Is the dynamics engine in Cinema4D called in a thread?
      How does it update the location of the object?
      Can you provide a general reference for my project?

      Thank,
      AiMiDi

      posted in Cinema 4D SDK
      A
      AiMiDi
    • RE: How to get VolumeData?

      @ferdinand @fwilleke80 Thank you for your reply.
      I'm writing an IPR (Interactive Photorealistic Rendering) rendering plugin like octane or redshift. I need to send scene polygons and materials to the outside through IPC (Inter-Process Communication).
      BaseDocument.Polygonize() solved my problem very well.
      I need further optimization, and I need to check whether the scene (tags, objects, et cetera) has been changed.
      Does BaseDocument.Polygonize()copy the Dirty and HDirty of the object?

      Thank,
      AiMiDi

      posted in Cinema 4D SDK
      A
      AiMiDi
    • RE: How do dynamical systems update objects?

      @m_magalhaes Thank you for your reply, I'm sorry I didn't make it clear.
      I wanted to create my own implementation of Bullet Engine. Because the dynamic systems of MMD and Cinema4D are different, the transformation is complicated.
      I need to do is:

      • Run a Bullet Engine world in multiple threads.
      • Update the bone-driven rigid body (custom objects) to Bullet Engine, depending on the type of rigid body object (bone drives rigid body or rigid body drives bone).
      • When the scene needs to update the physics (such as animation playback), call the engine update function stepSimulation() to let the engine world update.
      • Update the position information of rigid objects (rigid body drives bone type) in the scene in the callback function of the Bullet Engine update.

      Thank,
      AiMiDi

      posted in Cinema 4D SDK
      A
      AiMiDi
    • How do dynamical systems update objects?

      Hi everybody.
      I need to introduce the Bullet Physics engine into C4D to build the Physics system of MMD, AND I need to update objects just like the dynamics system of C4D.
      Is there any information that was sent out before the calculation of dynamics?
      Is there a more efficient update method?

      Thank,
      AiMiDi

      posted in Cinema 4D SDK c++ r21
      A
      AiMiDi
    • How to get VolumeData?

      Hi everybody.
      I need to get the final polygon of the current active scene, lights and other objects for synchronization to the external renderer.
      I learned that VolumeData can do this. I don't know how a dialog plugin gets the final VolumeData for synchronization.
      If you knows how to get the right API, pls leave a comment. That would be really appriciated!

      Thank,
      AiMiDi

      posted in Cinema 4D SDK r21 c++
      A
      AiMiDi
    • RE: SetTimeRight fail!

      Please use the curve->SetTangents(index, &curveTleftX, &curveTRightX, &curveTleftY, &curveTRightY); .
      Detailed see:
      https://developers.maxon.net/forum/topic/13352/ccurve-gettangents-broken
      https://developers.maxon.net/forum/topic/13344/ckey-auto-tangents

      posted in Cinema 4D SDK
      A
      AiMiDi
    • RE: Is it possible to control Camera with keyboard WASD like a FPS game?

      @ferdinand Wow,thank you so much ferdinand!

      posted in Cinema 4D SDK
      A
      AiMiDi
    • RE: Is it possible to control Camera with keyboard WASD like a FPS game?

      @ferdinand
      Hello, sir. Recently I also have questions about object axis. I tried to use my keyboard WASD to move the camera along it's own axis, so camera will works like UE4 or a in game flying camera.
      Cinema 4d originally provide a way to navigate as a flying camera, which is using 3D Connexion's Space mouse.
      If Cinema 4d official can also make c4d support keyboard and gamepad, it would be super helpful for creating huge map and interior, and people can animate camera movement with gamepad by real time recording, like people recording cinematic camera motion by using a iphone with blender.

      edit: This posting has been moved by @ferdinand from its original topic

      posted in Cinema 4D SDK
      A
      AiMiDi
    • RE: Is it possible to control Camera with keyboard WASD like a FPS game?

      @m_magalhaes Thank you mister, for the solutions! Actually there is real time recording in cinema 4d which is cappuccino in Animate bar.
      And there is key smooth function called Key reducer, the algarithm is same to smooth the spline,
      adaptively reduce key points and adjust the bezier on F-curve. Blender has same function called Decimate.
      But there is no way to smooth the key position on F-curve without delete keys. Such function exists in Blender which called smooth keys.
      Now I'm thinking only controlling camera with keyboard.There is actually way to fly the camera like in FPS game which is using 3D connexion's Space mouse.
      So I think it's actually easy for cinema 4d official to support both keyboard and gamepad.Then c4d users who are also gamers would all cheers!!!
      And thank you agian for offering ideas!

      posted in Cinema 4D SDK
      A
      AiMiDi
    • RE: Is it possible to control Camera with keyboard WASD like a FPS game?

      @kbar Thank you so much Mr.Barber, I'm watching your tutorial these days. It's very helpful.
      There is already real time recording which is called cappuccino in Animate bar.
      All I have to do is the camera control.
      Directly modify the position data seems not a good idea, cuz there is input rate limit.
      However when people hold middle mouse to move camera, or hold LMB to move object, they move smoothly.
      I'm thinking if I can remap this behavior of the mouse to keyboard, and move along Object local axis, not view space.
      Thank you again.

      posted in Cinema 4D SDK
      A
      AiMiDi