How can a tag safely modify objects?
-
On 05/08/2014 at 18:42, xxxxxxxx wrote:
Quick question:
I'd like to modify the contents of a spline through a tag (the tag outright clears the spline and sets up all the points and segment stuff when it needs to). According to the Python SDK documentation, TagData.Execute() is called in a thread. The c4d.threading page then has this to say about forbidden functions:
3. Change the structure of objects attached to the scene.
4. Change parameters of elements attached to the scene (allowed, but not recommended except for tags).Does this apply to setting the points of a c4d.SplineObject() then calling Message(c4d.MSG_UPDATE)? If it does, how can I safely work around this? Would implementing locks be good enough, so that only one thread of the tag is ever accessing the SplineObject data at once? Or is there some way I need to message the main thread and perform the SplineObject modification there?
-CMPX