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

    Changing parameters broken in S22

    Cinema 4D SDK
    2
    5
    854
    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.
    • M
      Motion4D
      last edited by m_adam

      Hi, bit of a newb question. When changing a setting on an object this used to work:

      obj[c4d.MG_LINEAR_OBJECT_POSITION,c4d.VECTOR_Y] = 0.0
      

      But now it doesn't, it keeps getting an unexpected type error even though the type should be a float.
      I read the sdk saying to use the "original set method" to avoid type errors but I'm not sure what the original method would be?

      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by

        Hi @Motion4D you need to properly change parameters to have access to these parameters (as you will do via the user interface)

            cloner = c4d.BaseObject(1018544)
            cloner[c4d.ID_MG_MOTIONGENERATOR_MODE] = c4d.ID_MG_MOTIONGENERATOR_MODE_LINEAR
            cloner[c4d.MGCLONER_FIX_CLONES] = False
            cloner[c4d.MG_LINEAR_OBJECT_POSITION, c4d.VECTOR_Y] = 0.0
        

        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • M
          Motion4D
          last edited by

          @m_adam said in Changing parameters broken in S22:

          M

          Thanks! @m_adam it worked but I'm just curious why we needed to specify the fixed clone mode to False?

          1 Reply Last reply Reply Quote 1
          • M
            m_adam
            last edited by m_adam

            Hi sorry, you are right, internally MGCONER_FIX_CLONES will force an update of the cloner position, forcing the generation of the description.

            But doing

                cloner = c4d.BaseObject(1018544)
                cloner[c4d.ID_MG_MOTIONGENERATOR_MODE] = c4d.ID_MG_MOTIONGENERATOR_MODE_LINEAR
                cloner.Message(c4d.MSG_CHANGE)
            
                cloner[c4d.MG_LINEAR_OBJECT_POSITION, c4d.VECTOR_Y] = 0.0
                doc.InsertObject(cloner)
                c4d.EventAdd()
            

            Is enough.

            Cheers,
            Maxime.

            MAXON SDK Specialist

            Development Blog, MAXON Registered Developer

            1 Reply Last reply Reply Quote 0
            • M
              Motion4D
              last edited by

              @m_adam Thanks for clarifying!

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