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

    How to initilize Xpresso object node with C++

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 420 Views
    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 Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 01/12/2011 at 08:02, xxxxxxxx wrote:

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

      ---------
      Hi,

      I want to create an object node for Xpresso tag from C++ using the C4D SDK. I'm starting with this ( pMaster is GvNodeMaster* ) :

      **     GvNode *pRoot = pMaster->GetRoot();
        GvNode *pNode = pMaster->CreateNode(pRoot, ID_OPERATOR_OBJECT, NULL, 10, 10);
      **
      The Xpresso object node should reference an object ( BaseObject ) from the C4D object tree, but how can I set BaseObject to my pNode from above?

      ... and then I also want to show some attributes (for example the global position) of the object as input or output ports of pNode. How can I do it with C++?

      All these things can be done very easy with the Xpresso editor. So, there should be a way to do them also with C++. Can somebody reveal how?

      Thanks in advance.

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 02/12/2011 at 02:25, xxxxxxxx wrote:

        Hi,

        You can reassign the object node with:

        GeData data;
        data.SetBaseList2D(pRefObject);
        pNode->SetParameter(DescID(GV_OBJECT_OBJECT_ID), data, DESCFLAGS_SET_0);
        

        GV_OBJECT_OBJECT_ID is declared in gvobject.h ( resource\modules\gv\expressiontag\res\description directory).

        Or with this more obscure way:

        pNode->OperatorSetData(GV_ATOM, pRefObject, GV_OP_DROP_IN_BODY);
        

        This code is from a useful snippet included in this post : https://developers.maxon.net/forum/topic/5722/5767_trouble-creating-an-xpresso-node&PID=24022#24022. It also shows how to connect ports.

        Best regards,

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

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 02/12/2011 at 07:27, xxxxxxxx wrote:

          Thank you very much! :hugging:

          It works well. I even succeeded to show user data attributes on the node ports.

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