Hi, I am really new to Python and Blender and I have been searching this forum forever to no avail - so please please help me even if the answer seems obvious.
I need to get raw vertex data from a mesh on a frame by frame basis. So, I do the following:
for new_frame in range(start_frame, end_frame+1):
data = NMesh.GetRawFromObject(current_object_name)
for v in data.verts:
print(v.co, v.co, v.co)
The frame number shown in Blender graphic interface is updated, but the 3D view of the mesh is not, and the data extracted from the mesh is exactly the same for all frames. If I change the frame number by pressing the button in the interface (and not through script), then the 3D view gets updated, and GetRawFromObject() returns the deformed mesh that I need. But I need to use the script to iterate through frames.
Is there some update function that is missing??
try apply the object matrix too
after getting the data and before printing the verts.
P.S. I don’t even think you need the redraw unless you like to watch.
Thank you for your replies! As far as I know, matrix only accounts for translation/rotation/scaling, but I also need information about deformations resulting from Armature. What should I do?
If it dosent try…
print the frame number to make double sure.
Thank you cambo, but either I am misunderstanding something, or Blender 4.42 does not have a BPyMesh module. I found a yet-to-be investigated bug report about scene update, which explains why NMesh.GetRawFromObject() does not return the updated mesh. The report can be found here:
Has anybody else been having problems with this issue?
you might not have an updated scripts dir, 2.42 is definetly distributed with BPyMesh.py
With the pose proble, might pose.update() be a workaround?