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

    Control Object always false in SceneHook::Execute

    SDK Help
    0
    4
    582
    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.
    • H
      Helper
      last edited by

      On 30/08/2017 at 06:31, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R16 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hi,

      I came across this phenomenon today. When parsing objects within the thread context of a SceneHook::Execute() the method GetBit(BIT_CONTROLOBJECT) always returns false.

      I am parsing selected objects (and their children) as well as objects, which tags are selected (using doc->GetActiveObjects(selection) and doc->GetActiveTags(selection)).

      As test, I was then using a Hierarchy derived class to parse through the document but that results in an instant error.

      p:\c4d_perforce_work\release\16.0\modules\xpressocore\source\graphview\gv_world.cpp(1264) : CRITICAL: Stop

      I tried both - with and without - a BaseThread for Hierarchy.Run(). The BaseThread I used was the parameter from SceneHook::Execute()

      When I parse the (partial) document from outside the thread context of the scene hook the GetBit(BIT_CONTROLOBJECT) returns true for control objects. Also, quickly printing the control bit from the Python console also yields true.

      Is this a known problem?

      Thanks,
      Martin

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 30/08/2017 at 06:44, xxxxxxxx wrote:

        NB: I am doing this when the execution flag is set to EXECUTIONFLAGS_EXPRESSION.

        Thanks,
        Martin

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 31/08/2017 at 05:39, xxxxxxxx wrote:

          Hi Martin,

          the BIT_CONTROLOBJECT gets set during execution (in the end only the generator knows, what it uses as input objects). I suggest to use AddToExecution() to define a later execution for your SceneHook.

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 31/08/2017 at 07:36, xxxxxxxx wrote:

            Thanks so much. This did it.

            I was not using AddToExecution() though I was receiving EXECUTIONFLAGS_CACHEBUILDING flags. So I assumed the cache building was done (and the objects had their "proper" state).

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