I'm writing some ruby scripts related to faces and uvs. I am unsure how to get uv information from my faces when the material is not directly applied to the face. Here is my test scenario.
- Make a circle and extrude it to be a cylinder
- Select the cylinder and make it a component
- Apply a texture material to that component instance
- Adjust the texture's uv repeat information as needed
The only way I can get the uv information is if I manually apply the component instance's material to the faces prior to loading them into a TextureWriter and grabbing a UVHelper, etc. The problem with this is when I call face.material= or face.back_material= it apparently makes the edge smooth tool think that this face is no longer part of a curve and I get faceted edges.
So I'm kinda stuck between a rock and a hard-place. I can either have correct uv information but any curved surfaces get screwed up, or I can have smooth surfaces with no uv information. I guess the third option is I can force people to apply textures to the faces only - but I don't like forcing odd things like this on the users...especially if it appears correctly in the Sketchup viewport.
I must be missing something simple - so hopefully someone can clear this up for me. How can I get uv information for the "actual" material that is being used on the face?
If you need any clarification feel free to ask - I'd really like to solve this issue. I could probably write a quick script to fully demonstrate the problem, but I figured I would see if anyone had run into this issue before I did that.
Thanks!