Getting objects from LayerObject



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

    On 09/02/2011 at 18:01, xxxxxxxx wrote:

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

    ---------
    Hi,

    I'm trying to iterate over all the layers in a document (the layers that appear in the layer manager) and print out the objects in each layer.

    I can get the root LayerObject:

      
    GeListHead *layers = doc->GetLayerObjectRoot();   
    [CODE]  
      
    and use that to iterate over the layers. But for each LayerObject, how would I access the objects in the LayerObject?   
      
    I can get the BaseContainer from BaseList2D, but I'm not sure how to access the layer objects from the BaseContainer, if that's where they're stored.   
      
    Any advice?   
      
    Thanks!   
      
      
      
    


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

    On 10/02/2011 at 02:52, xxxxxxxx wrote:

    From what I see it works the other way around. You iterate through all objects/materials/tags etc. and check to which LayerObject they belong with BaseList2D::GetLayerObject().

    cheers,
    Matthias



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

    On 10/02/2011 at 10:33, xxxxxxxx wrote:

    Yeah, I was afraid of that.

    If I open the Layer Browser, select a layer, then select one of the icons (such as the "Visible" icon), the action is applied to every object in that layer.

    How does the Layer Browser know which objects are in the layer? Does it calculate that on the fly by iterating over all the objects and checking if the LayerObject matches itself? Or does it store the objects in some container that is not accessable via the API?

    Thanks!



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

    On 10/02/2011 at 11:45, xxxxxxxx wrote:

    Howdy,

    If I'm understanding it correctly, I think the Layer Browser simply holds a LayerData structure for each layer:

    struct LayerData
    {
    public:
    Bool [solo](file:///Users/danlibisch/Documentation/%20C4D%20Manuals/R10%20SDK/pages/c4d_basedocument/struct_LayerData703.html#solo0);
    Bool [view](file:///Users/danlibisch/Documentation/%20C4D%20Manuals/R10%20SDK/pages/c4d_basedocument/struct_LayerData703.html#view1);
    Bool [render](file:///Users/danlibisch/Documentation/%20C4D%20Manuals/R10%20SDK/pages/c4d_basedocument/struct_LayerData703.html#render2);
    Bool [manager](file:///Users/danlibisch/Documentation/%20C4D%20Manuals/R10%20SDK/pages/c4d_basedocument/struct_LayerData703.html#manager3);
    Bool [locked](file:///Users/danlibisch/Documentation/%20C4D%20Manuals/R10%20SDK/pages/c4d_basedocument/struct_LayerData703.html#locked4);
    Bool [generators](file:///Users/danlibisch/Documentation/%20C4D%20Manuals/R10%20SDK/pages/c4d_basedocument/struct_LayerData703.html#generators5);
    Bool [deformers](file:///Users/danlibisch/Documentation/%20C4D%20Manuals/R10%20SDK/pages/c4d_basedocument/struct_LayerData703.html#deformers6);
    Bool [expressions](file:///Users/danlibisch/Documentation/%20C4D%20Manuals/R10%20SDK/pages/c4d_basedocument/struct_LayerData703.html#expressions7);
    Bool [animation](file:///Users/danlibisch/Documentation/%20C4D%20Manuals/R10%20SDK/pages/c4d_basedocument/struct_LayerData703.html#animation8);
    [Vector](file:///Users/danlibisch/Documentation/%20C4D%20Manuals/R10%20SDK/pages/ge_vector/struct_Vector1184.html) [color](file:///Users/danlibisch/Documentation/%20C4D%20Manuals/R10%20SDK/pages/c4d_basedocument/struct_LayerData703.html#color9);
    };

    ... then you access the LayerData structure from BaseList2D::GetLayerData() through each BaseList2D node.

    Each individual manager accesses the LayerData through each BaseList2D node to see how it should process the node.

    So, if my understanding of it is correct, the Layer Browser actually would do nothing more than store layer settings.

    Adios,
    Cactus Dan



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

    On 11/02/2011 at 02:53, xxxxxxxx wrote:

    As Dan said the Layer Browser doesn't know about the objects for each layer. It just stores the LayerData for each layer.

    cheers,
    Matthias


Log in to reply