Light Color track creation fails

On 09/05/2014 at 13:33, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   R10->R15 
Platform:   Windows  ; Mac  ;  Mac OSX  ; 
Language(s) :     C++  ;

---------
Howdy,

Here is some simple code for an example:

BaseObject *op = doc->GetActiveObject(); if(!op) return false;
if(!op->IsInstanceOf(Olight)) return false;
  
DescID dscID = DescID(DescLevel(LIGHT_COLOR,DTYPE_VECTOR,0),DescLevel(COLOR_R,DTYPE_REAL,0));
  
CTrack *track = op->FindCTrack(dscID);
if(!track)
{
	GePrint("Light has no Red Color track.");
	track = CTrack::Alloc(op,dscID);
	if(!track) GePrint("Red Color track failed to be created.");
	else GePrint("Red Color track successfully created.");
}
else GePrint("Light has a Red Color Track.");
  
return true;

If the light has no color track it fails to create a color track, but if the light object already has a color track, it finds the track.

So how do I create an animation track for the light color?

Adios,
Cactus Dan

On 09/05/2014 at 14:43, xxxxxxxx wrote:

Howdy,

Never mind.

It works when I use DTYPE_COLOR instead of DTYPE_VECTOR. 😊

DOH!

Adios,
Cactus Dan