OperatorSetData does nothing



  • 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://plugincafe.maxon.net/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



  • 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... :p

    Greetings,
    Casimir Smets



  • 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 🙂



  • 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



  • 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.


Log in to reply