Setting ID_BASEOBJECT_COLOR?



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

    On 10/09/2007 at 15:42, xxxxxxxx wrote:

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

    ---------
    Hello,

    I want to color a null object and a spline that the user links into my expression. I tried like this (for the null object) :

      
    Vector Target_Color(1,1,0);  
    Real Target_Radius = 25.0;  
      
    BaseObject     *SC_TargetObj = tag->GetData().GetObjectLink(TARGET_OBJ, doc);  
      
    SC_TargetObj->GetDataInstance()->SetLong(NULLOBJECT_DISPLAY, NULLOBJECT_DISPLAY_CIRCLE);  
    SC_TargetObj->GetDataInstance()->SetReal(NULLOBJECT_RADIUS, Target_Radius);  
    SC_TargetObj->GetDataInstance()->SetLong(ID_BASEOBJECT_USECOLOR, ID_BASEOBJECT_USECOLOR_ALWAYS);  
    SC_TargetObj->GetDataInstance()->SetVector(ID_BASEOBJECT_COLOR, Target_Color);  
    

    Setting NULLOBJECT_DISPLAY and NULLOBJECT_RADIUS works fine. The null object gets a cirle with the appropriate radius. But with ID_BASEOBJECT_USECOLOR and ID_BASEOBJECT_COLOR, nothing happens. No error message, but also no color.

    What's my mistake? Thanks for any help.

    Greetings,
    Jack



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

    On 11/09/2007 at 06:01, xxxxxxxx wrote:

    Is this the right way to put data into ID_BASEOBJECT_COLOR, anyway? How would you do this? Is there any example code in one of the example plugins?

    Regards,
    Jack



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

    On 11/09/2007 at 08:17, xxxxxxxx wrote:

    Try this instead for the last two values:

    SC_TargetObj->SetParameter(DescID(ID_BASEOBJECT_USECOLOR),GeData(ID_BASEOBJECT_USECOLOR_ALWAYS),0L);    
    SC_TargetObj->SetParameter(DescID(ID_BASEOBJECT_COLOR),GeData(Target_Color),0L);



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

    On 11/09/2007 at 10:25, xxxxxxxx wrote:

    And that's totally correct.
    Thanks again for a very helpful post!

    Greetings,
    Jack


Log in to reply