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

    Thinking Particles- How to Set "Settings"

    Cinema 4D SDK
    r23 python
    2
    5
    769
    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.
    • I
      ivodow
      last edited by ivodow

      In Simulate -> Thinking Particles -> TP Settings... there are a series of UI elements at the top of the General tab controlling global settings for the TP system:

      Max. Particles
      Force this Setting
      Show Objects
      View Type

      How do I set these from python? (I specifically need Max Particles and View Type.) I have been all over the docs and cannot seem to find them.

      Thank you.

      1 Reply Last reply Reply Quote 0
      • ManuelM
        Manuel
        last edited by

        hi,

        you can access them in the BaseContainer of the ParticleSystem.

        import c4d
        
        
        def main():
            # Retrieves the Particles System of the current document
            pSys = doc.GetParticleSystem()
            if pSys is None:
                raise RuntimeError("op is none, please select one object.")
            bc = pSys.GetDataInstance()
            bc[54] = 300
            
            
        
        # Execute main()
        if __name__=='__main__':
            main()
        

        Those are the ids corresponding.

        #define TP_VIEWTYPE			50
        #define TP_VIEWMESH			51
        #define TP_FORCEGLOBAL	                52
        #define TP_ON				53
        #define TP_NUMLIMIT			54
        

        the ViewType's ID:

        // Particle View Typen
        #define VTYPE_NONE		0
        #define VTYPE_FLAKES	        1
        #define VTYPE_DOTS		2
        #define VTYPE_TICKS		3
        #define VTYPE_DROPS		4
        #define VTYPE_BOX		5
        #define VTYPE_GLOBAL            6
        

        Cheers,
        Manuel

        MAXON SDK Specialist

        MAXON Registered Developer

        1 Reply Last reply Reply Quote 2
        • I
          ivodow
          last edited by ivodow

          Hi Manuel,

          Thank you for your answer, I appreciate it.

          So that in the future I can find these things myself, I tried searching searching your Python docs for TP_VIEWTYPE. No results were returned. I assume those #defines are drawn from a C++ header, so I tried searching for TP_VIEWTYPE here, also with no success.

          Where can I find full searchable API documentation for Cinema 4D? (Like that for Rhino Common)

          1 Reply Last reply Reply Quote 0
          • ManuelM
            Manuel
            last edited by

            hi,

            This are copy/paste directly from our code. They are not available, not documented. That's why i 've provided them.
            You can have a look at that page for having informations about the IDs that page

            Cheers,
            Manuel

            MAXON SDK Specialist

            MAXON Registered Developer

            1 Reply Last reply Reply Quote 0
            • I
              ivodow
              last edited by

              Okay, thank you again.

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