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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Mospline iterate start/end

    Cinema 4D SDK
    2
    4
    728
    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.
    • A
      ashambe
      last edited by

      Hi folks,

      I have a mospline set as a spline mode (the Source spline contains several splines/segments).

      Currently, if i set the grow mode to separate segments, all the segments will get animated/growth simultaneously.

      I'm tired of trying to do a per segment control to randomly offset the growth per segment. or perhaps control this with a field object (which would be super amazing!)

      Any help guys.
      Plzzzz this would be a lifesaver here.

      N.B I'm a beginner in python.

      ferdinandF 1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand @ashambe
        last edited by ferdinand

        Hello @ashambe,

        thank you for reaching out to us. We are a bit unsure about the nature of your question and if it is really SDK related. These are the Cinema 4D SDK forums, and the SDK Team only does deliver support on the Cinema 4D SDK. To retrieve customer support, i.e., for questions about the Cinema 4D app itself, please reach out to customer support.

        With that being said, I do not really understand your question in the first place. I assume you want to control a MoSpline in some fashion in Python, which is possible. You however imply that you want to control the Growth parameter for a segmented MoSpline for each segment individually, by saying, "[I am] trying to do a per segment control to randomly offset the growth [...]". This is not possible as the MoSpline object has no parameters to dial in the offset on a per segment basis (at least I am not aware of any). If you can control the growth on a per segment basis individually with fields, is a question you would have to ask customer support, as we are here more API oriented.

        In case you are just after some parameter access in Python, I have attached a simple Python script at the end highlighting this.

        Cheers,
        Ferdinand

        """ Creates a new MoSpline and sets some if its parameters.
        
        To be run as a Script Manger script in the Script Manager.
        """
        
        import c4d
        
        def main():
            """Script entry point.
            """
            # Create a new MoSpline object.
            spline = c4d.BaseList2D(440000054)
            
            # Set its mode to turtle and growth mode to per segment.
            spline[c4d.MGMOSPLINEOBJECT_MODE] = c4d.MGMOSPLINEOBJECT_MODE_TURTLE
            spline[c4d.MGMOSPLINEOBJECT_GROWMODE] = c4d.MGMOSPLINEOBJECT_GROWMODE_SEPARATE
            
            # Set the growth of all segments to 10.
            spline[c4d.MGMOSPLINEOBJECT_TURTLE_GROWTH] = 10
            
            # Insert the new MoSpline into the active document and push an update event
            # to Cinema 4D.
            doc.InsertObject(spline)
            c4d.EventAdd()
            
        
        if __name__=='__main__':
            main()
        

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 0
        • A
          ashambe
          last edited by

          Thanks for your answer Ferdinand. I hope Maxon adds this feature to mospline in a future release, it will make this tool even more powerful. thanks again for your time!

          1 Reply Last reply Reply Quote 0
          • ferdinandF
            ferdinand
            last edited by

            Hello @ashambe,

            without any further questions we will consider this topic as solved by Friday, December the 17th.

            Thank you for your understanding,
            Ferdinand

            MAXON SDK Specialist
            developers.maxon.net

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