SOLVED 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

Hi,

Well, our dynamic engine is based on the bullet engine. Be sure that it's not working before implementing your own solution.

If you want something to be executed at the world level, you need a SceneHookData for sure. That SceneHookData .Execute will be called whenever the scene needs to be updated. That SceneHookData can check all the object of your document and update them.

You will probably need to store some data at world level, this can also be done in a NodeData stored inside a SceneHookData.
Running the Bullet Engine in multiple threads can be tricky, especially if you want object to interact.

the task looks huge, but not impossible.

Cheers,
Manuel

Hi,

MMD you are talking about the MikuMIkuDance you already worked on, not material deformation method?
I'm not sure what mean with "introducing the Bullet Physics Engine". This is the engine we are using inside Cinema4D. Are you trying to create your own implementation of the Bullet Engine?

I guess, you want to implement body physics. I don't know if they are based on bone deformation or soft bodies.
We need more information like:

  • what kind of information are you retrieving from MMD format?
  • do you want to translate that to a cinema4D's dynamic setup?
  • you are talking about updates, but we don't understand if you want to retrieve an event from c4d and load information from the MMD or something else.

Could you please add more information?

Cheers,
Manuel

@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

Hi,

Well, our dynamic engine is based on the bullet engine. Be sure that it's not working before implementing your own solution.

If you want something to be executed at the world level, you need a SceneHookData for sure. That SceneHookData .Execute will be called whenever the scene needs to be updated. That SceneHookData can check all the object of your document and update them.

You will probably need to store some data at world level, this can also be done in a NodeData stored inside a SceneHookData.
Running the Bullet Engine in multiple threads can be tricky, especially if you want object to interact.

the task looks huge, but not impossible.

Cheers,
Manuel

@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

Hi,

the scenehook is called from the CoreThread, that's why you must be sure that your sceneHook is 100% safe and not blocking/crashing.

I can't talk about our internal implementation. But, to save some time, you could disable the dynamics on the project settings, and keep using our tags to retrieve the data, parameters to drive the simulation.

Cheers,
Manuel