All pastes #147675 Raw Edit

kh_pylon

public python v1 · immutable
#147675 ·published 2006-08-24 15:30 UTC
rendered paste body
Index: source/blender/python/api2_2x/Mesh.c===================================================================RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/Mesh.c,vretrieving revision 1.73diff -p -u -r1.73 Mesh.c--- source/blender/python/api2_2x/Mesh.c	22 Aug 2006 18:08:57 -0000	1.73+++ source/blender/python/api2_2x/Mesh.c	24 Aug 2006 14:50:45 -0000@@ -4594,7 +4594,8 @@ static PyObject *MFaceSeq_nextIter( BPy_  *  ************************************************************************/ -static PyObject *MFaceSeq_extend( BPy_MEdgeSeq * self, PyObject *args )+static PyObject *MFaceSeq_extend( BPy_MEdgeSeq * self, PyObject *args,+	  PyObject *keywds ) { 	/* 	 * (a) check input for valid edge objects, faces which consist of@@ -4615,6 +4616,7 @@ static PyObject *MFaceSeq_extend( BPy_ME 	PyObject *tmp; 	MFace *tmpface; 	Mesh *mesh = self->mesh;+	int ignore_dups = 0;  	/* before we try to add faces, add edges; if it fails; exit */ @@ -4622,6 +4624,15 @@ static PyObject *MFaceSeq_extend( BPy_ME 	if( !tmp ) 		return NULL; +	if( keywds ) {+		PyObject *res = PyDict_GetItemString( keywds, "ignore" );++		if( !res )+			return EXPP_ReturnPyObjError( PyExc_TypeError,+					"invalid keyword" );+		ignore_dups = PyObject_IsTrue( res );+	}+ 	Py_DECREF( tmp );  	/* make sure we get a tuple of sequences of something */@@ -4788,18 +4799,20 @@ static PyObject *MFaceSeq_extend( BPy_ME  	tmppair = newpair;	/* "last good edge" */ 	tmppair2 = &tmppair[1];	/* "current candidate edge" */-	for( i = 0; i < new_face_count; ++i ) {-		if( mface_comp( tmppair, tmppair2 ) )-			tmppair = tmppair2;	/* last != current, so current == last */-		else {-			tmppair2->v[1] = 0; /* last == current, so mark as duplicate */-			--good_faces;		/* one less good face */+	if( !ignore_dups ) {+		for( i = 0; i < new_face_count; ++i ) {+			if( mface_comp( tmppair, tmppair2 ) )+				tmppair = tmppair2;	/* last != current, so current == last */+			else {+				tmppair2->v[1] = 0; /* last == current, so mark as duplicate */+				--good_faces;		/* one less good face */+			}+			tmppair2++; 		}-		tmppair2++; 	}  	/* if mesh has faces, see if any of the new faces are already in it */-	if( mesh->totface ) {+	if( mesh->totface && !ignore_dups ) { 		oldpair = (SrchFaces *)MEM_callocN( sizeof(SrchFaces)*mesh->totface, 				"MFacePairs" );