[Bf-blender-cvs] [249f2b9] master: RNA: use 1/0 for move layers operator

Dalai Felinto noreply at git.blender.org
Mon Feb 23 16:34:45 CET 2015


Commit: 249f2b9ccfc26a0e1b98ad8d8da7f60701634894
Author: Dalai Felinto
Date:   Mon Feb 23 12:17:28 2015 -0300
Branches: master
https://developer.blender.org/rB249f2b9ccfc26a0e1b98ad8d8da7f60701634894

RNA: use 1/0 for move layers operator

internal api Consistency.

For the records, I suspect there are still a few cases of this. I found
this by chance (moving an object to a different layer), and I ran into
the previous one (fixed by Campbell) as well (by adding a cube).

Anyways, since it only happens when building with crash on asserts is
not a big issue. But by the time we change RNA to use bool instead of
int it would be nice to do a call for test to prevent those breaks.

===================================================================

M	source/blender/editors/object/object_relations.c

===================================================================

diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 430994a..bfa501c 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -1316,7 +1316,7 @@ static unsigned int move_to_layer_init(bContext *C, wmOperator *op)
 		CTX_DATA_END;
 
 		for (a = 0; a < 20; a++)
-			values[a] = (lay & (1 << a));
+			values[a] = (lay & (1 << a)) != 0;
 
 		RNA_boolean_set_array(op->ptr, "layers", values);
 	}




More information about the Bf-blender-cvs mailing list