Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 13/01/2012 at 07:16, xxxxxxxx wrote:
User Information: Cinema 4D Version: 12 Platform: Windows ; Language(s) : C++ ; XPRESSO ;
--------- Hey guys,
as we are in the final phase of our project i encountered a little problem. We are writing a plugin for university which gets data out of a xpresso node. When you create some xPresso circuits you can enter different data for some kind of nodes. Mostly interesting for us are the math nodes like invert, oder boolean nodes.
First, PLEASE NOTE WE ARE WRAPPING THE API TO C# - nothing special with the code just another syntax for this problem
Here is a example picture of an easy xpresso circuit: http://www.abload.de/image.php?img=forum_exampleej4kr.jpg
In this example i want to get the information what name this negation operator has - if a comment is inserted, which type it will result to - > Real, Color, Integer, etc.
At the moment i got this snippet of code:
GeData tData = new GeData(); node.GetParameter(new DescID(C4dApi.XXX), tData, C4d.DESCFLAGS_GET.DESCFLAGS_GET_0) Datatype something = tData.Get"Datatype"();
I got this while working through the documentation and checking the forum and also from an old thread of mine here in the forum.
The problem is, i dont know what to insert for the "XXX" - see above. I need the correct "keys" or "consts" as you call them i think. The var "something" will always be null with the "keys" i tried.
I hope you can give me some hints
Cheers, Oukie
On 13/01/2012 at 12:29, xxxxxxxx wrote:
Hi,
Originally posted by xxxxxxxx GeData tData = new GeData(); node.GetParameter(new DescID(C4dApi.XXX), tData, C4d.DESCFLAGS_GET.DESCFLAGS_GET_0) Datatype something = tData.Get"Datatype"();
Originally posted by xxxxxxxx
Here's how to make this works (C++ code) :
#include "..\modules\gv\expressiontag\res\description\gvdynamic.h" #include "gvbase.h" const String title = node->GetTitle(); // Get node name GeData data; // Get dynamic type node->GetParameter(DescID(GV_DYNAMIC_DATATYPE), data, DESCFLAGS_GET_0); LONG type = data.GetLong(); bool res = type == ID_GV_DATA_TYPE_REAL; // Get comment text node->GetParameter(DescID(ID_GVBASE_REMARK), data, DESCFLAGS_GET_0); const String remark = data.GetString();
On 13/01/2012 at 12:40, xxxxxxxx wrote:
Thanks for your fast reply! Very very big thanks!
One additional question, is there a list or table or something to look up this "GV_DYNAMIC_DATATYPE" relations? I cannot find anything about his in the documentation ... Perhaps im just blind ?
cheers!
On 13/01/2012 at 13:01, xxxxxxxx wrote:
Originally posted by xxxxxxxx One additional question, is there a list or table or something to look up this "GV_DYNAMIC_DATATYPE" relations? I cannot find anything about his in the documentation ... Perhaps im just blind ?
The GV data types are documented in the ID_GV_DATA_TYPEs enum.
On 14/01/2012 at 05:04, xxxxxxxx wrote:
Thansk Yannick, have a nice weekend!
On 20/01/2012 at 07:12, xxxxxxxx wrote:
Hey, i got another question
Is it also possible to go from an xPresso Node back to the object in the c4d scene the xPresso Node is related to? For example something like if i have 3 cubes in my scene i can determine with the xpresso node which cube as a BaseObject im working on with the xPresso Node?
Cheers
On 20/01/2012 at 13:36, xxxxxxxx wrote:
Originally posted by xxxxxxxx Is it also possible to go from an xPresso Node back to the object in the c4d scene the xPresso Node is related to? For example something like if i have 3 cubes in my scene i can determine with the xpresso node which cube as a BaseObject im working on with the xPresso Node?
Yes, retrieving the node's parameter with DescID(GV_OBJECT_OBJECT_ID) as explained in this post. In your case you would just call GetParameter() instead.
On 21/01/2012 at 13:28, xxxxxxxx wrote:
Hey thanks, i already checked this post out. will let you know if this works!
On 07/02/2012 at 06:13, xxxxxxxx wrote:
Hey Yannick,
so you meant its done like this:
GeData data; data.SetBaseList2D(pRefObject); <- (expresso node object?) pNode->GetParameter(DescID(GV_OBJECT_OBJECT_ID), data, DESCFLAGS_GET_0); pNode.... ? -> Whats here to retrieve the node?
Sorry for asking again but i think documentation is not very helpful here
On 07/02/2012 at 08:50, xxxxxxxx wrote:
Originally posted by xxxxxxxx There is no method "SetBaseList2D" existing - nowhere. I checked documentation and source code and api code. How can i retrieve the node object when i only get an id from the GetParameter method?
SetBaseList2D() is new in R13, SetBaseLink() was used before. But in your case you don't need this method; you just want to get the parameter data. It's used to set the data before calling SetParameter().
GetParameter() returns a state boolean if it succeed or not. The parameter data is assigned to t_data argument. Here's how to retrieve the node object:
node->GetParameter(DescID(GV_OBJECT_OBJECT_ID), data, DESCFLAGS_GET_0); BaseLink* link = data.GetBaseLink(); if (link) BaseList2D* obj = link->GetLink(doc); // Get node object
On 08/02/2012 at 01:33, xxxxxxxx wrote:
Thanks a lot Yannick. This works like a charm Ah thats why i like the maxon guys You are so quick and competent.
Cheers.
PS: I think there should be a mailer list that notes you when functions like this changed in the api.
On 08/02/2012 at 01:42, xxxxxxxx wrote:
Originally posted by xxxxxxxx PS: I think there should be a mailer list that notes you when functions like this changed in the api.
This is listed for each new release in a "API changes" page in the documentation.
On 08/02/2012 at 01:48, xxxxxxxx wrote:
Ah oke than my failure ... Will check this more often.