SOLVED Fields and Adding an Effector

Hello! I have a situation where I'm adding a Random Effector to scene on a button press. That's working correctly, but when I save the scene and reopen it the Field interface and it seems to have reverted to the pre-R20 interface. I'm working in C++ but I managed to recreate the issue in Python for simplicity.

Before I save and load the Falloff tab looks like this.
alt text

After I save and load it looks like this.
alt text

The code I'm using is here:

import c4d
from c4d import gui
def main():
    randomEffector = c4d.BaseObject(1018643)#Random Effector ID
    doc.InsertObject(randomEffector)
    c4d.EventAdd()

if __name__=='__main__':
    main()

Is there a flag or something I'm missing?

Thanks for any help,
Dan

hi

you have to send the following message to the object so it will switch internally from regular falloff to fields.

    randomEffector.Message(c4d.MSG_MENUPREPARE, doc)

Cheers,
Manuel

hi

you have to send the following message to the object so it will switch internally from regular falloff to fields.

    randomEffector.Message(c4d.MSG_MENUPREPARE, doc)

Cheers,
Manuel

@m_magalhaes

Thank you! Works perfectly.

Dan