[Bf-blender-cvs] [e8563bb2c28] greasepencil-object: GPencil: Change Blur VFX panel and remove unused code
Antonio Vazquez
noreply at git.blender.org
Fri Feb 14 17:42:28 CET 2020
Commit: e8563bb2c288b200e2517b4d2c624ec4a625452a
Author: Antonio Vazquez
Date: Fri Feb 14 17:42:19 2020 +0100
Branches: greasepencil-object
https://developer.blender.org/rBe8563bb2c288b200e2517b4d2c624ec4a625452a
GPencil: Change Blur VFX panel and remove unused code
===================================================================
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 8a803bf2c55..3fcc5083b34 100644
--- a/release/scripts/startup/bl_ui/properties_data_shaderfx.py
+++ b/release/scripts/startup/bl_ui/properties_data_shaderfx.py
@@ -56,13 +56,15 @@ class DATA_PT_shader_fx(ShaderFxButtonsPanel, Panel):
def FX_BLUR(self, layout, fx):
- layout.prop(fx, "factor", text="Factor")
+ layout.prop(fx, "use_dof_mode", text="Use as Depth Of Field")
+ layout.separator()
+
+ col = layout.column()
+ col.prop(fx, "size", text="Size")
+ col.enabled = not fx.use_dof_mode
+
layout.prop(fx, "samples", text="Samples")
- layout.separator()
- layout.prop(fx, "use_dof_mode")
- if fx.use_dof_mode:
- layout.prop(fx, "coc")
def FX_COLORIZE(self, layout, fx):
layout.prop(fx, "mode", text="Mode")
diff --git a/source/blender/makesdna/DNA_shader_fx_types.h b/source/blender/makesdna/DNA_shader_fx_types.h
index b6a82854f83..99e70acb55a 100644
--- a/source/blender/makesdna/DNA_shader_fx_types.h
+++ b/source/blender/makesdna/DNA_shader_fx_types.h
@@ -86,11 +86,6 @@ typedef struct BlurShaderFxData {
int flag;
/** Number of samples. */
int samples;
- /** Circle of confusion. */
- float coc;
- /** Not visible in rna. */
- int blur[2];
- 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 1d8fd163011..5d58ecd3153 100644
--- a/source/blender/makesrna/intern/rna_shader_fx.c
+++ b/source/blender/makesrna/intern/rna_shader_fx.c
@@ -207,10 +207,10 @@ static void rna_def_shader_fx_blur(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "BlurShaderFxData");
RNA_def_struct_ui_icon(srna, ICON_SHADERFX);
- prop = RNA_def_property(srna, "factor", PROP_INT, PROP_PIXEL);
+ prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL);
RNA_def_property_int_sdna(prop, NULL, "radius");
RNA_def_property_range(prop, 0, SHRT_MAX);
- RNA_def_property_ui_text(prop, "Factor", "Factor of Blur");
+ RNA_def_property_ui_text(prop, "Size", "Factor of Blur");
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update");
prop = RNA_def_property(srna, "samples", PROP_INT, PROP_NONE);
@@ -221,19 +221,9 @@ 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, "coc", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "coc");
- RNA_def_property_range(prop, 0.001f, 1.0f);
- RNA_def_property_float_default(prop, 0.025f);
- RNA_def_property_ui_text(prop, "Precision", "Define circle of confusion for depth of field");
- 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,
- "Lock Focal Plane",
- "Blur using focal plane distance as factor to simulate depth of field "
- "effect (only in camera view)");
+ RNA_def_property_ui_text(prop, "Use as Depth Of Field", "Blur using camera depth of field");
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update");
}
diff --git a/source/blender/shader_fx/intern/FX_shader_blur.c b/source/blender/shader_fx/intern/FX_shader_blur.c
index 70f53995201..0f7394b4c46 100644
--- a/source/blender/shader_fx/intern/FX_shader_blur.c
+++ b/source/blender/shader_fx/intern/FX_shader_blur.c
@@ -32,7 +32,6 @@ static void initData(ShaderFxData *fx)
BlurShaderFxData *gpfx = (BlurShaderFxData *)fx;
ARRAY_SET_ITEMS(gpfx->radius, 5, 5);
gpfx->samples = 2;
- gpfx->coc = 0.025f;
}
static void copyData(const ShaderFxData *md, ShaderFxData *target)
More information about the Bf-blender-cvs
mailing list