Changing parameters broken in S22



  • 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?



  • 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.



  • @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?



  • 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.



  • @m_adam Thanks for clarifying!