I trimmed a textured mesh with an arbitrary curve using a Python script and the texturing in the trimmed mesh perfectly matches the appearance of the original mesh right up to the boundary if I go to the Materials tab and turn on self-illumination. How do I do turn on self-illumination in the Python script?
Trimmed, textured mesh with self-illumination manually turned-on:
Original, textured mesh:
I obtained the texture material from the original mesh using:
mobj = doc.Objects.Find(mesh) # Get texture material for original mesh. source_mat = mobj.Attributes.MaterialIndex
and I applied this to the trimmed mesh: tmesh using:
obj = doc.Objects.Find(tmesh) # Apply source texture material to new mesh. obj.Attributes.MaterialIndex = source_mat obj.Attributes.MaterialSource = ObjectMaterialSource.MaterialFromObject obj.CommitChanges()
but this does nothing to the setting for self-illumination.