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:
authorJacques Lucke <mail@jlucke.com>2018-09-25 13:01:43 +0300
committerJacques Lucke <mail@jlucke.com>2018-09-25 13:01:43 +0300
commit554b26cf88de613ac94121c652cfff45a8f03c88 (patch)
tree6808d5d5069e62b8e0b2bff921700e88aa55b89d /source/blender/makesrna/intern/rna_main_api.c
parent0083c69624d2ae3df511c2ed9ae9baced75394af (diff)
Fix T56912: bpy.data.masks.new() crashed
I think there are two possible ways to fix that. 1. Make the name a required parameter. 2. Provide a default value. I choosed option 1 in this fix to be consistent with other .new functions. Also I think `RNA_def_string` instead of `RNA_def_string_file_path` should be used here. Looks like a copy-paste error. Reviewers: brecht Differential Revision: https://developer.blender.org/D3728
Diffstat (limited to 'source/blender/makesrna/intern/rna_main_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index 7d619254e07..f2249eb397d 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -1864,7 +1864,8 @@ void RNA_def_main_masks(BlenderRNA *brna, PropertyRNA *cprop)
/* new func */
func = RNA_def_function(srna, "new", "rna_Main_mask_new");
RNA_def_function_ui_description(func, "Add a new mask with a given name to the main database");
- RNA_def_string_file_path(func, "name", NULL, MAX_ID_NAME - 2, "Mask", "Name of new mask data-block");
+ parm = RNA_def_string(func, "name", NULL, MAX_ID_NAME - 2, "Mask", "Name of new mask data-block");
+ RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
/* return type */
parm = RNA_def_pointer(func, "mask", "Mask", "", "New mask data-block");
RNA_def_function_return(func, parm);