hi there!
I am trying to assign new UV coordinates to a face via python and have a problem: after writing my UV data nothing happens, blender does not see or recognize the changes I make. when rerunning the script the old values are there again.
here's a small piece of code:
import Blender
mesh = Blender.NMesh.GetRawFromObject('Plane')
face = mesh.faces[0]
# that prints me the original uv data as set manually in the UV editor
print face.uv
del face.uv[:]
# that seems to work - I get a [ ]
print face.uv
face.uv.append((0.0, 1.0))
face.uv.append((0.0, 0.0))
face.uv.append((1.0, 0.0))
face.uv.append((1.0, 1.0))
# that seems to work as well - face.uv has all the values above now
print face.uv
# do I need this?
mesh.update()
----------
well - after running the script nothing changes and when I run it one more time I see that it starts with old values - blender did not remember the changes I made.
I guess I am doing something wrong or missing something, but I was not able to figure out what; any help is appreciated :)
thanks!
Jin
just figured it out! baaah, spent almost 4 hours yesterday :)
it works when using the Mesh module, it does not work with NMesh, that's all :)