TP Max-Particles



  • On 18/07/2018 at 14:13, xxxxxxxx wrote:

    Hello PluginCafe,

    I have been working a lot with VDBs recently and implemented a way to save and load them in Cinema4D.
    Appart from an ObjectPlugin I made a SceneLoaderPlugin to load the VDBs.
    Now to my problem:
    I have two options when loading a VDB. It is either a mesh or a point cloud.
    Importing the mesh through the SceneLoaderPlugin works fine but I face a problem when loading the point cloud.

    I am using the ThinkinParticles module to visualize the point cloud. But The VDBs often have more points than the Max Particles setting. And I can't find a method in the docs to change this setting. This would not be an problem when working with an ObjectPlugin, since the user can change it, however when I try to load it using the SceneLoaderPlugin the whole load-process fails. It does also not load when I change the Max Particles setting manually.

    Tl;Dr: Is there a way to change the Max Particles setting of the Thinking Particles module?

    Thanks in advance,
    Florian



  • On 19/07/2018 at 01:20, xxxxxxxx wrote:

    Hi Neon, regarding your initial question about Max Particles you can define it using the following code

        particleSystem = doc.GetParticleSystem()
        bc = particleSystem.GetDataInstance()
        bc[54] = 1000000000
        c4d.EventAdd()
    

    Note the ID used in the BaseContainer, does not get a proper symbol, so it may change in future release.
    And the max count allowed is 1000000000.

    Regarding your second question about SceneLoaderPlugin, it's normal since TP is not initialized in the document (It's why merge should work and not when you create a new document directly).
    Moreover, you will face some problems, since you generate particles only one time at a given frame with a given LifeTime in a SceneLoader, that means when you will go back in time, or run the scene longer than your particle LifeTime, there will be nothing in the scene.
    So the best way would be in your SceneLoaderPlugin to create/set up an ObjectData plugin which will use the vdb file to generate TP particles.

    Hope it helps, if you have any question please let me know!
    Cheers,
    Maxime



  • On 19/07/2018 at 03:53, xxxxxxxx wrote:

    Hi Maxime,
    thank you very much for your reply!

    I had this problem a lot that I had to change the Max Particle setting, now I know how to!
    And thank you very much for your tips regarding the SceneLoader Plugin, I will keep them in mind.

    best regards,
    Florian


Log in to reply