[Bf-blender-cvs] [c44fe5f26c9] greasepencil-object: GPencil: New Rotation parameter for Blur VFX
Antonio Vazquez
noreply at git.blender.org
Fri Feb 14 18:46:24 CET 2020
Commit: c44fe5f26c9b53f026bc353e87bdb222e4163c51
Author: Antonio Vazquez
Date: Fri Feb 14 18:44:07 2020 +0100
Branches: greasepencil-object
https://developer.blender.org/rBc44fe5f26c9b53f026bc353e87bdb222e4163c51
GPencil: New Rotation parameter for Blur VFX
Still pending (only var added)
===================================================================
M release/scripts/startup/bl_ui/properties_data_shaderfx.py
M source/blender/makesdna/DNA_shader_fx_types.h
M source/blender/makesrna/intern/rna_shader_fx.c
M source/blender/shader_fx/intern/FX_shader_blur.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_data_shaderfx.py b/release/scripts/startup/bl_ui/properties_data_shaderfx.py
index c39ea87ab15..0143def6015 100644
--- a/release/scripts/startup/bl_ui/properties_data_shaderfx.py
+++ b/release/scripts/startup/bl_ui/properties_data_shaderfx.py
@@ -60,8 +60,10 @@ class DATA_PT_shader_fx(ShaderFxButtonsPanel, Panel):
layout.separator()
col = layout.column()
- col.prop(fx, "size", text="Size")
col.enabled = not fx.use_dof_mode
+ col.prop(fx, "size", text="Size")
+ col.separator()
+ col.prop(fx, "rotation")
layout.prop(fx, "samples", text="Samples")
diff --git a/source/blender/makesdna/DNA_shader_fx_types.h b/source/blender/makesdna/DNA_shader_fx_types.h
index 8b13da3cf9c..07c25d8e370 100644
--- a/source/blender/makesdna/DNA_shader_fx_types.h
+++ b/source/blender/makesdna/DNA_shader_fx_types.h
@@ -86,6 +86,9 @@ typedef struct BlurShaderFxData {
int flag;
/** Number of samples. */
int samples;
+ /** Rotation of blur effect. */
+ float rotation;
+ char _pad[4];
ShaderFxData_Runtime runtime;
} BlurShaderFxData;
diff --git a/source/blender/makesrna/intern/rna_shader_fx.c b/source/blender/makesrna/intern/rna_shader_fx.c
index cfee388ea70..d2deabec2d0 100644
--- a/source/blender/makesrna/intern/rna_shader_fx.c
+++ b/source/blender/makesrna/intern/rna_shader_fx.c
@@ -221,6 +221,12 @@ static void rna_def_shader_fx_blur(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Samples", "Number of Blur Samples (zero, disable blur)");
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update");
+ prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_ANGLE);
+ RNA_def_property_float_sdna(prop, NULL, "rotation");
+ RNA_def_property_range(prop, 0.0f, FLT_MAX);
+ RNA_def_property_ui_text(prop, "Rotation", "Rotation of the effect");
+ RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update");
+
prop = RNA_def_property(srna, "use_dof_mode", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FX_BLUR_DOF_MODE);
RNA_def_property_ui_text(prop, "Use as Depth Of Field", "Blur using camera depth of field");
diff --git a/source/blender/shader_fx/intern/FX_shader_blur.c b/source/blender/shader_fx/intern/FX_shader_blur.c
index dea53ed1451..301eb6d375d 100644
--- a/source/blender/shader_fx/intern/FX_shader_blur.c
+++ b/source/blender/shader_fx/intern/FX_shader_blur.c
@@ -33,6 +33,7 @@ static void initData(ShaderFxData *fx)
BlurShaderFxData *gpfx = (BlurShaderFxData *)fx;
copy_v2_fl(gpfx->radius, 20.0f);
gpfx->samples = 2;
+ gpfx->rotation = 0.0f;
}
static void copyData(const ShaderFxData *md, ShaderFxData *target)
More information about the Bf-blender-cvs
mailing list