Texture.size= ??
-
I'm having a bit of an issue with texture size.
I'm changing a material's texture by "material.texture=blah\blah\filename.jpg"
Works fine, except:
If the material has a texture previously, that texture has a real world dimension, something like 1' x 6". When I apply the new texture,
a) the SU material dialog shows the dimensions correctly (if it's a square image, it's like 10" x 10"),
b) the view, however, shows the texture using the exact same dimensions as the texture before, even if the aspect ratio was totally different. As soon as I type in the SU material dialog, the view corrects itself, but I can't seem to get the view to change by any ruby command.I've tried "texture.size=x" and "texture.size=[x, y]". These both work to change the actual values, and are visible in the material dialog, but the 3D view doesn't reflect the change of dimension until I interact with it using the SU dialogs or tools.
Any thoughts? Any way I can get the texture to force a change?
-
Hi Avariant,
Have you tried view.invalidate ?
Tomasz
-
I have. It didn't have any effect. A previous post here implied that invalidate only works somehow in the context of a tool. Even if it did work outside of a tool, I don't think it would help here; you can use the mouse to move the 3D view around as much as you want (which assumably refreshes and invalidates the view repeatedly) and it doesn't fix it. So it's not an issue with updating the display, but more somehow updating the material, visually. As soon as you modify the geometry or make changes in the material dialog, the texture updates correctly, but not until then.
Advertisement