[Bf-python] Copying data

Stephane SOPPERA stephane.soppera at wanadoo.fr
Fri Feb 11 09:31:38 CET 2005


Campbell Barton wrote:

> Hi All its good to be back in Australia...
> I was thinking it would be nice to be able to copy data in Blenderm 
> including but notlimited to
> NMface, NMedge, NMVert, NMesh...
>
>  faceCopy = f.copy()
>
> This saves the current only way..
>  faceCopy = NMesh.Face()
>  faceCopy.mat = f.mat
>  faceCopy.image = f.image
>  faceCopy.mode = f.mode
>  faceCopy.smooth = f.smooth
>  faceCopy.uv= f.uv[:]
>  faceCopy.uv= f.col[:]
>
>
> The same with verts- having a copy function could maintain vert 
> groups, weight's etc.
>
> Note that a copied vert/face/edge would not be linked to the mesh, 
> they would need to have verts added and appended.
>
> Any Objections to
> NMface.copy()
> NMedge.copy()

There can be only ONE edge between two vertices. So copying all 
properties of a NMedge don't make sense at all. Maybe NMEdge.copy(newV1, 
newV2) would perhaps make sense. Moreover NMEdge can't be created 
outside a NMesh to ensure that only one edge links two vertices. So the 
only function that could make sense would be: NMesh.addEdge(v1, v2, 
otherEdge) and that would create an edge between v1 and v2 with flag and 
crease value of otherEdge. But again, do this function make sense for 
faces edges? (ie edges that are used by one or more face) I don't think 
so and can't find any interesting use to it.

> NMVert.copy()
> NMesh.copy()


-- 
Stephane SOPPERA
http://perso.wanadoo.fr/stephane.soppera 





More information about the Bf-python mailing list