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:
Diffstat (limited to 'source/blender/shader_fx/intern/FX_shader_blur.c')
-rw-r--r--source/blender/shader_fx/intern/FX_shader_blur.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/source/blender/shader_fx/intern/FX_shader_blur.c b/source/blender/shader_fx/intern/FX_shader_blur.c
index 8881f147af8..8e3e7588818 100644
--- a/source/blender/shader_fx/intern/FX_shader_blur.c
+++ b/source/blender/shader_fx/intern/FX_shader_blur.c
@@ -26,7 +26,20 @@
#include "BLI_math.h"
#include "BLI_utildefines.h"
+#include "BLT_translation.h"
+
+#include "BKE_context.h"
+#include "BKE_screen.h"
+
+#include "DNA_screen_types.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+
+#include "RNA_access.h"
+
#include "FX_shader_types.h"
+#include "FX_ui_common.h"
static void initData(ShaderFxData *fx)
{
@@ -41,6 +54,32 @@ static void copyData(const ShaderFxData *md, ShaderFxData *target)
BKE_shaderfx_copydata_generic(md, target);
}
+static void panel_draw(const bContext *C, Panel *panel)
+{
+ uiLayout *col;
+ uiLayout *layout = panel->layout;
+
+ PointerRNA ptr;
+ shaderfx_panel_get_property_pointers(C, panel, NULL, &ptr);
+
+ uiLayoutSetPropSep(layout, true);
+
+ uiItemR(layout, &ptr, "samples", 0, NULL, ICON_NONE);
+
+ uiItemR(layout, &ptr, "use_dof_mode", 0, IFACE_("Use Depth of Field"), ICON_NONE);
+ col = uiLayoutColumn(layout, false);
+ uiLayoutSetActive(col, !RNA_boolean_get(&ptr, "use_dof_mode"));
+ uiItemR(col, &ptr, "size", 0, NULL, ICON_NONE);
+ uiItemR(col, &ptr, "rotation", 0, NULL, ICON_NONE);
+
+ shaderfx_panel_end(layout, &ptr);
+}
+
+static void panelRegister(ARegionType *region_type)
+{
+ shaderfx_panel_register(region_type, eShaderFxType_Blur, panel_draw);
+}
+
ShaderFxTypeInfo shaderfx_Type_Blur = {
/* name */ "Blur",
/* structName */ "BlurShaderFxData",
@@ -57,4 +96,5 @@ ShaderFxTypeInfo shaderfx_Type_Blur = {
/* dependsOnTime */ NULL,
/* foreachObjectLink */ NULL,
/* foreachIDLink */ NULL,
+ /* panelRegister */ panelRegister,
};