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

    Getting all occurrences of a specific object type

    Scheduled Pinned Locked Moved PYTHON Development
    2 Posts 0 Posters 238 Views
    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 Offline
      Helper
      last edited by

      On 15/06/2013 at 04:37, xxxxxxxx wrote:

      Hi,

      I'm trying to get all occurrences of a specific object type in a document. Specifically, it's a type that is part of a custom shader (a texture object). Just looping of the shader's channels is not enough, because theoretically it could be layers upon layers of objects (through links) where this object type may or may not be used.

      Instead of looping through every possible branch, is there a simple way to just give me a list of "GetAllObjectsOfTypeInDocument(int type)" thing?

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

        On 15/06/2013 at 05:56, xxxxxxxx wrote:

        You can iterate over all shaders in a material just like you would iterate over the tree in the OM. Append the objects you need to a list and you're done.

        -Nik

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