Any reason SceneHook is still not supported by Python?
-
Hi;
after wasting a good deal of time with the attempt to receive MSG_DOCUMENTINFO messages (not sent to CommandData plugins, not sent to dialogs(!!), not even sent to MessageData plugins(!!!!)), I finally found that the only scene-independent way to get those messages is a SceneHook. All other objects that get MSG_DOCUMENTINFO are inside a scene: objects, tags...
Sadly, the current Python SDK still doesn't seem to support SceneHooks. I wonder whether there is a reason for that (like, Python is too slow to respond in a timely manner), or if not, when we will get that addition. At the moment Python is my only choice to support MacOS, and evaluating MSG_CHANGE is not doing execution times a favor
-
Hi @Cairyn the only option for you is to create a MessageData with a Timer that will check if the active document changed. Then to trigger a Message or whatever when the document changed.
Now why the Python SDK does not support it, because not everything is supported in Python, it needs time and proper testing since SceneHook is really something important and can kill Cinema 4D fps. Moreover, most Python users don't use and need this kind of low-level stuff.
But I agree with you it will be nice to have it since as you mentioned it's the only scene-independent hook Cinema 4D offers.
I will bump the SceneHook topic internally but can't say/promise anything.Cheers,
Maxime. -
@m_adam Thanks, yes, you're right, a timer may be my best choice here to avoid too much load on the system. Checking the project list every 3 seconds or so should suffice for the usecases. And since I'm in a GeDialog, the timer function is easy to implement.
(I just have to take care that within the 3 seconds, the state of the dialog may be inconsistent with the actual system state.)