[Bf-blender-cvs] [1b40b4ba30a] greasepencil-object: Prepare data for new options in array modifier

Antonio Vazquez noreply at git.blender.org
Fri Jul 21 09:29:28 CEST 2017


Commit: 1b40b4ba30a48f4cef4906b7c19c6d79db966fad
Author: Antonio Vazquez
Date:   Thu Jul 20 11:16:19 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB1b40b4ba30a48f4cef4906b7c19c6d79db966fad

Prepare data for new options in array modifier

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

M	release/scripts/startup/bl_ui/properties_data_modifier.py
M	source/blender/makesdna/DNA_modifier_types.h
M	source/blender/makesrna/intern/rna_modifier.c
M	source/blender/modifiers/intern/MOD_gpencilarray.c

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

diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index e77ae851db2..3a048768a3c 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -1619,6 +1619,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
 
         split = layout.split()
         col = split.column()
+        col.label("Offset:")
         col.prop(md, "constant_offset_displace", text="")
 
         col = split.column()
@@ -1630,6 +1631,16 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
         row.prop(md, "passindex", text="Pass")
         row.prop(md, "inverse_pass", text="", icon="ARROW_LEFTRIGHT")
 
+        row = layout.row()
+        split = row.split()
+        col = split.column()
+        col.label("Rotation:")
+        col.prop(md, "rotation", text="")
+
+        col = split.column()
+        col.label("Scale:")
+        col.prop(md, "scale", text="")
+
 classes = (
     DATA_PT_modifiers,
 )
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index e4b1e8b7658..f1b6096a1ff 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -1693,6 +1693,8 @@ typedef struct GpencilArrayModifierData {
 	float rnd_size;              /* random size factor */
 	float rnd_rot;               /* random size factor */
 	float offset[3];             /* Location increments */
+	float rot[3];                /* Rotation changes */
+	float scale[3];              /* Scale changes */
 	int count;                   /* number of elements in array */
 } GpencilArrayModifierData;
 
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 8bd9b7cf9cc..9a496e9251b 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -5015,6 +5015,18 @@ static void rna_def_modifier_gpencilarray(BlenderRNA *brna)
 	RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
 	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
+	prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER);
+	RNA_def_property_float_sdna(prop, NULL, "rot");
+	RNA_def_property_ui_text(prop, "Constant Offset Displacement", "Value for chages in rotation");
+	RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+	prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
+	RNA_def_property_float_sdna(prop, NULL, "scale");
+	RNA_def_property_ui_text(prop, "Scale", "Value for changes in scale");
+	RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
 	prop = RNA_def_property(srna, "inverse_layers", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_ARRAY_INVERSE_LAYER);
 	RNA_def_property_ui_text(prop, "Inverse Layers", "Inverse filter");
diff --git a/source/blender/modifiers/intern/MOD_gpencilarray.c b/source/blender/modifiers/intern/MOD_gpencilarray.c
index 6bbf34e477d..c782a41a640 100644
--- a/source/blender/modifiers/intern/MOD_gpencilarray.c
+++ b/source/blender/modifiers/intern/MOD_gpencilarray.c
@@ -48,6 +48,9 @@ static void initData(ModifierData *md)
 	gpmd->layername[0] = '\0';
 	gpmd->count = 1;
 	gpmd->offset[0] = 1.0f;
+	gpmd->scale[0] = 1.0f;
+	gpmd->scale[1] = 1.0f;
+	gpmd->scale[2] = 1.0f;
 
 	BKE_gpencil_batch_cache_alldirty();
 }




More information about the Bf-blender-cvs mailing list