Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    Getting objects from LayerObject

    SDK Help
    0
    5
    583
    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

      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!   
        
        
        
      
      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        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

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

          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!

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

            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[URL-REMOVED];
            Bool view[URL-REMOVED];
            Bool render[URL-REMOVED];
            Bool manager[URL-REMOVED];
            Bool locked[URL-REMOVED];
            Bool generators[URL-REMOVED];
            Bool deformers[URL-REMOVED];
            Bool expressions[URL-REMOVED];
            Bool animation[URL-REMOVED];
            Vector[URL-REMOVED] color[URL-REMOVED];
            };

            ... 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


            [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

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

              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

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