I encountered a magical phenomenon about material textures

The left face is assigned the material using the SU material tool, and the right face is assigned the material using RubyAPI.

The same material was used twice, but the effect of pasting it was different.

face = Sketchup.active_model.selection[0]
face.material = Sketchup.active_model.materials.current

test.skp (179.6 KB)

When using the Paint Bucket tool you set both the material property and the UV mapping. The API material setter only sets the material property.

Iā€™m thinking either the face you painted with the API has leftover UV mapping from having been painted previously, or the face you painted using the tool got a non-standard UV-mapping from the face you picked the material from using the material eye dropper.

1 Like

It could also be the back of the face you are seeing and the front that got painted using the API.