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 the material of an object

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 316 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 10/12/2014 at 07:34, xxxxxxxx wrote:

      Does anyone know of a faster way to get the material of an object that is not on the object itself?

      For example, I have a material on the top null that textures anything that does not have a tag underneath. My current method is going up the hierarchy and testing each material until I find the one that the object is using. I feel like this is a really bad way of doing this and can be slow with hundreds of nulls and materials.

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

        On 10/12/2014 at 08:28, xxxxxxxx wrote:

        Hello,

        what do you mean with "testing each material"? You could simply check all parent objects if they have a tag of the type Ttexture[URL-REMOVED]. If yes simply access the texture tag to get the material[URL-REMOVED].

        Best wishes,
        Sebastian


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

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

          On 10/12/2014 at 09:21, xxxxxxxx wrote:

          Some of the parent objects use a selection tag for the material or multiple materials. If so, then I would be getting the wrong material on some objects. I optimized my code a little so It's in a manageable speed now.

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