Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2007-02-25 10:36:50 +0300
committerCampbell Barton <ideasman42@gmail.com>2007-02-25 10:36:50 +0300
commit436e1697fdf07f5a17bcfbdde8b18e89e44e9cf1 (patch)
tree6e7695edfd05e95a01d4772f24afb84303a8ee0e /source/blender/python/api2_2x/Armature.c
parente64b887fad611917916b2ce30bbcf2aa55593ea5 (diff)
made attributes (name, property, users, fakeUser, lib) into functions all python types can use.
removed a lot of code duplication when moving to this. Also removed unused functions GetMaterialByName(), same for Mesh, Object, World etc.
Diffstat (limited to 'source/blender/python/api2_2x/Armature.c')
-rw-r--r--source/blender/python/api2_2x/Armature.c63
1 files changed, 1 insertions, 62 deletions
diff --git a/source/blender/python/api2_2x/Armature.c b/source/blender/python/api2_2x/Armature.c
index f91c31b25db..6ce4f712381 100644
--- a/source/blender/python/api2_2x/Armature.c
+++ b/source/blender/python/api2_2x/Armature.c
@@ -610,28 +610,6 @@ AttributeError:
"expected a list of integers" );
}
-//------------------------Armature.users (getter)
-static PyObject *Armature_getUsers( BPy_Armature * self )
-{
- return PyInt_FromLong( self->armature->id.us );
-}
-
-
-//------------------------Armature.fakeUser (getter)
-static PyObject *Armature_getFakeUser( BPy_Armature * self )
-{
- if (self->armature->id.flag & LIB_FAKEUSER)
- Py_RETURN_TRUE;
- else
- Py_RETURN_FALSE;
-}
-//------------------------Armature.fakeUser (setter)
-static int Armature_setFakeUser( BPy_Armature * self, PyObject * value )
-{
- return SetIdFakeUser(&self->armature->id, value);
-}
-
-
//------------------------Armature.mirrorEdit (getter)
static PyObject *Armature_getMirrorEdit(BPy_Armature *self, void *closure)
{
@@ -935,38 +913,6 @@ AttributeError:
return EXPP_intError(PyExc_AttributeError, "%s%s",
sArmatureBadArgs, "Expects True or False");
}
-//------------------------Armature.name (getter)
-//Gets the name of the armature
-static PyObject *Armature_getName(BPy_Armature *self, void *closure)
-{
- return PyString_FromString(self->armature->id.name +2); //*new*
-}
-//------------------------Armature.name (setter)
-//Sets the name of the armature
-static int Armature_setName(BPy_Armature *self, PyObject *value, void *closure)
-{
- char *name;
-
- if(value){
- if(PyString_Check(value)){
- name = PyString_AsString(value);
- rename_id(&self->armature->id, name);
- return 0;
- }
- }
- goto AttributeError;
-
-AttributeError:
- return EXPP_intError(PyExc_AttributeError, "%s%s",
- sArmatureBadArgs, "Expects string");
-}
-
-//------------------------Armature.name (getter)
-//Gets the name of the armature
-static PyObject *Armature_getLib(BPy_Armature *self, void *closure)
-{
- return EXPP_GetIdLib((ID *)self->armature);
-}
//------------------------Armature.bones (getter)
//Gets the name of the armature
@@ -1004,10 +950,7 @@ static PyMethodDef BPy_Armature_methods[] = {
//------------------------tp_getset
//This contains methods for attributes that require checking
static PyGetSetDef BPy_Armature_getset[] = {
- {"name", (getter)Armature_getName, (setter)Armature_setName,
- "The armature's name", NULL},
- {"lib", (getter)Armature_getLib, (setter)NULL,
- "The armature's library or None", NULL},
+ GENERIC_LIB_GETSETATTR,
{"bones", (getter)Armature_getBoneDict, (setter)Armature_setBoneDict,
"The armature's Bone dictionary", NULL},
{"vertexGroups", (getter)Armature_getVertexGroups, (setter)Armature_setVertexGroups,
@@ -1034,10 +977,6 @@ static PyGetSetDef BPy_Armature_getset[] = {
"Adds temporal IK chains while grabbing bones", NULL},
{"layers", (getter)Armature_getLayers, (setter)Armature_setLayers,
"List of layers for the armature", NULL},
- {"users", (getter)Armature_getUsers, (setter)NULL,
- "The number of object users", NULL},
- {"fakeUser", (getter)Armature_getFakeUser, (setter)Armature_setFakeUser,
- "The fake user status of this object", NULL},
{NULL, NULL, NULL, NULL, NULL}
};
//------------------------tp_new