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_pixel.c')
-rw-r--r--source/blender/shader_fx/intern/FX_shader_pixel.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/source/blender/shader_fx/intern/FX_shader_pixel.c b/source/blender/shader_fx/intern/FX_shader_pixel.c
index 04bf9ae5b6d..bdc4f141017 100644
--- a/source/blender/shader_fx/intern/FX_shader_pixel.c
+++ b/source/blender/shader_fx/intern/FX_shader_pixel.c
@@ -25,7 +25,20 @@
#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)
{
@@ -39,6 +52,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);
+
+ /* Add the X, Y labels manually because size is a #PROP_PIXEL. */
+ col = uiLayoutColumn(layout, true);
+ PropertyRNA *prop = RNA_struct_find_property(&ptr, "size");
+ uiItemFullR(col, &ptr, prop, 0, 0, 0, IFACE_("Size X"), ICON_NONE);
+ uiItemFullR(col, &ptr, prop, 1, 0, 0, IFACE_("Y"), ICON_NONE);
+
+ uiItemR(layout, &ptr, "use_antialiasing", 0, NULL, ICON_NONE);
+
+ shaderfx_panel_end(layout, &ptr);
+}
+
+static void panelRegister(ARegionType *region_type)
+{
+ shaderfx_panel_register(region_type, eShaderFxType_Pixel, panel_draw);
+}
+
ShaderFxTypeInfo shaderfx_Type_Pixel = {
/* name */ "Pixelate",
/* structName */ "PixelShaderFxData",
@@ -55,4 +94,5 @@ ShaderFxTypeInfo shaderfx_Type_Pixel = {
/* dependsOnTime */ NULL,
/* foreachObjectLink */ NULL,
/* foreachIDLink */ NULL,
+ /* panelRegister */ panelRegister,
};