Hello,
Sorry for my english
I have to create a material and add it a texture through Ruby API.
When i assign the material to a face, it displays the average color of the texture. At contrary, when i colorize a face through UI with the same material (from my code), it works fine.
Here is my code
model = Sketchup.active_model
materials = model.materials
material = materials.add("test")
material.texture = params.to_s #path to texture
material.texture.size = 160.mm
for parent_entity in model.entities
if parent_entity.is_a? Sketchup::ComponentInstance
definition = parent_entity.definition
for entity in definition.entities
if entity.is_a? Sketchup::Face
entity.material="test"
entity.back_material="test"
end
end
end
end
Any idea ?
Thank you for you help