diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/python/api2_2x/Object.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c index f26b5dd2b76..9ec0ffa8c00 100644 --- a/source/blender/python/api2_2x/Object.c +++ b/source/blender/python/api2_2x/Object.c @@ -2904,13 +2904,21 @@ static int Object_setDupliGroup( BPy_Object * self, BPy_Group * args ) { Object *ob= self->object; - if( (PyObject *)args == Py_None ) + if( (PyObject *)args == Py_None ) { + if (ob->dup_group) + ob->dup_group->id.us--; + ob->dup_group = NULL; - else if( BPy_Group_Check( args ) ) + } else if( BPy_Group_Check( args ) ) { + if (ob->dup_group) + ob->dup_group->id.us--; + ob->dup_group = args->group; - else + ob->dup_group->id.us++; + } else { return EXPP_ReturnIntError( PyExc_TypeError, "expected a group or None" ); + } return 0; } |