How to initilize Xpresso object node with C++

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.

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://plugincafe.maxon.net/topic/5722/5767_trouble-creating-an-xpresso-node&PID=24022#24022. It also shows how to connect ports.

Best regards,

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.