diff options
-rw-r--r-- | source/blender/editors/object/object_shader_fx.c | 10 | ||||
-rw-r--r-- | source/blender/editors/space_buttons/space_buttons.c | 10 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/space_view3d.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_shader_fx.c | 104 | ||||
-rw-r--r-- | source/blender/windowmanager/WM_types.h | 1 |
5 files changed, 63 insertions, 64 deletions
diff --git a/source/blender/editors/object/object_shader_fx.c b/source/blender/editors/object/object_shader_fx.c index 8df87a8a2f9..e5e3c204227 100644 --- a/source/blender/editors/object/object_shader_fx.c +++ b/source/blender/editors/object/object_shader_fx.c @@ -247,7 +247,7 @@ static int shaderfx_add_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); + WM_event_add_notifier(C, NC_OBJECT | ND_SHADERFX, ob); return OPERATOR_FINISHED; } @@ -407,7 +407,7 @@ static int shaderfx_remove_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); + WM_event_add_notifier(C, NC_OBJECT | ND_SHADERFX, ob); return OPERATOR_FINISHED; } @@ -447,7 +447,7 @@ static int shaderfx_move_up_exec(bContext *C, wmOperator *op) } DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); - WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); + WM_event_add_notifier(C, NC_OBJECT | ND_SHADERFX, ob); return OPERATOR_FINISHED; } @@ -487,7 +487,7 @@ static int shaderfx_move_down_exec(bContext *C, wmOperator *op) } DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); - WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); + WM_event_add_notifier(C, NC_OBJECT | ND_SHADERFX, ob); return OPERATOR_FINISHED; } @@ -533,7 +533,7 @@ static int shaderfx_move_to_index_exec(bContext *C, wmOperator *op) } DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); - WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); + WM_event_add_notifier(C, NC_OBJECT | ND_SHADERFX, ob); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 71b86996989..88c2c6e82b6 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -422,6 +422,9 @@ static void buttons_area_listener(wmWindow *UNUSED(win), buttons_area_redraw(area, BCONTEXT_CONSTRAINT); buttons_area_redraw(area, BCONTEXT_BONE_CONSTRAINT); break; + case ND_SHADERFX: + buttons_area_redraw(area, BCONTEXT_SHADERFX); + break; case ND_PARTICLE: if (wmn->action == NA_EDITED) { buttons_area_redraw(area, BCONTEXT_PARTICLE); @@ -435,13 +438,6 @@ static void buttons_area_listener(wmWindow *UNUSED(win), /* Needed to refresh context path when changing active particle system index. */ buttons_area_redraw(area, BCONTEXT_PARTICLE); break; - case ND_SHADING: - case ND_SHADING_DRAW: - case ND_SHADING_LINKS: - case ND_SHADING_PREVIEW: - /* currently works by redraws... if preview is set, it (re)starts job */ - sbuts->preview = 1; - break; default: /* Not all object RNA props have a ND_ notifier (yet) */ ED_area_tag_redraw(area); diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index ed81d87f053..c88303daa16 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -825,6 +825,7 @@ static void view3d_main_region_listener( case ND_POSE: case ND_DRAW: case ND_MODIFIER: + case ND_SHADERFX: case ND_CONSTRAINT: case ND_KEYS: case ND_PARTICLE: @@ -1381,6 +1382,7 @@ static void view3d_buttons_region_listener(wmWindow *UNUSED(win), case ND_DRAW: case ND_KEYS: case ND_MODIFIER: + case ND_SHADERFX: ED_region_tag_redraw(region); break; } diff --git a/source/blender/makesrna/intern/rna_shader_fx.c b/source/blender/makesrna/intern/rna_shader_fx.c index 80f3cab147c..e1970a57a91 100644 --- a/source/blender/makesrna/intern/rna_shader_fx.c +++ b/source/blender/makesrna/intern/rna_shader_fx.c @@ -168,7 +168,7 @@ static char *rna_ShaderFx_path(PointerRNA *ptr) static void rna_ShaderFx_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { DEG_id_tag_update(ptr->owner_id, ID_RECALC_GEOMETRY); - WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ptr->owner_id); + WM_main_add_notifier(NC_OBJECT | ND_SHADERFX, ptr->owner_id); } static void rna_ShaderFx_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr) @@ -220,7 +220,7 @@ static void rna_def_shader_fx_blur(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "radius"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_text(prop, "Size", "Factor of Blur"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "samples", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "samples"); @@ -228,18 +228,18 @@ static void rna_def_shader_fx_blur(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0, 32, 2, -1); RNA_def_property_int_default(prop, 4); 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"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "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, -FLT_MAX, 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"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "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"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); } static void rna_def_shader_fx_colorize(BlenderRNA *brna) @@ -256,27 +256,27 @@ static void rna_def_shader_fx_colorize(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "factor"); RNA_def_property_range(prop, 0, 1.0); RNA_def_property_ui_text(prop, "Factor", "Mix factor"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "low_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_float_sdna(prop, NULL, "low_color"); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Low Color", "First color used for effect"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "high_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_float_sdna(prop, NULL, "high_color"); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "High Color", "Second color used for effect"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, rna_enum_shaderfx_colorize_modes_items); RNA_def_property_ui_text(prop, "Mode", "Effect mode"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); } static void rna_def_shader_fx_wave(BlenderRNA *brna) @@ -298,25 +298,25 @@ static void rna_def_shader_fx_wave(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "orientation"); RNA_def_property_enum_items(prop, prop_shaderfx_wave_type_items); RNA_def_property_ui_text(prop, "Orientation", "Direction of the wave"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "amplitude"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_text(prop, "Amplitude", "Amplitude of Wave"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "period", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "period"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_text(prop, "Period", "Period of Wave"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "phase", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "phase"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_text(prop, "Phase", "Phase Shift of Wave"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); } static void rna_def_shader_fx_pixel(BlenderRNA *brna) @@ -334,12 +334,12 @@ static void rna_def_shader_fx_pixel(BlenderRNA *brna) RNA_def_property_range(prop, 1, SHRT_MAX); RNA_def_property_array(prop, 2); RNA_def_property_ui_text(prop, "Size", "Pixel size"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FX_PIXEL_FILTER_NEAREST); RNA_def_property_ui_text(prop, "Antialiasing", "Antialiase pixels"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); } static void rna_def_shader_fx_rim(BlenderRNA *brna) @@ -356,34 +356,34 @@ static void rna_def_shader_fx_rim(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "offset"); RNA_def_property_range(prop, SHRT_MIN, SHRT_MAX); RNA_def_property_ui_text(prop, "Offset", "Offset of the rim"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "rim_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_float_sdna(prop, NULL, "rim_rgb"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Rim Color", "Color used for Rim"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "mask_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_float_sdna(prop, NULL, "mask_rgb"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Mask Color", "Color that must be kept"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, rna_enum_shaderfx_rim_modes_items); RNA_def_property_ui_text(prop, "Mode", "Blend mode"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "blur", PROP_INT, PROP_PIXEL); RNA_def_property_int_sdna(prop, NULL, "blur"); RNA_def_property_range(prop, 0, SHRT_MAX); RNA_def_property_ui_text( prop, "Blur", "Number of pixels for blurring rim (set to 0 to disable)"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "samples", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "samples"); @@ -391,7 +391,7 @@ static void rna_def_shader_fx_rim(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0, 32, 2, -1); RNA_def_property_int_default(prop, 4); 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"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); } static void rna_def_shader_fx_shadow(BlenderRNA *brna) @@ -420,58 +420,58 @@ static void rna_def_shader_fx_shadow(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "offset"); RNA_def_property_range(prop, SHRT_MIN, SHRT_MAX); RNA_def_property_ui_text(prop, "Offset", "Offset of the shadow"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "scale"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_text(prop, "Scale", "Offset of the shadow"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "shadow_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_float_sdna(prop, NULL, "shadow_rgba"); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Shadow Color", "Color used for Shadow"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "orientation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "orientation"); RNA_def_property_enum_items(prop, prop_shaderfx_shadow_type_items); RNA_def_property_ui_text(prop, "Orientation", "Direction of the wave"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "amplitude"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_text(prop, "Amplitude", "Amplitude of Wave"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "period", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "period"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_text(prop, "Period", "Period of Wave"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "phase", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "phase"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_text(prop, "Phase", "Phase Shift of Wave"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "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, DEG2RAD(-360), DEG2RAD(360)); RNA_def_property_ui_range(prop, DEG2RAD(-360), DEG2RAD(360), 5, 2); RNA_def_property_ui_text(prop, "Rotation", "Rotation around center or object"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "blur", PROP_INT, PROP_PIXEL); RNA_def_property_int_sdna(prop, NULL, "blur"); RNA_def_property_range(prop, 0, SHRT_MAX); RNA_def_property_ui_text( prop, "Blur", "Number of pixels for blurring shadow (set to 0 to disable)"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "samples", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "samples"); @@ -479,17 +479,17 @@ static void rna_def_shader_fx_shadow(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0, 32, 2, -1); RNA_def_property_int_default(prop, 4); 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"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "use_object", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FX_SHADOW_USE_OBJECT); RNA_def_property_ui_text(prop, "Use Object", "Use object as center of rotation"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "use_wave", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FX_SHADOW_USE_WAVE); RNA_def_property_ui_text(prop, "Wave", "Use wave effect"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); } static void rna_def_shader_fx_glow(BlenderRNA *brna) @@ -507,41 +507,41 @@ static void rna_def_shader_fx_glow(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "glow_color"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Glow Color", "Color used for generated glow"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "glow_color[3]"); RNA_def_property_range(prop, 0.0, 1.0f); RNA_def_property_ui_text(prop, "Opacity", "Effect Opacity"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "select_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_float_sdna(prop, NULL, "select_color"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Select Color", "Color selected to apply glow"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, rna_enum_shaderfx_glow_modes_items); RNA_def_property_ui_text(prop, "Mode", "Glow mode"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "threshold"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1f, 3); RNA_def_property_ui_text(prop, "Threshold", "Limit to select color for glow effect"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); /* Use blur fields to make compatible with blur filter */ prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "blur"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_text(prop, "Size", "Size of the effect"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "samples", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "samples"); @@ -549,26 +549,26 @@ static void rna_def_shader_fx_glow(BlenderRNA *brna) RNA_def_property_ui_range(prop, 1, 32, 2, -1); RNA_def_property_int_default(prop, 4); RNA_def_property_ui_text(prop, "Samples", "Number of Blur Samples"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "use_glow_under", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FX_GLOW_USE_ALPHA); RNA_def_property_ui_text( prop, "Glow Under", "Glow only areas with alpha (not supported with Regular blend mode)"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "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, -FLT_MAX, 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"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); /* blend mode */ prop = RNA_def_property(srna, "blend_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "blend_mode"); RNA_def_property_enum_items(prop, rna_enum_glow_blend_modes_items); RNA_def_property_ui_text(prop, "Blend Mode", "Blend mode"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); } static void rna_def_shader_fx_swirl(BlenderRNA *brna) @@ -585,19 +585,19 @@ static void rna_def_shader_fx_swirl(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "radius"); RNA_def_property_range(prop, 0, SHRT_MAX); RNA_def_property_ui_text(prop, "Radius", "Radius to apply"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "angle"); RNA_def_property_range(prop, DEG2RAD(-5 * 360), DEG2RAD(5 * 360)); RNA_def_property_ui_range(prop, DEG2RAD(-5 * 360), DEG2RAD(5 * 360), 5, 2); RNA_def_property_ui_text(prop, "Angle", "Angle of rotation"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "use_transparent", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FX_SWIRL_MAKE_TRANSPARENT); RNA_def_property_ui_text(prop, "Transparent", "Make image transparent outside of radius"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Object", "Object to determine center location"); @@ -620,12 +620,12 @@ static void rna_def_shader_fx_flip(BlenderRNA *brna) prop = RNA_def_property(srna, "flip_horizontal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FX_FLIP_HORIZONTAL); RNA_def_property_ui_text(prop, "Horizontal", "Flip image horizontally"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); prop = RNA_def_property(srna, "flip_vertical", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FX_FLIP_VERTICAL); RNA_def_property_ui_text(prop, "Vertical", "Flip image vertically"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); } void RNA_def_shader_fx(BlenderRNA *brna) @@ -644,7 +644,7 @@ void RNA_def_shader_fx(BlenderRNA *brna) prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ShaderFx_name_set"); RNA_def_property_ui_text(prop, "Name", "Effect name"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER | NA_RENAME, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX | NA_RENAME, NULL); RNA_def_struct_name_property(srna, prop); /* enums */ @@ -661,7 +661,7 @@ void RNA_def_shader_fx(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Realtime", "Display effect in viewport"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_ON, 1); prop = RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE); @@ -669,12 +669,12 @@ void RNA_def_shader_fx(BlenderRNA *brna) RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Render", "Use effect during render"); RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_ON, 1); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, NULL); prop = RNA_def_property(srna, "show_in_editmode", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", eShaderFxMode_Editmode); RNA_def_property_ui_text(prop, "Edit Mode", "Display effect in Edit mode"); - RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_SHADERFX, "rna_ShaderFx_update"); RNA_def_property_ui_icon(prop, ICON_EDITMODE_HLT, 0); prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 4acce793707..b4b3d0957af 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -361,6 +361,7 @@ typedef struct wmNotifier { #define ND_LOD (30 << 16) #define ND_DRAW_RENDER_VIEWPORT \ (31 << 16) /* for camera & sequencer viewport update, also /w NC_SCENE */ +#define ND_SHADERFX (32 << 16) /* NC_MATERIAL Material */ #define ND_SHADING (30 << 16) |