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:
authorJoshua Leung <aligorith@gmail.com>2016-11-27 16:32:03 +0300
committerJoshua Leung <aligorith@gmail.com>2016-11-27 16:33:48 +0300
commit452028c77ccea3846c7e1104c50e682b9b957ecc (patch)
treea31de43ea94d5b275ef9022f884189dec82ec831 /source/blender
parente2d223461efeea4792defb254c692828266478d1 (diff)
GPencil RNA API: "set_active" option for layer.new() and palette.new() is now true/enabled by default
To bring the API more into line with the UI (and the general expected behaviour of Blender when it comes to adding stuff), newly created layers and palettes will be made the active ones by default. It's possible to override this behaviour still (e.g. in cases where you're auto-generating a large number of them), but otherwise, this change will help prevent errors like T50123.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/makesrna/intern/rna_gpencil.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 7ba89538b18..6abead48d99 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -1354,7 +1354,7 @@ static void rna_def_gpencil_layers_api(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Add a new grease pencil layer");
parm = RNA_def_string(func, "name", "GPencilLayer", MAX_NAME, "Name", "Name of the layer");
RNA_def_property_flag(parm, PROP_REQUIRED);
- RNA_def_boolean(func, "set_active", 0, "Set Active", "Set the newly created layer to the active layer");
+ RNA_def_boolean(func, "set_active", true, "Set Active", "Set the newly created layer to the active layer");
parm = RNA_def_pointer(func, "layer", "GPencilLayer", "", "The newly created layer");
RNA_def_function_return(func, parm);
@@ -1557,7 +1557,7 @@ static void rna_def_gpencil_palettes_api(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Add a new grease pencil palette");
parm = RNA_def_string(func, "name", "GPencilPalette", MAX_NAME, "Name", "Name of the palette");
RNA_def_property_flag(parm, PROP_REQUIRED);
- RNA_def_boolean(func, "set_active", 0, "Set Active", "Activate the newly created palette");
+ RNA_def_boolean(func, "set_active", true, "Set Active", "Activate the newly created palette");
parm = RNA_def_pointer(func, "palette", "GPencilPalette", "", "The newly created palette");
RNA_def_function_return(func, parm);