From 859959b49c8122b1e37027cf5009fecd23f5d8c8 Mon Sep 17 00:00:00 2001 From: Willian Padovani Germano Date: Tue, 17 May 2005 07:17:52 +0000 Subject: BPython: - fixing bug reported by Paolo Colombo: space handler slinks set for a 3d view were not set when the area got maximized; - Blender.Object: added object.isSB() method to know if an object is a soft body (has ob->soft != NULL). Used in fixfromarmature.py. Scripts: - updates: batch_name_edit (Campbell), fixfromarmature (JMS); - additions: X3D exporter by Bart; Envelope Suite by Jonas Petersen; BVH 2 Armature by Jean-Baptiste Perin; Camera Changer by Regis Montoya (3R); Interactive Console by Campbell (ideasman). - tiny updates in other scripts. --- source/blender/python/api2_2x/Object.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'source/blender/python') diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c index d07633a5185..53a3b3fe98e 100644 --- a/source/blender/python/api2_2x/Object.c +++ b/source/blender/python/api2_2x/Object.c @@ -211,6 +211,7 @@ static PyObject *Object_setPISurfaceDamp( BPy_Object * self, PyObject * args ); static PyObject *Object_getPIDeflection( BPy_Object * self ); static PyObject *Object_setPIDeflection( BPy_Object * self, PyObject * args ); +static PyObject *Object_isSB( BPy_Object * self ); static PyObject *Object_getSBMass( BPy_Object * self ); static PyObject *Object_setSBMass( BPy_Object * self, PyObject * args ); static PyObject *Object_getSBGravity( BPy_Object * self ); @@ -348,6 +349,8 @@ automatic when the script finishes."}, /* Softbody */ + {"isSB", ( PyCFunction ) Object_isSB, METH_NOARGS, + "True if object is a soft body"}, {"getSBMass", ( PyCFunction ) Object_getSBMass, METH_NOARGS, "Returns SB Mass"}, {"setSBMass", ( PyCFunction ) Object_setSBMass, METH_VARARGS, @@ -3225,6 +3228,13 @@ PyObject *Object_setPIDeflection( BPy_Object * self, PyObject * args ) /* SOFTBODY FUNCTIONS */ +PyObject *Object_isSB(BPy_Object *self) +{ + if (self->object->soft) + return EXPP_incr_ret_True(); + else return EXPP_incr_ret_False(); +} + PyObject *Object_getSBMass( BPy_Object * self ) { PyObject *attr; @@ -3678,7 +3688,7 @@ PyObject *Object_setSBDefaultGoal( BPy_Object * self, PyObject * args ) PyObject *Object_getSBEnable( BPy_Object * self ) { - short flag = self->object->softflag; + /*short flag = self->object->softflag;*/ PyObject *attr = NULL; if(!self->object->soft){ @@ -3726,7 +3736,7 @@ PyObject *Object_setSBEnable( BPy_Object * self, PyObject * args ) PyObject *Object_getSBPostDef( BPy_Object * self ) { - short flag = self->object->softflag; + /*short flag = self->object->softflag;*/ PyObject *attr = NULL; if(!self->object->soft){ @@ -3769,7 +3779,7 @@ PyObject *Object_setSBPostDef( BPy_Object * self, PyObject * args ) } PyObject *Object_getSBUseGoal( BPy_Object * self ) { - short flag = self->object->softflag; + /*short flag = self->object->softflag;*/ PyObject *attr = NULL; if(!self->object->soft){ @@ -3812,7 +3822,7 @@ PyObject *Object_setSBUseGoal( BPy_Object * self, PyObject * args ) PyObject *Object_getSBUseEdges( BPy_Object * self ) { - short flag = self->object->softflag; + /*short flag = self->object->softflag;*/ PyObject *attr = NULL; if(!self->object->soft){ @@ -3855,7 +3865,7 @@ PyObject *Object_setSBUseEdges( BPy_Object * self, PyObject * args ) PyObject *Object_getSBStiffQuads( BPy_Object * self ) { - short flag = self->object->softflag; + /*short flag = self->object->softflag;*/ PyObject *attr = NULL; if(!self->object->soft){ -- cgit v1.2.3