Hi,
I'm using some images as textures for faces in the model. To position textures correctly for each face, I calculate position of texture and add texture with 'position_material' method.
While testing plugin on various examples, I've encountered next problem, which I don't have idea how to solve.
Assume that 'face' is Face object on which we apply new texture, and that it is inside some group.
Example code:
materials = Sketchup.active_model.materials
material = materials['material_name']
face.position_material(material,[[237.274, 715.334, 199.096], [0, 0, 0], [467.052, 715.334, 391.903], [1, 0, 0]],true)
If I'm outside of the group where 'face' entity is previous code gives texture 'material_name' positioned correctly on the face.
If I'm inside of the group where 'face' entity is, previous code positions 'material_name' completely wrong.
In both cases I use exactly the same points coordinates for material positioning.
Note that vice versa problem happens also: if I set coordinates so positioning is correct while group is opened, when I close the group and try to position material it is wrong.
Why this is important for my plugin: once materials are imported their coordinates are saved as attributes for each face. I have option in plugin to toggle on/off these materials (and show face default material instead).
When I should toggle on materials - I use get_attribute to get coordinates and then position materials on faces.
In case that different groups are opened in the moment of import and later during toggling - I get wrong positioning of textures.
It seems like this coordinates are treated as local for the group or something like that, and my assumption was that these are coordinates in SketchUp coordinate system.
Any ideas why this happens and how to solve the problem.
Thanks in advance,
Marija