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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    ObjectPlugin and material

    Scheduled Pinned Locked Moved PYTHON Development
    4 Posts 0 Posters 584 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 16/11/2017 at 11:04, xxxxxxxx wrote:

      Here an image of the issue.
      Object "test 2" is the generator with the texture attached to the generator and no other textures on the children.The output is ok.

      "Test 1" has a texture attached to the generator and a texture attached to the second child.
      Now we see that the purple texture is not applied to the result. Only the yellow texture.

      If I add a test line to my code, the resulting generator object is shown. Dangerous, I know, but just to test.

      doc.InsertObject(objList[0].GetClone())
      

      As you can see the csto of test 1 returns a Null with the generator object as child.
      CSTO of the test 2 returns generator object.

      In both cases the purple texture disappears after the csto.

      I guess I have to add the texture on the generator to the generators output object.

      I hope this clarifies it better.

      Note: I use the code poste in the first post.

      -Pim

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

        On 17/11/2017 at 08:57, xxxxxxxx wrote:

        Thanks for your additional explanation.

        You are observing a peculiarity of the Boolean object in Create Single Object mode. Try both modes in a scene, you will see it behaves exactly like your plugin. This is caused by the Polygon Selection tags created in this mode.

        It's the way C4D works. As soon as an object has a material restricted to a selection, it does no longer inherit materials from parents. Try it with a simple cube with a material assigned to one face under a Null object.

        Now, you have two options:
        - Disable Single Object mode. Well, obviously, but probably not what you intended.
        - Go into the resulting hierarchy and copy/clone the Texture tag from your generator onto your resulting objects, either taking care of tag order or setting the correct Selection tag to the cloned Texture tag.

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

          On 17/11/2017 at 09:00, xxxxxxxx wrote:

          Another idea:
          You could bool without Create Single Object mode and then do a Connect Objects + Delete.

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

            On 17/11/2017 at 09:36, xxxxxxxx wrote:

            Great input, thanks.
            I will go for the 2nd option in the answer.

            Pim

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