when I use .GetMg() after the script is finished it seems to return the right results
-
When I use .GetMg() after the script is finished it seems to return the right results
Is this a bug? maybe rerelated to the IK Tag -
Hi @pyxelrigger while a screen and a gif is nice, a piece of code is even nicer since it can be copy/pasted and easily read.
With that's said I think you need to at least execute the scene once with ExecutePasses just after your Message(c4d.MSG_UPDATE).
The reason is because MSG_UPDATE have the purpose to update internal cache of the geometry, and also set dirty the cache (aka say it needs to be re-generated). This is the same with the tags you added it most likely also set dirtiness (needs to be recomputed on the next scene execution).
And then you call EventAdd at the end of your script, so you are telling Cinema 4D that he needs to do another ExecutionPass (Scene Execution) which will be what Cinema 4D will do most likely very soon after the Python Script have been executed. And therefor when you run the script in the console, the scene have been executed, and therefor the tag and everything have been executed and therefor the value are "correct".Cheers,
Maxime. -
Thanks, buddy! It worked. To be honest, I never really understood what Message(c4d.MSG_UPDATE) was all about, and now ExecutePasses is new to me