[Bf-python] bmesh split face

INTERLICHTSPIELHAUS interlichtspielhaus at gmail.com
Sat Feb 25 17:04:42 CET 2012


On Sat, Feb 25, 2012 at 3:56 PM, Campbell Barton <ideasman42 at gmail.com>wrote:

> Thanks for the reportm fixed r44428.
>

thanks for the quick reply and fix
 , face split works :-)


but i have another question:

"
import bpy
import bmesh

object = bpy.context.object
mesh = object.data
bm = bmesh.from_mesh(mesh)

for i,f in enumerate(bm.faces):
    print(i,f)

print('first face',bm.faces[0])
"

is it normal that at each running of the script
the order of the references to faces is different ?

and face at index 0 and face at index 4 have the same reference
 , faces at index 1 and 5 too :

0 <BMFace object at 0xb44b7e8>
1 <BMFace object at 0xb44b830>
2 <BMFace object at 0xb44b338>
3 <BMFace object at 0xb44b6b0>
4 <BMFace object at 0xb44b7e8>
5 <BMFace object at 0xb44b830>
first face <BMFace object at 0xb44b0c8>
0 <BMFace object at 0xb44b0c8>
1 <BMFace object at 0xb44b7e8>
2 <BMFace object at 0xb44b338>
3 <BMFace object at 0xb44b3b0>
4 <BMFace object at 0xb44b0c8>
5 <BMFace object at 0xb44b7e8>
first face <BMFace object at 0xb44b6b0>

just wondering :-)

thanks for your work and time
inS



> On Sun, Feb 26, 2012 at 12:42 AM, INTERLICHTSPIELHAUS
> <interlichtspielhaus at gmail.com> wrote:
> > hi
> >
> > playing around with the new bmesh api
> >
> > i can't split a face of a newly created cube in edit mode
> > with the following code
> >
> > "
> > import bpy
> > import bmesh
> >
> > object = bpy.context.object
> > mesh = object.data
> > bm = bmesh.from_mesh(mesh)
> >
> > face = bm.faces[0]
> > v_one = face.verts[0]
> > v_two = face.verts[2]
> > print(v_one,v_two)
> >
> > bmesh.utils.face_split(face, v_one, v_two)
> > "
> >
> > whatever combination of 2 verts i take
> > i always get one of two errors:
> >
> > ValueError: face_split(...): one of the verts passed is not found in the
> > face
> > or
> > ValueError: face_split(...): couldn't split the face, internal error
> >
> > thanks for any help
> > inS
> >
> >
> >
> > _______________________________________________
> > Bf-python mailing list
> > Bf-python at blender.org
> > http://lists.blender.org/mailman/listinfo/bf-python
> >
>
>
>
> --
> - Campbell
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://lists.blender.org/mailman/listinfo/bf-python
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20120225/29349b88/attachment.html>


More information about the Bf-python mailing list