adressing a TP Node's Objectfield
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 01/06/2011 at 10:52, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 12
Platform: Windows ;
Language(s) : C.O.F.F.E.E ;---------
hello folks,
I'm douwe.
Some of you may know me from my activity in other boards.Been hanging around here for quite some time, picking up bits of info here and there, trying to catch up and get familiar with common scripting practices,... I consider myself still too much of a newbie to really want to bother you guys with all the "common" obstacles and pain-in-the-ass stupid questions i bump into. At least until I know what I'm talking about a little better, so I can pinpoint the specifics of an issue when needed.
Yet, I'm stuck with something here, that I really need to know how to do, because it's so basic and fundamental..
So I'm setting up a file with some coffee that does a few simple things (when a user data boolean is checked it creates a null object with a given name. What I want to do now is automatically add that null into the Object field of a TPGravity node.
I know that i need to use #GRAV_OBJECT to do this; i just don't know how to address it:nullObj = new(NullObject);
nullObj->SetName("TPGravityNull");
doc->InsertObject( nullObj, NULL, NULL );
...........#GRAV_OBJECT = nullObj;what do i need to put at the ..... ?
i know this is very basic, so excuse me the stupidity, but i just can seem to find out.
I'm not a complete idiot, so a little suggestion in the right direction will work wonders here.thanks,
douwe -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 01/06/2011 at 17:25, xxxxxxxx wrote:
i think what i'm trying to do here is get at the xpresso tag first,
then give an instruction to the node, right ?i think i can get at the tag using :
var s = doc->FindObject("nullwithjustanexpressotag");
var tag = s->GetFirstTag();in my twisted logic i should then be able to simply
tag#GRAV_OBJECT = nullObj;but that's a no go of course.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 01/06/2011 at 20:52, xxxxxxxx wrote:
I could be mistaken.
But I don't think Coffee can access xpresso nodes.-ScottA
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/06/2011 at 06:56, xxxxxxxx wrote:
mmmm.. is that so ? that's frustrating. I expected a simple series of actions like this ( creating and naming a null, then adding it to the object field of a specific xpresso node. ), to be a pretty reachable goal for a first exploration.
i came across TTag Types (Texpresso). doesn't that allow for interaction with an xpresso tag ?
maybe i'd learn more if i rephrase it :
if you had to do something like this, how would you approach it ?i'm trying to learn from being result oriented here.
if the task can't be done with one approach; rather then get stuck, I'm looking for alternatives to get at least some functionality. I guess I'm saying I'm also open for python suggestions.anybody willing to enlighten me ?
(or am i asking for too much here ?)cheers,
douwe -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/06/2011 at 07:05, xxxxxxxx wrote:
You can't dive into the XPresso tag with COFFEE, you can just allocate and insert one.
But it is possible via Python.
Take a look into the Py4D documentation under c4d.modules.graphview, which represents the XPresso "module".Cheers,
Niklas -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/06/2011 at 09:20, xxxxxxxx wrote:
ok, i see.
that's clear.let's see what i can dig up.
thx,
d -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/06/2011 at 23:55, xxxxxxxx wrote:
Here's an example code by Scott Ayers.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/06/2011 at 04:39, xxxxxxxx wrote:
Originally posted by xxxxxxxx
Here's an example code by Scott Ayers.
yes, sir.
was looking at ( and being intimidated by ) that example yesterday.
need to take some time to experiment.also, i think to populate a node's object field i may bump into needing GetOperatorContainer() & SetOperatorContainer() just like scott mentions.
i'll get back to this later when i finally get there.
interesting challenge.d
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/06/2011 at 16:00, xxxxxxxx wrote:
just to make sure :
Is it correct that Coffee (still) doesn't allow to write user data ?that would allow me to do something like :
var s = doc->FindObject("User Data");
nullObj = new(NullObject);
nullObj->SetName("TPGravityNull");
doc->InsertObject( nullObj, NULL, NULL )
s#ID_USERDATA:2 = nullObj;doesn't seem to work though.
d -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/06/2011 at 17:13, xxxxxxxx wrote:
I don't think you can create new UserData entries with Coffee.
But you can definitely use it to put object's into a UserData link field:var UDobject= doc->FindObject("Cube");//The object that has a Link type UserData on it var n = AllocObject(Onull); //Create a null in memory only n->SetName("TPGravityNull"); //Change it's name doc->InsertObject(n, NULL,NULL);//Grab it from memory and put it in the OM UDobject#ID_USERDATA:1 = n; //Put the Null in the first UD link field that's on the Cube
-ScottA
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/06/2011 at 18:46, xxxxxxxx wrote:
yes sir,
that does work, and can be fit in nicely.
good lesson learned.thx,
d