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

    OperatorSetData does nothing

    SDK Help
    0
    5
    563
    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 06/05/2015 at 03:01, xxxxxxxx wrote:

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

      ---------
      Hi,

      I'm currently adding some Xpresso nodes to my ObjectData plugin.
      I've followed this thread: https://developers.maxon.net/forum/topic/2895/2272_programmatically-doing--set-driven-keys-
      but I can't get it completely working.

        
      myNode->OperatorSetData(GV_ATOM, myNull, GV_OP_DROP_IN_BODY);  
      

      does nothing 😞
      The node keeps the name and the reference of the object on which it is on, instead of my defined nullobject.

      Does anybody know what I'm missing here?
      Thanks in advance for your help and time!
      Greetings,
      Casimir Smets

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

        On 07/05/2015 at 02:21, xxxxxxxx wrote:

        Am I the only one with this problem? 😞

        I'd love it to be fixed, I need to setup a lot of Xpresso files... 😛

        Greetings,
        Casimir Smets

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

          On 07/05/2015 at 07:03, xxxxxxxx wrote:

          Hi Casimir,

          With just one line of code and without its context it's hard to tell what's happening. Please post more code 🙂

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

            On 07/05/2015 at 08:16, xxxxxxxx wrote:

            Hi Yannick,

            Here is my code:

              
            XPressoTag* myXPressoTag = static_cast<XPressoTag*>(myCube->MakeTag(Texpresso, NULL));  
            if (!myXPressoTag)  
              return nullptr;  
            GvNodeMaster* myNodeMaster = myXPressoTag->GetNodeMaster();  
            if (myNodeMaster)  
            {  
              GvNode* myNode = myNodeMaster->CreateNode(myNodeMaster->GetRoot(), ID_OPERATOR_OBJECT);  
              myNode->OperatorSetData(GV_ATOM, myNull, GV_OP_DROP_IN_BODY);  
            }  
            else  
            {  
              return nullptr;  
            }  
            

            This is inside GetVirtualObjects inside an ObjectData plugin.
            I hope this gives enough information to find the problem!
            If not, ask me more.

            Thanks in advance for your help and time!
            Greetings,
            Casimir Smets

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

              On 07/05/2015 at 09:12, xxxxxxxx wrote:

              Thanks for posting code.

              I won't have much time today to have a look but remember GetVirtualObjects() is called in a thread context and it's not allowed to make any change to the active document except the object returned and its hierarchy (allocated there).
              XPresso also uses a Scene Hook for its node master and this could be the issue there: accessing/changing scene/document data.

              I think you'd better perform these extensive XPresso operations when a button is pressed in your generator plugin.

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