@mfersaoui said in Automatically add effector object into In-/Exclusion User Data:
@m_adam Thank you,
Now I'm searching for how to add an Object to an In-Exclude user data. I tried with the following code but this doesn't work.
import c4d
def main():
effectors = op[c4d.ID_USERDATA,2] # In/Exclude User Data
plain = doc.GetFirstObject() # Plain object (Effector)
effectors.InsertObject(plain, 1)
c4d.EventAdd()
if __name__=='__main__':
main()
The actual issue is that effectors = op[c4d.ID_USERDATA,2] perform a copy of the InExcludeData so that means you have to reassign the data correctly after it since you don't do the change directly from the InExcludeData of the BaseContainer.
op[c4d.ID_USERDATA,2] = effector
Cheers,
Maxime.