Blender Git Loki
Git Commits -> Revision 37b82a2
Revision 37b82a2 by Lukas Toenne (master) September 20, 2013, 09:10 (GMT) |
Fix #36226, Select Linked works not in touch with Prefs. When setting keymap properties to values equalling the RNA default, they will get "unset" and automatic operator behavior is used. There is no way to explicitly set the default value as a user. 1) To allow distinguishing uninitialized (not set) properties in the keymap items, a few changes to the RNA struct comparison function are needed: Instead of allowing only strict/non-strict comparison of 2 properties A and B in a struct, this now has 3 modes: * STRICT: compare only the actual property values (same as 'strict' before) * UNSET_MATCH_ANY: if either A or B is unset, consider them a match (same as non-strict before) * UNSET_MATCH_NONE: if one property is set and the other not, consider them a mismatch. The new UNSET_MATCH_NONE mode is useful for keymaps, because it allows keeping user-defined property values in the keymap even if they match the default property value (see wm_keymap_diff function in wm_keymap.c) 2) A new operator is added for unsetting ID properties in the RMB context menu and in user preferences next to keymap properties. This only works on ID properties and deletes the ID property storage, so that the default value is used. In the user preferences for keymaps the properties are shown in an inactive layout to indicate that the default value is used (which some operators such as the "select linked" op from the report use to trigger automatic behavior). When the user sets a property it gets set and stays that way until explicitly "unset" using the new operator. |
Commit Details:
Full Hash: 37b82a2d260edc1e719cba845360c0c40a24e241
SVN Revision: 60255
Parent Commit: 203c6ef
Lines Changed: +114, -39
6 Modified Paths:
/source/blender/editors/interface/interface_handlers.c (+10, -1) (Diff)
/source/blender/editors/interface/interface_ops.c (+63, -25) (Diff)
/source/blender/editors/interface/interface_templates.c (+19, -3) (Diff)
/source/blender/makesrna/intern/rna_access.c (+13, -7) (Diff)
/source/blender/makesrna/RNA_access.h (+8, -2) (Diff)
/source/blender/windowmanager/intern/wm_keymap.c (+1, -1) (Diff)
/source/blender/editors/interface/interface_ops.c (+63, -25) (Diff)
/source/blender/editors/interface/interface_templates.c (+19, -3) (Diff)
/source/blender/makesrna/intern/rna_access.c (+13, -7) (Diff)
/source/blender/makesrna/RNA_access.h (+8, -2) (Diff)
/source/blender/windowmanager/intern/wm_keymap.c (+1, -1) (Diff)