light color



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

    On 13/09/2008 at 12:07, xxxxxxxx wrote:

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

    ---------
    hi, while trying c++ instead of coffee i face uncountable problems. one of them is how i can access the color of a light. in coffe i could use GetContainer, GetData and light_MAIN_F to access the light colors. but i just dont fine a way to access the lightcolor in c++.

    can anyone help me how to do this?

    thanks in advance,
    ello



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

    On 13/09/2008 at 13:42, xxxxxxxx wrote:

    Again, many of these type of parameters of specific object types are stored as Attribute Parameters and not in the BaseContainer. One sure way to find out is to go into the resource/res/description folder and find the header and res files for the object type (for lights that would be olight.h and olight.res). If the values you want to set are specified there (such as LIGHT_COLOR), then you must use SetParameter()/GetParameter().

    > GeData          geData; \> obj->GetParameter(DescID(LIGHT_COLOR), geData, NULL); \> Vector          v =               geData.GetVector(); \> GePrint("Current Color = "+RealToString(v.x)+", "+RealToString(v.y)+", "+RealToString(v.z)); \> Vector          color =          Vector(1.0f,0.0f,0.0f);     // RED \> obj->SetParameter(DescID(LIGHT_COLOR), GeData(color), NULL); \> obj->Message(MSG_UPDATE);



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

    On 13/09/2008 at 13:45, xxxxxxxx wrote:

    If you are looking for the description ID of the lightsource color (or any other ID of any object) you should take a look into the folder "CINEMA 4D\resource\res\description" and at the .h and .res files located there.

    In this case, look into "olight.res" and you'll see that the ID you must use the ID "LIGHT_COLOR".

    I guess you can access it using MyLight->GetDataInstance->GetVector(LIGHT_COLOR);
    But note that some parameters (I still don't know why) must be accessed using MyLight->GetParameter.

    Cheers,
    Jack



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

    On 13/09/2008 at 13:45, xxxxxxxx wrote:

    Ha, too slow. Robert was first ;-)



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

    On 13/09/2008 at 17:55, xxxxxxxx wrote:

    thank you both very much!


Log in to reply