ObjectPlugin and material



  • 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



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



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



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

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

    Pim


Log in to reply