Hello all,
I am working on a code that adds and deletes faces in a mesh. The code utilizes both NMESH [mesh=obj.getData()] and MESH [mesh2=obj.getData(mesh=1)] copies of the same mesh to exploit builtin members in both. Such members may be the texture information (in NMESH) or some edge/face connectivity related functions (in MESH).
The problem is when I delete a face or vertex in one copy, which requires me to run mesh.update to sync the two sides. The update call is a costly one and slows down the code significantly…
Here is the piece of code that forces me to use the MESH class and I am looking to drop it:
a dictionary where the edge is the key, and a list of faces that use it are the value
mesh2=ObjIn.getData(mesh=1)
edge_faces = dict([(ed.key, []) for ed in mesh2.edges])
Add the faces to the dict
for fc in mesh2.faces:
for key in fc.edge_keys:
edge_faces[key].append(fc)
Can anyone advice me on how I can put together the same dictionary for the NMESH,
mesh=ObjIn.getData() ?
Alternatively you may have ideas for a way around the mesh.update call…
Thanks.
albcem