LayerObject/LayerData Setting Color



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

    On 01/04/2008 at 18:58, xxxxxxxx wrote:

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

    ---------
    hi pros :D

    i found this helpful thread aubout layers
    the last thing i need to know about layers now is how to set the layer color. i can't modify any layerdata. (how) can this be done?
    thank you guys.

    Yakuza



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

    On 02/04/2008 at 02:13, xxxxxxxx wrote:

    Setting the color is easy, just set the color component of the LayerData.

    Sets the color of the first layer to white:

    > \> Bool MenuTest::Execute(BaseDocument \*doc) \> { \>      GeListHead \*llist = doc->GetLayerObjectRoot(); \>      if(!llist) return FALSE; \> \>      LayerObject \*layer = (LayerObject\* )llist->GetFirst(); \>      if(layer) \>      { \>           LayerData ldata(\*layer->GetLayerData(doc, TRUE)); \>           ldata.color = Vector(1.0,1.0,1.0); \>           layer->SetLayerData(doc, ldata); \> \>           layer->Message(MSG_UPDATE); \>           EventAdd(); \>      } \> \>      return TRUE; \> } \>

    cheers,
    Matthias



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

    On 02/04/2008 at 05:22, xxxxxxxx wrote:

    ah, i see. i tried similar but from
    LayerData *ldata= layer->GetLayerData(doc, TRUE);
    i didn't get far...
    thanks again. :)

    Yakuza


Log in to reply