Position track
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 07/02/2004 at 09:21, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 8.207
Platform: Windows ;
Language(s) : C++ ;---------
Hi !
Well, I need to add a position track (X, Y, Z) to an object, but I can't find the answer in the SDK documentation and in the API examples...
I've tried the Sdata and Svalue BaseTrack types but it creates one anonymous track. The Sbase type doesn't create any track...If somebody knows how to create this XYZ Position Track (and Rotation Track why not !), it will help me a lot !
Thanx for the answer ! -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 08/02/2004 at 08:16, xxxxxxxx wrote:
I have sent you some code :=)
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 08/02/2004 at 08:28, xxxxxxxx wrote:
Yes, thanks again for your help Samir !
The code you sent me creates 3 Svalue tracks (with sequences and keys), but they aren't recognized as Position Tracks by C4D, the objet don't use them as X, Y and Z coordinates animation...
So I'm always searching... -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 08/02/2004 at 08:34, xxxxxxxx wrote:
I´m not into the animation thing that much. I guess Mikael can help you on this.
Good luck Tengaal. -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 08/02/2004 at 08:41, xxxxxxxx wrote:
I'll find ! One day...
This is the code (the animated object "mycam" is created before) :
DescID descID;
BaseTrack *track;
BaseSequence *seq;
BaseKey *key;
AnimValue *av;
LONG index=0;
LONG val[3];
val[0] = 100;
val[1] = 200;
val[2] = 300;
LONG i;
BaseTime time=doc->GetTime();
for (i=0; i<3; i++)
{
// check if track exists
descID = DescID(DescLevel(index, 0, 0), DescLevel(VECTOR_X+i, 0, 0));
track = mycam->FindTrack(descID);
if (!track)
{
track = AllocValueTrack(mycam,descID); if (!track) return FALSE;
mycam->InsertTrackLast(track);
}
// check for sequence
seq = NULL;
for (seq = track->GetFirstSequence(); seq; seq=seq->GetNext())
if (time>=seq->GetT1() && time<=seq->GetT2())
break;
if (!seq)
{
seq = track->AutoAddSequence(doc,time);
if (!seq) return FALSE;
}
key = BaseKey::Alloc(seq->GetType()); if (!key) return FALSE;
av = GetKeyValue(key); if (!av) return FALSE;
av->value = val[i];
key->SetTime(time);
seq->InsertKey(key);
}
I don't know if the "index" value can explain my problem, I don't know what is the good value for "index", so I define it to 0... -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 08/02/2004 at 10:19, xxxxxxxx wrote:
the index Value is actually the description ID in your Resource file (at least I think it is it in this case)
For example the resource file looks like this:
GROUP ID_BASE_B
{
DEFAULT 1;
GRADIENT BE_COLORGRAD {COLOR; ANIM ON;}
}
Then the index would be "BE_COLORGRAD". Here you would need to use the id of the position field.
But hey, I am only guessing here and am not sure at all. Mikael´s turn now (or someone else´s turn if one knows). -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 08/02/2004 at 10:35, xxxxxxxx wrote:
Yes, I've understood the DescID index value represents the ID to obtain the associated string, but I don't find the "Position" ID representing the Position Tracks. I think this parameter has no influence but, who knows...
Nobody has to work with Position/Rotation/Scale Tracks using the C4D 8 C++ SDK ?
It's a very important thing to know to create some C4D 8 plugins in the future, thanx to the guy who got the answer ! -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 09/02/2004 at 16:52, xxxxxxxx wrote:
The 'index' is supposed to be ID_BASEOBJECT_POSITION. The code you have seems to be taken from this thread: https://developers.maxon.net/forum/topic/1047 (Found it by searching for "position track"...
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 10/02/2004 at 00:25, xxxxxxxx wrote:
Thank you Mikael, shame on me !
In fact, Samir helps me with this little code, but I didn't see the search button, so I had to search reading all posts titles...
I feel ridiculous, sorry !