THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 22/06/2011 at 07:28, xxxxxxxx wrote:
Cinema 4D Version: 12
Platform: Windows ;
Language(s) : C++ ; XPRESSO ;
We are currently working on a non commercial plugin for c4d with our project group at university.
My task is to retrieve data that is stored in the nodes in a xPresso Tag.
So for example, there are two objects and some XPresso math functions between them like Invert, Matrix to Vektor, Booleans etc. Just some XPresso nodes.
Its working pretty well so far, i iterate through the objects get some names and stuff but im totally confused when it comes to getting the data that is stored in a node. I think it should be possible to get the data stored in a node object? If there is a "RangeMapper" node i should be possible to retrieve the settings of the "RangeMapper"?
Perhaps someone has an idea - i do not require complete code or something, just some tips please that would be nice enough!
I also need to get the node Type, if i use this for example:
const String nodeType = actualChildNode->GetTypeName();
I only get the String back which contains the name of the node Object in the XPresso graphviewer window. So if rename the RangeMapper to RangeMapper123 i will get "RagenMapper123" obviously thats not the type of the node object.
On 22/06/2011 at 16:39, xxxxxxxx wrote:
Here's an example that might help.
It just creates a constant node. Then sets the output port value. Then it prints that value to the console.
At the bottom is also how to get the type of node it is:
GvNode* xconst = nm->CreateNode(nm->GetRoot(), ID_OPERATOR_CONST, NULL, 100, 100); // Creates a constant node
xconst->SetParameter(DescID(GV_CONST_VALUE), GeData(5), DESCFLAGS_SET_0); // Sets the output port's value to 5
GeData d; // Create a variable to store what we get using GetParameter next
xconst->GetParameter(DescID(GV_CONST_VALUE), d, DESCFLAGS_GET_0); // Get the value stored in the constant node's output port
Real outportvalue = d.GetReal(); // Result from GetParameter is type GeData which can't be printed. So this gets the actual value and assigns it to a variable
GePrint(RealToString(outportvalue)); // Now that we have a Real data type. We can print the actual result that's in the node's output port
xconst->SetName("My Constant Node");
String name = xconst->GetName();
GePrint(name); // Results in the name of the node labeled "My Constant Node"
LONG ID = xconst->GetOperatorID();
GePrint(LongToString(ID)); // Results in 400001120 which is the numeric value of ID_OPERATOR_CONST
// Found in the c4d_graphview_def.h file
LONG type = xconst->GetType();
GePrint(LongToString(type)); // Results in 1001101 which is the numeric value for ID_GV_NODEDATA
On 23/06/2011 at 04:09, xxxxxxxx wrote:
Hi, thank you for your fast reply. So i will try to use GetParameter to retrieve some data from the RangeMapper etc Perhaps its ok. I will answer here if i got something new.#
I tryed to use the getParameter but i think that does not work for us. At least i dont understand how to use it i think. The parameters for the function are a bit hard for me to understand.
I also searched in the documentation but cannot get any more information.
Anyone another idea?
On 27/06/2011 at 06:25, xxxxxxxx wrote:
Here is a small example how to browse through an XPresso tag.
#include "C:\Program Files\MAXON\RC R12.048 42839\resource\modules\gv\expressiontag\res\description\gvbool.h"
class MenuTest : public CommandData
virtual Bool Execute(BaseDocument *doc);
// recursive iteration
void StepThroughNodes(GvNode *node)
// prints the title of the node
if (node->GetOperatorID() == ID_OPERATOR_BOOL)
// node is a Boole node
// get the value of the Boole node's Function parameter
if (node->GetParameter(DescLevel(GV_BOOL_FUNCTION_ID), d, DESCFLAGS_GET_0))
LONG bool_funtion = d.GetLong();
//bool_function is one of these:
node = node->GetNext();
Bool MenuTest::Execute(BaseDocument *doc)
// get an active object
BaseObject *op = doc->GetActiveObject();
if (!op) return FALSE;
// get the first XPresso tag
XPressoTag *tag = (XPressoTag* )op->GetTag(Texpresso, 0);
if (!tag) return FALSE;
// get the node node master of the tag to access its data
GvNodeMaster *master = tag->GetNodeMaster();
if (!master) return FALSE;
// iterates through all nodes in the XPresso tag
// be sure to use a unique ID obtained from www.plugincafe.com
return RegisterCommandPlugin(1000956,GeLoadString(IDS_MENUTEST),0,AutoBitmap("icon.tif"),String("C++ SDK Menu Test Plugin"),gNew MenuTest);
What data do you want to read, the values of the ports or the values of the nodes' parameters?
On 20/09/2011 at 05:18, xxxxxxxx wrote:
thanks for your answer. Sorry for my late reply, our project team was on vacation.
Your code is nice to understand thanks.
We want to read all the data a node contains. So we need whats at the inport, at the outport and also what type the node is. So i think your code helps us a lot. Now i can discover of which type a node is. Thanks for this!
I will try to find out how to get the data regarding your example. I think this will help. Thanks again!