- switch to using softbody modifier, controls enabling but does not have

variables, these are still in same place. enable button automatically
   makes/enables modifier.
 - changed hook to hook modifier conversion to happen on direct link,
   required to make sure we don't forget to free any memory for files
   saved with 2.38 that have hooks.
 - update modifier interface to enforce modifiers with the require-original-
   data flag to not move beyond deforming modifiers.
 - enforce only one softbody modifier allowed

NOTE: Once again, no modifier stack for lattice yet means softbody for
lattice does not work atm.
This commit is contained in:
2005-08-11 02:23:52 +00:00
parent 2f32c8451c
commit ac3ed0f92a
12 changed files with 156 additions and 222 deletions

View File

@@ -259,10 +259,6 @@ static PyObject *Object_getSBInnerSpringFriction( BPy_Object * self );
static PyObject *Object_setSBInnerSpringFriction( BPy_Object * self, PyObject * args );
static PyObject *Object_getSBDefaultGoal( BPy_Object * self );
static PyObject *Object_setSBDefaultGoal( BPy_Object * self, PyObject * args );
static PyObject *Object_getSBEnable( BPy_Object * self );
static PyObject *Object_setSBEnable( BPy_Object * self, PyObject * args );
static PyObject *Object_getSBPostDef( BPy_Object * self );
static PyObject *Object_setSBPostDef( BPy_Object * self, PyObject * args );
static PyObject *Object_getSBUseGoal( BPy_Object * self );
static PyObject *Object_setSBUseGoal( BPy_Object * self, PyObject * args );
static PyObject *Object_getSBUseEdges( BPy_Object * self );
@@ -422,14 +418,6 @@ automatic when the script finishes."},
"Returns SB DefaultGoal"},
{"setSBDefaultGoal", ( PyCFunction ) Object_setSBDefaultGoal, METH_VARARGS,
"Sets SB DefaultGoal"},
{"getSBEnable", ( PyCFunction ) Object_getSBEnable, METH_NOARGS,
"Returns SB Enable"},
{"setSBEnable", ( PyCFunction ) Object_setSBEnable, METH_VARARGS,
"Sets SB Enable"},
{"getSBPostDef", ( PyCFunction ) Object_getSBPostDef, METH_NOARGS,
"Returns SB PostDef"},
{"setSBPostDef", ( PyCFunction ) Object_setSBPostDef, METH_VARARGS,
"Sets SB PostDef"},
{"getSBUseGoal", ( PyCFunction ) Object_getSBUseGoal, METH_NOARGS,
"Returns SB UseGoal"},
{"setSBUseGoal", ( PyCFunction ) Object_setSBUseGoal, METH_VARARGS,
@@ -3924,97 +3912,6 @@ PyObject *Object_setSBDefaultGoal( BPy_Object * self, PyObject * args )
return EXPP_incr_ret( Py_None );
}
PyObject *Object_getSBEnable( BPy_Object * self )
{
/*short flag = self->object->softflag;*/
PyObject *attr = NULL;
if(!self->object->soft){
if(!setupSB(self->object))
return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
"softbody could not be accessed (null pointer)" ) );
}
if(self->object->softflag & OB_SB_ENABLE){
attr = PyInt_FromLong(1);
}
else{ attr = PyInt_FromLong(0); }
if( attr )
return attr;
return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
"couldn't get Object->softflag attribute" ) );
}
PyObject *Object_setSBEnable( BPy_Object * self, PyObject * args )
{
short value;
if(!self->object->soft){
if(!setupSB(self->object))
return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
"softbody could not be accessed (null pointer)" ) );
}
if( !PyArg_ParseTuple( args, "h", &value ) )
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
"expected integer argument" ) );
if(value > 0){
self->object->softflag |= OB_SB_ENABLE;
}
else{
self->object->softflag &= ~OB_SB_ENABLE;
}
return EXPP_incr_ret( Py_None );
}
PyObject *Object_getSBPostDef( BPy_Object * self )
{
/*short flag = self->object->softflag;*/
PyObject *attr = NULL;
if(!self->object->soft){
if(!setupSB(self->object))
return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
"softbody could not be accessed (null pointer)" ) );
}
if(self->object->softflag & OB_SB_POSTDEF){
attr = PyInt_FromLong(1);
}
else{ attr = PyInt_FromLong(0); }
if( attr )
return attr;
return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
"couldn't get Object->softflag attribute" ) );
}
PyObject *Object_setSBPostDef( BPy_Object * self, PyObject * args )
{
short value;
if(!self->object->soft){
if(!setupSB(self->object))
return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
"softbody could not be accessed (null pointer)" ) );
}
if( !PyArg_ParseTuple( args, "h", &value ) )
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
"expected integer argument" ) );
if(value){ self->object->softflag |= OB_SB_POSTDEF; }
else{ self->object->softflag &= ~OB_SB_POSTDEF; }
return EXPP_incr_ret( Py_None );
}
PyObject *Object_getSBUseGoal( BPy_Object * self )
{
/*short flag = self->object->softflag;*/