diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c index c7dc4dfa157..44c67089d48 100644 --- a/source/blender/python/api2_2x/Object.c +++ b/source/blender/python/api2_2x/Object.c @@ -172,7 +172,8 @@ enum obj_consts { EXPP_OBJ_ATTR_TIMEOFFSET, EXPP_OBJ_ATTR_DRAWSIZE, EXPP_OBJ_ATTR_PARENT_TYPE, - + EXPP_OBJ_ATTR_PASSINDEX, + EXPP_OBJ_ATTR_PI_SURFACEDAMP, /* these need to stay together */ EXPP_OBJ_ATTR_PI_RANDOMDAMP, /* and in order */ EXPP_OBJ_ATTR_PI_PERM, @@ -3544,6 +3545,9 @@ static PyObject *getIntAttr( BPy_Object *self, void *type ) case EXPP_OBJ_ATTR_DUPEND: param = object->dupend; break; + case EXPP_OBJ_ATTR_PASSINDEX: + param = object->index; + break; default: return EXPP_ReturnPyObjError( PyExc_RuntimeError, "undefined type in getIntAttr" ); @@ -3593,6 +3597,12 @@ static int setIntAttrClamp( BPy_Object *self, PyObject *value, void *type ) size = 'H'; /* in case max is later made > 32767 */ param = (void *)&object->dupend; break; + case EXPP_OBJ_ATTR_PASSINDEX: + min = 0; + max = 1000; + size = 'H'; /* in case max is later made > 32767 */ + param = (void *)&object->index; + break; default: return EXPP_ReturnIntError( PyExc_RuntimeError, "undefined type in setIntAttrClamp"); @@ -4102,7 +4112,7 @@ static int setFloat3Attr( BPy_Object *self, PyObject *value, void *type ) static PyObject *Object_getRestricted( BPy_Object *self, void *type ) { - if (self->object->restrictflag & (short)type) + if (self->object->restrictflag & (int)type) Py_RETURN_TRUE; else Py_RETURN_FALSE; @@ -4112,9 +4122,9 @@ static int Object_setRestricted( BPy_Object *self, PyObject *value, void *type ) { if (PyObject_IsTrue(value) ) - self->object->restrictflag |= (short)type; + self->object->restrictflag |= (int)type; else - self->object->restrictflag &= ~(short)type; + self->object->restrictflag &= ~(int)type; return 0; } @@ -4777,6 +4787,10 @@ static PyGetSetDef BPy_Object_getseters[] = { (getter)getIntAttr, (setter)setIntAttrClamp, "Ending frame (for DupliFrames)", (void *)EXPP_OBJ_ATTR_DUPEND}, + {"passIndex", + (getter)getIntAttr, (setter)setIntAttrClamp, + "Index for object masks in the compositor", + (void *)EXPP_OBJ_ATTR_PASSINDEX}, {"mat", (getter)Object_getMatrixWorld, (setter)NULL, "worldspace matrix: absolute, takes vertex parents, tracking and Ipos into account", diff --git a/source/blender/python/api2_2x/doc/Object.py b/source/blender/python/api2_2x/doc/Object.py index 5e57b900f55..211a6e96616 100644 --- a/source/blender/python/api2_2x/doc/Object.py +++ b/source/blender/python/api2_2x/doc/Object.py @@ -436,6 +436,9 @@ class Object: @ivar DupOff: The DupliFrame removal of every Nth frame for this object. Use with L{enableDupFrames}. Value is clamped to [0,1500]. @type DupOff: int + @ivar passIndex: Index # for the IndexOB render pass. + Value is clamped to [0,1000]. + @type DupOff: int @ivar drawSize: The size to display the Empty. Value clamped to [0.01,10.0]. @type drawSize: float diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c index c68956d72e5..44ae6421a70 100644 --- a/source/blender/src/buttons_object.c +++ b/source/blender/src/buttons_object.c @@ -1887,7 +1887,7 @@ static void object_panel_object(Object *ob) /* parent */ uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_OBJECTPANELPARENT, "Par:", xco+5, 180, 305-xco, 20, &ob->parent, "Parent Object"); - but = uiDefButS(block, NUM, B_NOP, "PassIndex:", xco+5, 150, 305-xco, 20, &ob->index, 0.0, 1000.0, 0, 0, "Object Pass Index"); + but = uiDefButS(block, NUM, B_NOP, "PassIndex:", xco+5, 150, 305-xco, 20, &ob->index, 0.0, 1000.0, 0, 0, "Index # for the IndexOB render pass."); uiDefBlockBut(block, add_groupmenu, NULL, "Add to Group", 10,150,150,20, "Add Object to a new Group");