[Bf-blender-cvs] [9467555] tmp-id-users: Fix docstring and broken logic (inversion between key and value filtering).

Bastien Montagne noreply at git.blender.org
Wed Jan 6 19:33:53 CET 2016


Commit: 94675550e0cc03c451ac744cfe0f8bfdab17184a
Author: Bastien Montagne
Date:   Wed Jan 6 19:33:22 2016 +0100
Branches: tmp-id-users
https://developer.blender.org/rB94675550e0cc03c451ac744cfe0f8bfdab17184a

Fix docstring and broken logic (inversion between key and value filtering).

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

M	source/blender/python/intern/bpy_rna_id_collection.c

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

diff --git a/source/blender/python/intern/bpy_rna_id_collection.c b/source/blender/python/intern/bpy_rna_id_collection.c
index 7ca3451..9375958 100644
--- a/source/blender/python/intern/bpy_rna_id_collection.c
+++ b/source/blender/python/intern/bpy_rna_id_collection.c
@@ -198,8 +198,8 @@ PyDoc_STRVAR(bpy_user_map_doc,
 "   :type subset: sequence\n"
 "   :arg key_types: Filter the keys mapped by ID types.\n"
 "   :type key_types: set of strings\n"
-"   :arg key_types: Filter the values in the set by ID types.\n"
-"   :type key_types: set of strings\n"
+"   :arg value_types: Filter the values in the set by ID types.\n"
+"   :type value_types: set of strings\n"
 "   :return: dictionary of :class:`bpy.types.ID` instances, with sets of ID's as their values.\n"
 "   :rtype: dict\n"
 );
@@ -272,7 +272,7 @@ static PyObject *bpy_user_map(PyObject *UNUSED(self), PyObject *args, PyObject *
 		data_cb.user_map = PyDict_New();
 	}
 
-	data_cb.types_bitmap = val_types_bitmap;
+	data_cb.types_bitmap = key_types_bitmap;
 
 	ListBase *lb_array[MAX_LIBARRAY];
 	int lb_index;
@@ -280,8 +280,8 @@ static PyObject *bpy_user_map(PyObject *UNUSED(self), PyObject *args, PyObject *
 
 	while (lb_index--) {
 
-		if (key_types_bitmap && lb_array[lb_index]->first) {
-			if (!id_check_type(lb_array[lb_index]->first, key_types_bitmap)) {
+		if (val_types_bitmap && lb_array[lb_index]->first) {
+			if (!id_check_type(lb_array[lb_index]->first, val_types_bitmap)) {
 				continue;
 			}
 		}




More information about the Bf-blender-cvs mailing list