forked from bartvdbraak/blender
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
This commit is contained in:
parent
0083c69624
commit
554b26cf88
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user