Allocate CTrackData

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 02/03/2007 at 02:30, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   R 10 
Platform:   Windows  ;   
Language(s) :     C++  ;

---------
Hi,

I have a question about CTrackData and how to allocate instances of it. I know there is the

  
AutoAlloc<PluginTrack> track(pluginid);  
track->InsertSequence(seq);  

for the old animation plugins. But I can't find the corresponding CTrackPlugin class. There is a CTRACKPLUGIN struct but it hasn't got access to the CTrack-methods I want.

Basically what I want is to allocate my own plugin tracks and then add some keys to them. In order to do that I must first be able to allocate a track, insert the track into my object allocate keys and insert them into the track.

I'd like a way to do this with my own tracks:

  
CTrack *track = CTrack::Alloc(node,id);  
node->InsertTrackSorted(tmp);  
CKey *key = track->GetCurve()->AddKey(someTime);  
key->SetValue(track->GetCurve(),someValue);  

Has anyone got some tips in this matter?

Thanks
/Jonas

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 06/03/2007 at 05:28, xxxxxxxx wrote:

Here a little example how to allocate the Blinker track from the SDK examples.

  
BaseObject *op = doc->GetActiveObject();  
if(!op) return TRUE;  
  
CTrack *mytrack = CTrack::Alloc(op, DescLevel(1001152,1001152,0));  
if(!mytrack) return FALSE;  
  
op->InsertTrackSorted(mytrack);  
  
return TRUE;  

You have to pass the plugin ID within the DescLevel function.

cheers,
Matthias

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 06/03/2007 at 23:56, xxxxxxxx wrote:

Thanks alot for this Matthias.

/Jonas