PSR Constraints and killing [SOLVED]

On 10/03/2015 at 18:39, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   R16 
Language(s) :

So I'm working on a script and I add a number of PSR constraints to objects to basically snap them. After I snap them I add an EventAdd to refresh the scene and then I immediately use KillTag to delete them all. I expect this should give me perfectly snapped objects, but it offsets the objects when I run the kill. It's fine if I leave the constraints and finish the script without the kill. Is there something I'm not updating correctly to get the constraints to stick before the kill?

On 11/03/2015 at 08:28, xxxxxxxx wrote:


can you tell us on what kind of plugin you are working and could you share some code?

I guess the problem is that EventAdd() won't do what you think it does. EventAdd() will add an event to the event queue. But this queue will be evaluated after Cinema returns from the local scope of your function. So calling EventAdd() won't do anything immediately.

If you want the document to update you may want to use ExecutePasses(). But if this is a good idea or not depends on what kind of plugin you write.

Best wishes,

On 11/03/2015 at 13:32, xxxxxxxx wrote:

I think ExecutePasses should be fine, thanks.