Fix #20432: object.layers did not do correct update, could miss depsgraph rebuild.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 21 Dec 2009 10:50:32 +0000 (10:50 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 21 Dec 2009 10:50:32 +0000 (10:50 +0000)
source/blender/makesrna/intern/rna_object.c

index 4c22316be1987f6857083191ca97812f258f7c90..b4e288e776dcc4014c8895bf452d71967558fb0c 100644 (file)
@@ -190,9 +190,11 @@ static void rna_Object_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr)
        base= object_in_scene(ob, scene);
        if(!base)
                return;
+       
+       SWAP(int, base->lay, ob->lay);
 
-       base->lay= ob->lay;
        rna_Object_layer_update__internal(scene, base, ob);
+       ob->lay= base->lay;
 }
 
 static void rna_Base_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr)
@@ -200,9 +202,8 @@ static void rna_Base_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr)
        Base *base= (Base*)ptr->id.data;
        Object *ob= (Object*)base->object;
 
-       ob->lay= base->lay;
-
        rna_Object_layer_update__internal(scene, base, ob);
+       ob->lay= base->lay;
 }
 
 static int rna_Object_data_editable(PointerRNA *ptr)