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

    Selection associated with a texture tag

    Cinema 4D SDK
    3
    4
    592
    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.
    • KantroninK
      Kantronin
      last edited by

      Hi,

      I have another problem that looks a bit like my previous post.
      Now for each tag (type 5616), I want to know the name of the associated selection, if it exists.
      Could you put the correct code in place of the dotted lines

      alt text

      	tag = obj.GetFirstTag()
      	while tag:
      		if tag.GetType() == 5616: #texture tag
      			
      			#name of tag
      			print tag.GetMaterial().GetName()
      		
      			#name of the associated selection, if it exists 
      			...
      			...
      			...			
      
      		tag = tag.GetNext()
      
      1 Reply Last reply Reply Quote 0
      • CairynC
        Cairyn
        last edited by

        just as a tip, you seem to miss a basic technique to find out parameters.
        Open the Python console. Select the label of the desired parameter in the attribute manager. Drag the label into the console. The colsole will react by showing you the parameter access, e.g.:

        Material[c4d.TEXTURETAG_RESTRICTION]
        'MySel'

        Press Return to get the current value, which in this case is MySel.
        You can now use the square bracket notation on your object (texture tag).

        KantroninK 1 Reply Last reply Reply Quote 0
        • KantroninK
          Kantronin @Cairyn
          last edited by

          Thank you.
          I had forgotten about this excellent feature of C4D.
          It must be said that I rarely do plugins, because now C4D can do a lot of things.

          1 Reply Last reply Reply Quote 0
          • M
            m_adam
            last edited by

            Hi @Kantronin, I don't have a lot to add Thanks @Cairyn , for more information about the console, please read Python Console.

            Cheers,
            Maxime.

            MAXON SDK Specialist

            Development Blog, MAXON Registered Developer

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