diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-01-07 23:52:54 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-01-07 23:52:54 +0300 |
commit | 261ac69f57a9daac370f0a25af955d725d6c77be (patch) | |
tree | f14c5e6500dd0230a3f8710ce45c8017e08e6cc4 /source | |
parent | e63c773b7c7cc3cd4db1ee986942818f2a675c3e (diff) |
Fix RNA_enum_set_identifier(), needs a context to handle correctly dynamic enums.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/object/object_ops.c | 8 | ||||
-rw-r--r-- | source/blender/makesrna/RNA_access.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index eddd67ae8f1..ca775c5c85e 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -336,19 +336,19 @@ void ED_keymap_object(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "OBJECT_OT_select_mirror", MKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0); kmi = WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, 0, 0); - RNA_enum_set_identifier(kmi->ptr, "direction", "PARENT"); + RNA_enum_set_identifier(NULL, kmi->ptr, "direction", "PARENT"); RNA_boolean_set(kmi->ptr, "extend", false); kmi = WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); - RNA_enum_set_identifier(kmi->ptr, "direction", "PARENT"); + RNA_enum_set_identifier(NULL, kmi->ptr, "direction", "PARENT"); RNA_boolean_set(kmi->ptr, "extend", true); kmi = WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, 0, 0); - RNA_enum_set_identifier(kmi->ptr, "direction", "CHILD"); + RNA_enum_set_identifier(NULL, kmi->ptr, "direction", "CHILD"); RNA_boolean_set(kmi->ptr, "extend", false); kmi = WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0); - RNA_enum_set_identifier(kmi->ptr, "direction", "CHILD"); + RNA_enum_set_identifier(NULL, kmi->ptr, "direction", "CHILD"); RNA_boolean_set(kmi->ptr, "extend", true); WM_keymap_verify_item(keymap, "OBJECT_OT_parent_set", PKEY, KM_PRESS, KM_CTRL, 0); diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 8b785c8a65f..050c55b2347 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -1006,7 +1006,7 @@ void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values int RNA_enum_get(PointerRNA *ptr, const char *name); void RNA_enum_set(PointerRNA *ptr, const char *name, int value); -void RNA_enum_set_identifier(PointerRNA *ptr, const char *name, const char *id); +void RNA_enum_set_identifier(struct bContext *C, PointerRNA *ptr, const char *name, const char *id); bool RNA_enum_is_equal(struct bContext *C, PointerRNA *ptr, const char *name, const char *enumname); /* lower level functions that don't use a PointerRNA */ diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index ede5073483b..b1038f8e35c 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -4992,13 +4992,13 @@ void RNA_enum_set(PointerRNA *ptr, const char *name, int value) printf("%s: %s.%s not found.\n", __func__, ptr->type->identifier, name); } -void RNA_enum_set_identifier(PointerRNA *ptr, const char *name, const char *id) +void RNA_enum_set_identifier(bContext *C, PointerRNA *ptr, const char *name, const char *id) { PropertyRNA *prop = RNA_struct_find_property(ptr, name); if (prop) { int value; - if (RNA_property_enum_value(NULL, ptr, prop, id, &value)) + if (RNA_property_enum_value(C, ptr, prop, id, &value)) RNA_property_enum_set(ptr, prop, value); else printf("%s: %s.%s has no enum id '%s'.\n", __func__, ptr->type->identifier, name, id); |