[Bf-blender-cvs] [3879c96e6b6] greasepencil-object: Add new flag for MultiEdit

Antonio Vazquez noreply at git.blender.org
Tue Aug 29 16:10:29 CEST 2017


Commit: 3879c96e6b65b1cf85fddb26f731ea389cb6df05
Author: Antonio Vazquez
Date:   Mon Aug 28 13:28:43 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB3879c96e6b65b1cf85fddb26f731ea389cb6df05

Add new flag for MultiEdit

Note: The new UI options now appears in display panel but it will be moved out in future changes.

===================================================================

M	release/scripts/startup/bl_ui/properties_data_gpencil.py
M	source/blender/editors/include/ED_gpencil.h
M	source/blender/makesdna/DNA_gpencil_types.h
M	source/blender/makesrna/intern/rna_gpencil.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_data_gpencil.py b/release/scripts/startup/bl_ui/properties_data_gpencil.py
index 9c80af05fc1..78f55838f39 100644
--- a/release/scripts/startup/bl_ui/properties_data_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py
@@ -123,6 +123,8 @@ class DATA_PT_gpencil_display(DataButtonsPanel, Panel):
         row = layout.row()
         row.prop(gpd, "pixfactor", text="Pixel Factor")
 
+        row = layout.row()
+        row.prop(gpd, "multiedit", text="MultEdit Strokes")
 
 classes = (
     DATA_PT_gpencil,
diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h
index c772ce710d6..de626ff76bf 100644
--- a/source/blender/editors/include/ED_gpencil.h
+++ b/source/blender/editors/include/ED_gpencil.h
@@ -112,6 +112,9 @@ typedef struct tGPencilSort {
 /* Check if 'sketching sessions' are enabled */
 #define GPENCIL_SKETCH_SESSIONS_ON(scene) ((scene)->toolsettings->gpencil_flags & GP_TOOL_FLAG_PAINTSESSIONS_ON)
 
+/* Check if 'multiedit sessions' is enabled */
+#define GPENCIL_MULTIEDIT_SESSIONS_ON(gpd) ((gpd) && (gpd->flag & GP_DATA_STROKE_EDITMODE) && (gpd->flag & GP_DATA_STROKE_MULTIEDIT)) 
+
 /* ----------- Grease Pencil Tools/Context ------------- */
 
 /* Context-dependent */
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index ea5d9f54caa..a071d149ef1 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -397,6 +397,8 @@ typedef enum eGPdata_Flag {
 	GP_DATA_STROKE_WEIGHTMODE = (1 << 14),
 	/* keep stroke thickness unchanged when zoom change */
 	GP_DATA_STROKE_KEEPTHICKNESS = (1 << 15),
+	/* Allow edit several frames at the same time */
+	GP_DATA_STROKE_MULTIEDIT = (1 << 16),
 } eGPdata_Flag;
 
 #endif /*  __DNA_GPENCIL_TYPES_H__ */
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index a280eb66afd..23a1fc19451 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -1273,6 +1273,11 @@ static void rna_def_gpencil_data(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "Pixel Factor", "Factor of conversion of pixel size (set bigger values for thinner lines)");
 	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
 
+	prop = RNA_def_property(srna, "multiedit", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_DATA_STROKE_MULTIEDIT);
+	RNA_def_property_ui_text(prop, "MultiEdit", "Edit strokes in several grease pencil Keyframes at same time");
+	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+
 	/* API Functions */
 	func = RNA_def_function(srna, "clear", "rna_GPencil_clear");
 	RNA_def_function_ui_description(func, "Remove all the grease pencil data");



More information about the Bf-blender-cvs mailing list