From 8c333c63a49513026628c5d3b73553a771186673 Mon Sep 17 00:00:00 2001 From: Ken Hughes Date: Sun, 5 Feb 2006 15:43:47 +0000 Subject: [PATCH] Previous commit broke faces.extend() and edges.extend() for single edges and faces. --- source/blender/python/api2_2x/Mesh.c | 4 +-- source/blender/python/api2_2x/doc/Mesh.py | 36 +++++++---------------- 2 files changed, 13 insertions(+), 27 deletions(-) diff --git a/source/blender/python/api2_2x/Mesh.c b/source/blender/python/api2_2x/Mesh.c index a089863ddcf..d499eab80f4 100644 --- a/source/blender/python/api2_2x/Mesh.c +++ b/source/blender/python/api2_2x/Mesh.c @@ -2461,7 +2461,7 @@ static PyObject *MEdgeSeq_extend( BPy_MEdgeSeq * self, PyObject *args ) case 1: /* if a sequence... */ tmp = PyTuple_GET_ITEM( args, 0 ); - if( PySequence_Check( tmp ) && PySequence_Size( tmp ) == 1 ) { + if( PySequence_Check( tmp ) && PySequence_Size( tmp ) > 0 ) { /* if another sequence, use it */ PyObject *tmp2 = PySequence_ITEM( tmp, 0 ); if( PySequence_Check( tmp2 ) ) @@ -4028,7 +4028,7 @@ static PyObject *MFaceSeq_extend( BPy_MEdgeSeq * self, PyObject *args ) case 1: /* better be a sequence or a tuple */ /* if a sequence... */ tmp = PyTuple_GET_ITEM( args, 0 ); - if( PySequence_Check( tmp ) && PySequence_Size( tmp ) == 1 ) { + if( PySequence_Check( tmp ) && PySequence_Size( tmp ) > 0 ) { /* if another sequence, use it */ PyObject *tmp2 = PySequence_ITEM( tmp, 0 ); if( PySequence_Check( tmp2 ) ) diff --git a/source/blender/python/api2_2x/doc/Mesh.py b/source/blender/python/api2_2x/doc/Mesh.py index 598e80a0ecd..234e82a63bf 100644 --- a/source/blender/python/api2_2x/doc/Mesh.py +++ b/source/blender/python/api2_2x/doc/Mesh.py @@ -4,25 +4,6 @@ The Blender.Mesh submodule. B{New}: - - L{transform()}: apply transform matrix to mesh vertices - - L{getFromObject()}: get mesh data from other - geometry objects - - L{findEdges()}: determine if and where edges exist in the - mesh's edge list - - delete methods for L{verts}, L{edges} - and L{faces} - - new experimental mesh tools: - L{mesh.fill()}, - L{mesh.flipNormals()}, - L{mesh.recalcNormals()}, - L{mesh.remDoubles()}, - L{mesh.smooth()}, - L{mesh.subdivide()}, - L{mesh.toSphere()}, - L{mesh.quadToTriangle()}, - L{mesh.triangleToQuad()} - - methods for accessing and modifying vertex groups - - and if you're never used Mesh before, everything! Mesh Data ========= @@ -465,8 +446,11 @@ class MFace: list. It is in the range [0,15]. @type mat: int @ivar image: The Image used as a texture for this face. - Will throw an exception if the mesh does not have UV faces; use - L{Mesh.faceUV} to test. + Setting this attribute will create UV faces if they do not exist. + Getting this attribute throw an exception if the mesh does not have + UV faces; use L{Mesh.faceUV} to test. + Assigning an image will automatically set the TEX attribute of the + L{mode} bitfield. @type image: Image @ivar mode: The texture mode bitfield (see L{FaceModes}). Will throw an exception if the mesh does not have UV faces; use @@ -492,14 +476,16 @@ class MFace: @type transp: int @ivar uv: The face's UV coordinates. Each vertex has its own UV coordinate. - Will throw an exception if the mesh does not have UV faces; use - L{Mesh.faceUV} to test. + Setting this attribute will create UV faces if they do not exist. + Getting this attribute throw an exception if the mesh does not have + UV faces; use L{Mesh.faceUV} to test. @type uv: list of vectors (WRAPPED DATA) @ivar uvSel: The face's UV coordinates seletion state; a 1 indicates the vertex is selected. Each vertex has its own UV coordinate select state (this is not the same as the vertex's edit mode selection state). - Will throw an exception if the mesh does not have UV faces; use - L{Mesh.faceUV} to test. + Setting this attribute will create UV faces if they do not exist. + Getting this attribute throw an exception if the mesh does not have + UV faces; use L{Mesh.faceUV} to test. @type uvSel: list of ints @ivar no: The face's normal vector (x, y, z). Read-only. @type no: vector