Previous Thread  Next Thread

chat icon Modifying vert positions on a mesh that has shape keys - Py

wristy_j

Posted: Thu Nov 05, 2009 12:14 am
Joined: 04 Nov 2009
Posts: 3
Hello,

I'm writing a python script to modify the vertices of a mesh, and also update its shape keys. Writing to the shape keys works fine - I access them via mesh.key.blocks.getData(). If a mesh has NO shape keys on it, then my script can successfully modify the verts through the MVertSeq object mesh.verts[] and everything works as expected. The problem is when the mesh has shape keys, I modify the mesh verts and the Basis shape key verts, but the changes don't get through to the mesh and show up on screen. I see the original mesh, unmodified. In the interactive Python script window, I can verify that the mesh.verts[i] have changed, but then the next time I either render or manipulate the mesh in any way (enter/exit edit mode, etc) the verts go back to their original positions. I downloaded the source code to see if I can figure out why this is happening.

Is this a bug in the Python API? Does anyone know of any way I can propagate my vert changes to the persistent mesh data through Python? If there's no Python call to fix this, where should I start looking in the source code to see if I can either fix the bug or expose a new function to python that does what I want?

Thanks!
Jason
Reply with quote


wristy_j

Posted: Fri Nov 06, 2009 8:59 pm
Joined: 04 Nov 2009
Posts: 3
Ok, it's not a bug in the Python API. It's me being a Python noob. I was assigning variables improperly and not getting a unique copy of the values -- too used to C++ where you have to explicitly declare and use pointers to get that behavior.
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group