Page Menu
Home
Search
Configure Global Search
Log In
Files
F1298
shapes.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
Johnny Matthews (guitargeek)
Nov 13 2013, 12:56 PM
Size
3 KB
Subscribers
None
shapes.patch
View Options
Index: source/blender/python/api2_2x/Object.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/Object.c,v
retrieving revision 1.135
diff -u -r1.135 Object.c
--- source/blender/python/api2_2x/Object.c 4 Oct 2005 15:17:27 -0000 1.135
+++ source/blender/python/api2_2x/Object.c 4 Oct 2005 18:34:48 -0000
@@ -263,6 +263,11 @@
static PyObject *Object_setSBUseEdges( BPy_Object * self, PyObject * args );
static PyObject *Object_getSBStiffQuads( BPy_Object * self );
static PyObject *Object_setSBStiffQuads( BPy_Object * self, PyObject * args );
+
+static PyObject *Object_getShapesPinned( BPy_Object * self );
+static PyObject *Object_setShapesPinned( BPy_Object * self, PyObject * args );
+static PyObject *Object_getShapesCurrent( BPy_Object * self );
+static PyObject *Object_setShapesCurrent( BPy_Object * self, PyObject * args );
/*****************************************************************************/
/* Python BPy_Object methods table: */
/*****************************************************************************/
@@ -429,6 +434,15 @@
{"setSBStiffQuads", ( PyCFunction ) Object_setSBStiffQuads, METH_VARARGS,
"Sets SB StiffQuads"},
+ {"getShapesPinned", ( PyCFunction ) Object_getShapesPinned, METH_NOARGS,
+ "Returns Pinned Status for Shape Keys"},
+ {"setShapesPinned", ( PyCFunction ) Object_setShapesPinned, METH_VARARGS,
+ "Sets Pinned Status for Shape Keys"},
+ {"getShapesCurrent", ( PyCFunction ) Object_getShapesCurrent, METH_NOARGS,
+ "gets Current Shape Key for Object"},
+ {"setShapesCurrent", ( PyCFunction ) Object_setShapesCurrent, METH_VARARGS,
+ "Sets Current Shape Key for Object"},
+
{"getBoundBox", ( PyCFunction ) Object_getBoundBox, METH_NOARGS,
"Returns the object's bounding box"},
@@ -4078,6 +4092,60 @@
return 0;
}
}
+
+
+PyObject *Object_getShapesPinned( BPy_Object * self ){
+ PyObject *attr = NULL;
+ if(self->object->shapeflag == OB_SHAPE_LOCK){
+ attr = PyInt_FromLong(1);
+ }
+ else{ attr = PyInt_FromLong(0); }
+
+ if( attr )
+ return attr;
+ return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
+ "couldn't get Object->shapeflag attribute" ) );
+
+}
+
+PyObject *Object_setShapesPinned( BPy_Object * self, PyObject * args ){
+ short value;
+
+ if( !PyArg_ParseTuple( args, "h", &value ) )
+ return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
+ "expected integer argument" ) );
+
+ if(value >= 1){
+ self->object->shapeflag = 1;
+ } else{
+ self->object->shapeflag = 0;
+ }
+
+ return EXPP_incr_ret( Py_None );
+}
+
+PyObject *Object_getShapesCurrent( BPy_Object * self ){
+ PyObject *attr = NULL;
+ attr = PyInt_FromLong(self->object->shapenr);
+ if( attr )
+ return attr;
+ return ( EXPP_ReturnPyObjError( PyExc_RuntimeError,
+ "couldn't get Object->shapenr attribute" ) );
+}
+
+PyObject *Object_setShapesCurrent( BPy_Object * self, PyObject * args ){
+ short value;
+
+ if( !PyArg_ParseTuple( args, "h", &value ) )
+ return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
+ "expected integer argument" ) );
+
+ self->object->shapenr = (char)value;
+
+ return EXPP_incr_ret( Py_None );
+}
+
+
/*
* scan list of Objects looking for matching obdata.
File Metadata
Details
Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d2/c1/0596cb78937fa8ef8a9b4cdab825
Event Timeline
Log In to Comment