Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-11-01 00:29:32 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-11-01 00:29:32 +0400
commit1bcadda46b96e3e557aad1b0d2d53a0b4743b413 (patch)
tree3f749a30df330ced48905860da40b1ed21254f6e /source/blender/python/generic/idprop_py_api.c
parent26541afc8b9bfa0b11ecd2dcdab120cfcfff5d92 (diff)
fix [#30910] Problems: Add Shortcut(s) for "Ctrl Tab" menu
comparing keymaps was too sloppy or too strict, now sloppy keymap comparison works by setting all the operator properties to their default values if they are not already set, then compare this with the keymap item (ignoring values missing from either one). ... this way any non default keymap setting wont match with an operator menu item which doesnt set this operator at all (a problem sighted in this bug report). developer notes: - IDP_EqualsProperties_ex() function adds an argument to treat missing members of either group to act as if there is a match. - WM_operator_properties_default() function to reset RNA values to their defaults. - add IDP_spit(), debug only function to print out ID properties.
Diffstat (limited to 'source/blender/python/generic/idprop_py_api.c')
-rw-r--r--source/blender/python/generic/idprop_py_api.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c
index 05b37514e20..34210ace884 100644
--- a/source/blender/python/generic/idprop_py_api.c
+++ b/source/blender/python/generic/idprop_py_api.c
@@ -1497,3 +1497,40 @@ PyObject *BPyInit_idprop(void)
return mod;
}
+
+
+#ifdef DEBUG
+/* -------------------------------------------------------------------- */
+/* debug only function */
+
+void IDP_spit(IDProperty *prop)
+{
+ if (prop) {
+ PyGILState_STATE gilstate;
+ int use_gil = TRUE; /* !PYC_INTERPRETER_ACTIVE; */
+ PyObject *ret_dict;
+ PyObject *ret_str;
+
+ if (use_gil) {
+ gilstate = PyGILState_Ensure();
+ }
+
+ /* to_dict() */
+ ret_dict = BPy_IDGroup_MapDataToPy(prop);
+ ret_str = PyObject_Repr(ret_dict);
+ Py_DECREF(ret_dict);
+
+ printf("IDProperty: %s\n", _PyUnicode_AsString(ret_str));
+
+ Py_DECREF(ret_str);
+
+ if (use_gil) {
+ PyGILState_Release(gilstate);
+ }
+ }
+ else {
+ printf("IDProperty: <NIL>\n");
+ }
+}
+
+#endif