THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 10/06/2011 at 11:02, xxxxxxxx wrote:
Originally posted by xxxxxxxx
I know about the IDs, but an ID for a Track? Ie., is there something I could drag into the Scriptmanager that would give me the ID: c4d.ID_BASEOBJECT_ROTATION ?
Yes.
Usually Tracks are not children of the scene(doc). They are children of the object you are animating.
So to get the ID for a position.X track. You would go to the object's attributes. And in the Coord. tab, Left mouse click on the text "P.X" and drag the mouse into the python console.
That's how you can find a lot of the ID's.
Originally posted by xxxxxxxx
So, these IDs are nothing more than a description to get a certain value from a resource file ?
In many cases yes.
Sometimes the description is very easy to get at. So the code will be very short like this: op[c4d.ID_BASEOBJECT_XRAY]=True
Other times. The descrition of what you want to edit is nested inside of another group.
So the code is bit longer like this:
tr=c4d.CTrack(op, c4d.DescID(c4d.DescLevel(c4d.ID_BASEOBJECT_POSITION, c4d.DTYPE_VECTOR, 0), c4d.DescLevel(c4d.VECTOR_X, c4d.DTYPE_REAL. 0)))
And still other times. You will need to find the ID of the attribute you want to edit. So you can apply it later on like this:
id1 = c4d.DescID(c4d.DescLevel(c4d.ID_USERDATA), c4d.DescLevel(1)) # The first UserData entry
op.SetKeyframeSelection(id1, 1) #Use that id to tell the SetKeyframeSelection function what attribute to apply it to.
Here they are next to each other for easy comparison:
-op[c4d.ID_BASEOBJECT_XRAY]=True
-tr=c4d.CTrack(op, c4d.DescID(c4d.DescLevel(c4d.ID_BASEOBJECT_POSITION, c4d.DTYPE_VECTOR, 0), c4d.DescLevel(c4d.VECTOR_X, c4d.DTYPE_REAL. 0)))
-id1 = c4d.DescID(c4d.DescLevel(c4d.ID_USERDATA), c4d.DescLevel(1))# The first UserData entry
There's probably a few more way to create and use these descriptions. But these are the most common ones.
This can be very confusing stuff until you use them a few times.
I'm personally going through similar pains with trying to learn all the various ways to write and use SetParameter() and GeData functions in C++.
-ScottA