diff options
author | YimingWu <xp8110@outlook.com> | 2020-06-04 13:57:28 +0300 |
---|---|---|
committer | YimingWu <xp8110@outlook.com> | 2020-06-04 13:57:28 +0300 |
commit | bfbf0bb7f7a0191b65fc724d5dfea225e6293c6b (patch) | |
tree | 042f37d28c9e1cf0ce5a0fb4fd4235288f62d36e /source/blender/makesrna/intern/rna_ui_api.c | |
parent | 3b52dfe549f0c2fca7e0cd499b85fb098e9b4da9 (diff) | |
parent | 78017916f7c7a8ec8907c9b993214ff8ec3c3557 (diff) |
Merge remote-tracking branch 'origin/master' into temp-lanpr-reviewtemp-lanpr-review
# Conflicts:
# release/datafiles/locale
# release/scripts/addons
Diffstat (limited to 'source/blender/makesrna/intern/rna_ui_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_ui_api.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 2a64ffa73cd..8d0e403aa2d 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -485,6 +485,21 @@ static void rna_uiTemplateAnyID(uiLayout *layout, uiTemplateAnyID(layout, ptr, propname, proptypename, name); } +static void rna_uiTemplateCacheFile(uiLayout *layout, + bContext *C, + PointerRNA *ptr, + const char *propname) +{ + PropertyRNA *prop = RNA_struct_find_property(ptr, propname); + + if (!prop) { + RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname); + return; + } + + uiTemplateCacheFile(layout, C, ptr, propname); +} + static void rna_uiTemplatePathBuilder(uiLayout *layout, PointerRNA *ptr, const char *propname, @@ -1577,7 +1592,7 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_float_array( func, "color", 4, node_socket_color_default, 0.0f, 1.0f, "Color", "", 0.0f, 1.0f); - func = RNA_def_function(srna, "template_cache_file", "uiTemplateCacheFile"); + func = RNA_def_function(srna, "template_cache_file", "rna_uiTemplateCacheFile"); RNA_def_function_ui_description( func, "Item(s). User interface for selecting cache files and their source paths"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); |