Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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
    • Recent
    • Tags
    • Users
    • Login

    Simple particle system with python tag?

    Scheduled Pinned Locked Moved PYTHON Development
    7 Posts 0 Posters 507 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      On 08/11/2014 at 02:02, xxxxxxxx wrote:

      I've spent the last while  trying to implement this, and still having problems and confused about how to go about it.

      Lets say I want some random cubes appearing and disappearing over a period of time - each one has their own birth, lifetime, death etc.  The cubes get inserted and removed from the scene accordingly.

      From what I gather from this thread https://developers.maxon.net/forum/topic/7689/9710_create-userdata-solved&PID=42280#42280 ... I shouldn't be inserting objects periodically / randomly (from a python tag script) into the scene at all?

      Regardless, I've been working away without too much problems with a particle system in this way, except for a strange problem with external rendering.  If I want to render a still frame - the external renderer executes my script every frame from 0 up to the current frame.  I don't know how to get around this - if I only want to render one frame to look at - my script will be rebuilding the scene every frame until the current frame - potentially making it very very slow on large scenes when I just want to render a single frame.

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 08/11/2014 at 04:54, xxxxxxxx wrote:

        That's the way it works. Cinema needs to go through all frames to be really sure that it gets the correct
        state at a specific frame.  Many expressions are progressive (simulations) and can therefore be not
        computed on the fly

        I personally think there should be something like a flag for objects/tags that tell Cinema 4D if they're
        progressive, and if there are no such objects/tags in the scene, it wouldn't need to evaluate all frames.

        Except for writing a script that uses RenderDocument() with the RENDERFLAGS_EXTERNAL flag not
        set, I think there is no way around it.

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 08/11/2014 at 05:13, xxxxxxxx wrote:

          Thanks for that Niklas,
          And just be sure it's still not wise to insert new objects into the scene every frame ?  seems related..

          anyway, I've an idea for a work around by reusing objects, rather than deleting and recreating.

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            On 10/11/2014 at 00:45, xxxxxxxx wrote:

            Hello,

            the best way to create a particle system may be to use a ObjectData[URL-REMOVED] generator plugin that re-creates the desired geometry for each frame.

            Best wishes,
            Sebastian


            [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              On 10/11/2014 at 01:47, xxxxxxxx wrote:

              Thanks Sebastian - is this what the Python Generator is based on?  This is what I'm now using and seems perfect, and much simpler, for what I need.

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

                On 10/11/2014 at 02:50, xxxxxxxx wrote:

                Hello,

                technically the Python Generator is just another ObjectData plugin. If the Python Generator's functionality let's you do what you want to do that's great! But there may be some things you may not be able to handle with the Generator and that have to be done with a "full" plugin.

                For some details on the Python Generator you may take a look at the Cineversity article.

                Best wishes,
                Sebastian

                1 Reply Last reply Reply Quote 0
                • H Offline
                  Helper
                  last edited by

                  On 10/11/2014 at 03:38, xxxxxxxx wrote:

                  Yeah so far it's doing everything I need - and fast, steady and reliable 🙂

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post