Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Light Color track creation fails

    SDK Help
    0
    2
    246
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • First post
          Last post