added fakeUser and users to more pytypes

This commit is contained in:
2006-12-17 02:16:29 +00:00
parent 6acadfe982
commit 1041ad4719
11 changed files with 113 additions and 64 deletions

View File

@@ -2869,26 +2869,7 @@ static PyObject *Material_getFakeUser( BPy_Material * self )
static int Material_setFakeUser( BPy_Material * self, PyObject * value )
{
int param;
ID *id = &self->material->id;
param = PyObject_IsTrue( value );
if( param == -1 )
return EXPP_ReturnIntError( PyExc_TypeError,
"expected int argument in range [0,1]" );
if (param) {
if (!(id->flag & LIB_FAKEUSER)) {
id->flag |= LIB_FAKEUSER;
id_us_plus(id);
}
} else {
if (id->flag & LIB_FAKEUSER) {
id->flag &= ~LIB_FAKEUSER;
id->us--;
}
}
return 0;
return SetIdFakeUser(&self->material->id, value);
}