Outliner: Toggle restrict buttons only for selectable child objects

D404 by @rupp with minor edits by me.
This commit is contained in:
Julian Eisel 2015-02-14 21:54:31 +01:00
parent 354cf76803
commit 24976dd29d

@ -176,8 +176,11 @@ static void restrictbutton_recursive_child(bContext *C, Scene *scene, Object *ob
{
Main *bmain = CTX_data_main(C);
Object *ob;
for (ob = bmain->object.first; ob; ob = ob->id.next) {
if (BKE_object_is_child_recursive(ob_parent, ob)) {
/* only do if child object is selectable */
if ((flag == OB_RESTRICT_SELECT) || (ob->restrictflag & OB_RESTRICT_SELECT) == 0) {
if (state) {
ob->restrictflag |= flag;
if (deselect) {
@ -187,6 +190,7 @@ static void restrictbutton_recursive_child(bContext *C, Scene *scene, Object *ob
else {
ob->restrictflag &= ~flag;
}
}
if (rnapropname) {
PointerRNA ptr;