Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Any reason SceneHook is still not supported by Python?

    Cinema 4D SDK
    sdk r21 python
    2
    3
    513
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • CairynC
      Cairyn
      last edited by

      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 😉

      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by m_adam

        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.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        CairynC 1 Reply Last reply Reply Quote 0
        • CairynC
          Cairyn @m_adam
          last edited by

          @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.)

          1 Reply Last reply Reply Quote 0
          • First post
            Last post