Page Menu
Home
Search
Configure Global Search
Log In
Files
F2063
patch-2033.txt
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
Ken Hughes (khughes)
Nov 13 2013, 1:01 PM
Size
2 KB
Subscribers
None
patch-2033.txt
View Options
Index: blender/source/blender/python/api2_2x/Lattice.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/Lattice.c,v
retrieving revision 1.8
diff -u -u -r1.8 Lattice.c
--- blender/source/blender/python/api2_2x/Lattice.c 31 Mar 2005 18:49:52 -0000 1.8
+++ blender/source/blender/python/api2_2x/Lattice.c 15 May 2005 23:12:33 -0000
@@ -205,7 +205,7 @@
};
static int Lattice_InLatList( BPy_Lattice * self );
-static int Lattice_IsLinkedToObject( BPy_Lattice * self );
+static Object * Lattice_IsLinkedToObject( BPy_Lattice * self );
//***************************************************************************
@@ -676,21 +676,20 @@
//This function will not do anything if there are no children
static PyObject *Lattice_applyDeform( BPy_Lattice * self )
{
- //Object* ob; unused
+ Object* ob;
Base *base;
- Object *par;
- if( !Lattice_IsLinkedToObject( self ) )
+ // find the object to which this lattice is linked
+ ob = Lattice_IsLinkedToObject( self );
+ if( !ob )
return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
- "Lattice must be linked to an object to apply it's deformation!" ) );
+ "Lattice must be linked to an object to apply its deformation!" ) );
//deform children
base = FIRSTBASE;
while( base ) {
- if( ( par = base->object->parent ) ) {
- if( par->type == OB_LATTICE ) {
- object_deform( base->object );
- }
+ if( ( ob == base->object->parent ) ) {
+ object_deform( base->object );
}
base = base->next;
}
@@ -895,17 +894,17 @@
}
// Internal function to confirm if a Lattice has an object it's linked to.
-static int Lattice_IsLinkedToObject( BPy_Lattice * self )
+static Object * Lattice_IsLinkedToObject( BPy_Lattice * self )
{
//check to see if lattice is linked to an object
Object *ob = G.main->object.first;
while( ob ) {
if( ob->type == OB_LATTICE ) {
if( self->Lattice == ob->data ) {
- return 1;
+ break;
}
}
ob = ob->id.next;
}
- return 0;
+ return ob;
}
File Metadata
Details
Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
35/8f/3d0415accb351703bd03eccebfab
Event Timeline
Log In to Comment