diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-09-29 23:12:12 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-09-29 23:12:12 +0400 |
commit | 15d07720e515a2e9caada6ee9900c388c5e06490 (patch) | |
tree | 8154e70a86e3b9b0cf42a581db95f0a7d4029238 /source/blender/makesrna | |
parent | 7f5dc4644f72ffb56d23db79cc3208dbca2d5eab (diff) |
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_brush.c | 40 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_internal.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_lamp.c | 165 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_material.c | 403 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_texture.c | 344 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_world.c | 97 |
6 files changed, 605 insertions, 446 deletions
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 15125795e01..d5195110314 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -51,6 +51,9 @@ EnumPropertyItem brush_sculpt_tool_items[] = { #include "BKE_texture.h" +#include "WM_api.h" +#include "WM_types.h" + static void rna_Brush_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Brush *brush= (Brush*)ptr->data; @@ -87,6 +90,12 @@ static void rna_Brush_active_texture_set(PointerRNA *ptr, PointerRNA value) } } +static void rna_Brush_update(bContext *C, PointerRNA *ptr) +{ + Brush *br= (Brush*)ptr->data; + WM_event_add_notifier(C, NC_BRUSH|NA_EDITED, br); +} + #else static void rna_def_brush(BlenderRNA *brna) @@ -118,130 +127,157 @@ static void rna_def_brush(BlenderRNA *brna) prop= RNA_def_property(srna, "blend", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_blend_items); RNA_def_property_ui_text(prop, "Blending mode", "Brush blending mode."); + RNA_def_property_update(prop, 0, "rna_Brush_update"); prop= RNA_def_property(srna, "sculpt_tool", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, brush_sculpt_tool_items); RNA_def_property_ui_text(prop, "Sculpt Tool", ""); + RNA_def_property_update(prop, 0, "rna_Brush_update"); prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, prop_flip_direction_items); RNA_def_property_ui_text(prop, "Direction", "Mapping type to use for this image in the game engine."); + RNA_def_property_update(prop, 0, "rna_Brush_update"); /* number values */ prop= RNA_def_property(srna, "size", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 1, 200); RNA_def_property_ui_text(prop, "Size", "Diameter of the brush."); + RNA_def_property_update(prop, 0, "rna_Brush_update"); prop= RNA_def_property(srna, "jitter", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "jitter"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Jitter", "Jitter the position of the brush while painting."); + RNA_def_property_update(prop, 0, "rna_Brush_update"); prop= RNA_def_property(srna, "spacing", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "spacing"); RNA_def_property_range(prop, 1.0f, 100.0f); RNA_def_property_ui_text(prop, "Spacing", "Spacing between brush stamps."); + RNA_def_property_update(prop, 0, "rna_Brush_update"); prop= RNA_def_property(srna, "smooth_stroke_radius", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 10, 200); RNA_def_property_ui_text(prop, "Smooth Stroke Radius", "Minimum distance from last point before stroke continues."); + RNA_def_property_update(prop, 0, "rna_Brush_update"); prop= RNA_def_property(srna, "smooth_stroke_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.5, 0.99); RNA_def_property_ui_text(prop, "Smooth Stroke Factor", "Higher values give a smoother stroke."); + RNA_def_property_update(prop, 0, "rna_Brush_update"); prop= RNA_def_property(srna, "rate", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rate"); RNA_def_property_range(prop, 0.010f, 1.0f); RNA_def_property_ui_text(prop, "Rate", "Number of paints per second for Airbrush."); + RNA_def_property_update(prop, 0, "rna_Brush_update"); prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "rgb"); RNA_def_property_ui_text(prop, "Color", ""); + RNA_def_property_update(prop, 0, "rna_Brush_update"); prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "alpha"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Strength", "The amount of pressure on the brush."); + RNA_def_property_update(prop, 0, "rna_Brush_update"); /* flag */ prop= RNA_def_property(srna, "use_airbrush", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_AIRBRUSH); RNA_def_property_ui_text(prop, "Airbrush", "Keep applying paint effect while holding mouse (spray)."); + RNA_def_property_update(prop, 0, "rna_Brush_update"); prop= RNA_def_property(srna, "use_wrap", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_TORUS); RNA_def_property_ui_text(prop, "Wrap", "Enable torus wrapping while painting."); + RNA_def_property_update(prop, 0, "rna_Brush_update"); prop= RNA_def_property(srna, "use_strength_pressure", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ALPHA_PRESSURE); RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); RNA_def_property_ui_text(prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength."); + RNA_def_property_update(prop, 0, "rna_Brush_update"); prop= RNA_def_property(srna, "use_size_pressure", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SIZE_PRESSURE); RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); RNA_def_property_ui_text(prop, "Size Pressure", "Enable tablet pressure sensitivity for size."); + RNA_def_property_update(prop, 0, "rna_Brush_update"); prop= RNA_def_property(srna, "use_jitter_pressure", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_JITTER_PRESSURE); RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); RNA_def_property_ui_text(prop, "Jitter Pressure", "Enable tablet pressure sensitivity for jitter."); + RNA_def_property_update(prop, 0, "rna_Brush_update"); prop= RNA_def_property(srna, "use_spacing_pressure", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACING_PRESSURE); RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); RNA_def_property_ui_text(prop, "Spacing Pressure", "Enable tablet pressure sensitivity for spacing."); + RNA_def_property_update(prop, 0, "rna_Brush_update"); prop= RNA_def_property(srna, "use_rake", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RAKE); RNA_def_property_ui_text(prop, "Rake", "Rotate the brush texture to match the stroke direction."); + RNA_def_property_update(prop, 0, "rna_Brush_update"); prop= RNA_def_property(srna, "use_anchor", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ANCHORED); RNA_def_property_ui_text(prop, "Anchored", "Keep the brush anchored to the initial location."); + RNA_def_property_update(prop, 0, "rna_Brush_update"); prop= RNA_def_property(srna, "use_space", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACE); RNA_def_property_ui_text(prop, "Space", "Limit brush application to the distance specified by spacing."); + RNA_def_property_update(prop, 0, "rna_Brush_update"); prop= RNA_def_property(srna, "use_smooth_stroke", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SMOOTH_STROKE); RNA_def_property_ui_text(prop, "Smooth Stroke", "Brush lags behind mouse and follows a smoother path."); + RNA_def_property_update(prop, 0, "rna_Brush_update"); prop= RNA_def_property(srna, "use_persistent", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_PERSISTENT); RNA_def_property_ui_text(prop, "Persistent", "Sculpts on a persistent layer of the mesh."); + RNA_def_property_update(prop, 0, "rna_Brush_update"); /* not exposed in the interface yet prop= RNA_def_property(srna, "fixed_tex", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_FIXED_TEX); - RNA_def_property_ui_text(prop, "Fixed Texture", "Keep texture origin in fixed position.");*/ + RNA_def_property_ui_text(prop, "Fixed Texture", "Keep texture origin in fixed position."); + RNA_def_property_update(prop, 0, "rna_Brush_update"); */ prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_ui_text(prop, "Curve", "Editable falloff curve."); + RNA_def_property_update(prop, 0, "rna_Brush_update"); /* texture */ rna_def_mtex_common(srna, "rna_Brush_mtex_begin", "rna_Brush_active_texture_get", - "rna_Brush_active_texture_set", "TextureSlot"); + "rna_Brush_active_texture_set", "TextureSlot", "rna_Brush_update"); /* clone tool */ prop= RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "clone.image"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Clone Image", "Image for clone tool."); + RNA_def_property_update(prop, 0, "rna_Brush_update"); prop= RNA_def_property(srna, "clone_opacity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "clone.alpha"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Clone Opacity", "Opacity of clone image display."); + RNA_def_property_update(prop, 0, "rna_Brush_update"); prop= RNA_def_property(srna, "clone_offset", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "clone.offset"); RNA_def_property_ui_text(prop, "Clone Offset", ""); RNA_def_property_ui_range(prop, -1.0f , 1.0f, 10.0f, 3); + RNA_def_property_update(prop, 0, "rna_Brush_update"); } diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 3723c05ada0..8e50ffe7b94 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -173,7 +173,7 @@ void RNA_def_world(struct BlenderRNA *brna); void rna_def_animdata_common(struct StructRNA *srna); void rna_def_texmat_common(struct StructRNA *srna, const char *texspace_editable); -void rna_def_mtex_common(struct StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *structname); +void rna_def_mtex_common(struct StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *structname, const char *update); void rna_def_render_layer_common(struct StructRNA *srna, int scene); void rna_ID_name_get(struct PointerRNA *ptr, char *value); diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c index d00a0d61bf6..df04fe87bc5 100644 --- a/source/blender/makesrna/intern/rna_lamp.c +++ b/source/blender/makesrna/intern/rna_lamp.c @@ -33,14 +33,17 @@ #include "DNA_material_types.h" #include "DNA_texture_types.h" -#include "WM_types.h" - #ifdef RNA_RUNTIME #include "MEM_guardedalloc.h" +#include "BKE_depsgraph.h" +#include "BKE_main.h" #include "BKE_texture.h" +#include "WM_api.h" +#include "WM_types.h" + static void rna_Lamp_buffer_size_set(PointerRNA *ptr, int value) { Lamp *la= (Lamp*)ptr->data; @@ -113,6 +116,30 @@ static StructRNA* rna_Lamp_refine(struct PointerRNA *ptr) } } +static void rna_Lamp_update(bContext *C, PointerRNA *ptr) +{ + Lamp *la= ptr->id.data; + + DAG_id_flush_update(&la->id, 0); + WM_event_add_notifier(C, NC_LAMP|ND_LIGHTING, la); +} + +static void rna_Lamp_draw_update(bContext *C, PointerRNA *ptr) +{ + Lamp *la= ptr->id.data; + + DAG_id_flush_update(&la->id, 0); + WM_event_add_notifier(C, NC_LAMP|ND_LIGHTING_DRAW, la); +} + +static void rna_Lamp_sky_update(bContext *C, PointerRNA *ptr) +{ + Lamp *la= ptr->id.data; + + DAG_id_flush_update(&la->id, 0); + WM_event_add_notifier(C, NC_LAMP|ND_SKY, la); +} + #else static void rna_def_lamp_mtex(BlenderRNA *brna) @@ -144,24 +171,24 @@ static void rna_def_lamp_mtex(BlenderRNA *brna) prop= RNA_def_property(srna, "map_color", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", LAMAP_COL); RNA_def_property_ui_text(prop, "Color", "Lets the texture affect the basic color of the lamp."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "map_shadow", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", LAMAP_SHAD); RNA_def_property_ui_text(prop, "Shadow", "Lets the texture affect the shadow color of the lamp."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "color_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "colfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Color Factor", "Amount texture affects color values."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "shadow_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "colfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Shadow Factor", "Amount texture affects shadow."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); } static void rna_def_lamp_sky_settings(BlenderRNA *brna) @@ -203,92 +230,92 @@ static void rna_def_lamp_sky_settings(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "sky_colorspace"); RNA_def_property_enum_items(prop, prop_skycolorspace_items); RNA_def_property_ui_text(prop, "Sky Color Space", "Color space to use for internal XYZ->RGB color conversion."); - RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); prop= RNA_def_property(srna, "sky_blend_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "skyblendtype"); RNA_def_property_enum_items(prop, prop_blendmode_items); RNA_def_property_ui_text(prop, "Sky Blend Mode", "Blend mode for combining sun sky with world sky."); - RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); /* Number values */ prop= RNA_def_property(srna, "horizon_brightness", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 20.0f); RNA_def_property_ui_text(prop, "Horizon Brightness", "Horizon brightness."); - RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); prop= RNA_def_property(srna, "spread", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Horizon Spread", "Horizon Spread."); - RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); prop= RNA_def_property(srna, "sun_brightness", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Sun Brightness", "Sun brightness."); - RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); prop= RNA_def_property(srna, "sun_size", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Sun Size", "Sun size."); - RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); prop= RNA_def_property(srna, "backscattered_light", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, -1.0f, 1.0f); RNA_def_property_ui_text(prop, "Backscattered Light", "Backscattered light."); - RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); prop= RNA_def_property(srna, "sun_intensity", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Sun Intensity", "Sun intensity."); - RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); prop= RNA_def_property(srna, "atmosphere_turbidity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "atm_turbidity"); RNA_def_property_range(prop, 1.0f, 30.0f); RNA_def_property_ui_text(prop, "Atmosphere Turbidity", "Sky turbidity."); - RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); prop= RNA_def_property(srna, "atmosphere_inscattering", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "atm_inscattering_factor"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Atmosphere Inscatter", "Scatter contribution factor."); - RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); prop= RNA_def_property(srna, "atmosphere_extinction", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "atm_extinction_factor"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Atmosphere Extinction", "Extinction scattering contribution factor."); - RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); prop= RNA_def_property(srna, "atmosphere_distance_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "atm_distance_factor"); RNA_def_property_range(prop, 0.0f, 500.0f); RNA_def_property_ui_text(prop, "Atmosphere Distance Factor", "Multiplier to convert blender units to physical distance."); - RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); prop= RNA_def_property(srna, "sky_blend", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "skyblendfac"); RNA_def_property_range(prop, 0.0f, 2.0f); RNA_def_property_ui_text(prop, "Sky Blend", "Blend factor with sky."); - RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); prop= RNA_def_property(srna, "sky_exposure", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 20.0f); RNA_def_property_ui_text(prop, "Sky Exposure", "Strength of sky shading exponential exposure correction."); - RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); /* boolean */ prop= RNA_def_property(srna, "sky", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "sun_effect_type", LA_SUN_EFFECT_SKY); RNA_def_property_ui_text(prop, "Sky", "Apply sun effect on sky."); - RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); prop= RNA_def_property(srna, "atmosphere", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "sun_effect_type", LA_SUN_EFFECT_AP); RNA_def_property_ui_text(prop, "Atmosphere", "Apply sun effect on atmosphere."); - RNA_def_property_update(prop, NC_LAMP|ND_SKY, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); } static void rna_def_lamp(BlenderRNA *brna) @@ -312,48 +339,48 @@ static void rna_def_lamp(BlenderRNA *brna) prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "Type", "Type of Lamp."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "dist"); RNA_def_property_ui_range(prop, 0, 1000, 1.0, 2); RNA_def_property_ui_text(prop, "Distance", "Falloff distance - the light is at half the original intensity at this point."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); prop= RNA_def_property(srna, "energy", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_range(prop, 0, 10.0, 0.1, 2); RNA_def_property_ui_text(prop, "Energy", "Amount of light that the lamp emits."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "r"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Color", "Light color."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "layer", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_LAYER); RNA_def_property_ui_text(prop, "Layer", "Illuminates objects only on the same layer the lamp is on."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "negative", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_NEG); RNA_def_property_ui_text(prop, "Negative", "Lamp casts negative light."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "specular", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", LA_NO_SPEC); RNA_def_property_ui_text(prop, "Specular", "Lamp creates specular highlights."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "diffuse", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", LA_NO_DIFF); RNA_def_property_ui_text(prop, "Diffuse", "Lamp does diffuse shading."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); /* textures */ rna_def_mtex_common(srna, "rna_Lamp_mtex_begin", "rna_Lamp_active_texture_get", - "rna_Lamp_active_texture_set", "LampTextureSlot"); + "rna_Lamp_active_texture_set", "LampTextureSlot", "rna_Lamp_update"); } static void rna_def_lamp_falloff(StructRNA *srna) @@ -371,29 +398,29 @@ static void rna_def_lamp_falloff(StructRNA *srna) prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_fallofftype_items); RNA_def_property_ui_text(prop, "Falloff Type", "Intensity Decay with distance."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "curfalloff"); RNA_def_property_ui_text(prop, "Falloff Curve", "Custom Lamp Falloff Curve"); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "sphere", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SPHERE); RNA_def_property_ui_text(prop, "Sphere", "Sets light intensity to zero beyond lamp distance."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); prop= RNA_def_property(srna, "linear_attenuation", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "att1"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Linear Attenuation", "Linear distance attentuation."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "quadratic_attenuation", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "att2"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Quadratic Attenuation", "Quadratic distance attentuation."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); } static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area) @@ -426,55 +453,55 @@ static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area) RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, (spot)? prop_spot_shadow_items: prop_shadow_items); RNA_def_property_ui_text(prop, "Shadow Method", "Method to compute lamp shadow with."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "shadow_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shdwr"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Shadow Color", "Color of shadows cast by the lamp."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "only_shadow", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_ONLYSHADOW); RNA_def_property_ui_text(prop, "Only Shadow", "Causes light to cast shadows only without illuminating objects."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "shadow_ray_sampling_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ray_samp_method"); RNA_def_property_enum_items(prop, (area)? prop_spot_ray_sampling_method_items: prop_ray_sampling_method_items); RNA_def_property_ui_text(prop, "Shadow Ray Sampling Method", "Method for generating shadow samples: Adaptive QMC is fastest, Constant QMC is less noisy but slower."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, (area)? "shadow_ray_samples_x": "shadow_ray_samples", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ray_samp"); RNA_def_property_range(prop, 1, 64); RNA_def_property_ui_text(prop, (area)? "Shadow Ray Samples": "Shadow Ray Samples X","Amount of samples taken extra (samples x samples)."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); if(area) { prop= RNA_def_property(srna, "shadow_ray_samples_y", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ray_sampy"); RNA_def_property_range(prop, 1, 64); RNA_def_property_ui_text(prop, "Shadow Ray Samples Y", "Amount of samples taken extra (samples x samples)."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); } prop= RNA_def_property(srna, "shadow_adaptive_threshold", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "adapt_thresh"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Shadow Adaptive Threshold", "Threshold for Adaptive Sampling (Raytraced shadows)."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "shadow_soft_size", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "soft"); RNA_def_property_ui_range(prop, 0, 100, 0.1, 3); RNA_def_property_ui_text(prop, "Shadow Soft Size", "Light size for ray shadow sampling (Raytraced shadows)."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "shadow_layer", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_LAYER_SHADOW); RNA_def_property_ui_text(prop, "Shadow Layer", "Causes only objects on the same layer to cast shadows."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); } static void rna_def_point_lamp(BlenderRNA *brna) @@ -510,41 +537,41 @@ static void rna_def_area_lamp(BlenderRNA *brna) prop= RNA_def_property(srna, "umbra", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_UMBRA); RNA_def_property_ui_text(prop, "Umbra", "Emphasize parts that are fully shadowed (Constant Jittered sampling)."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "dither", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_DITHER); RNA_def_property_ui_text(prop, "Dither", "Use 2x2 dithering for sampling (Constant Jittered sampling)."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "jitter", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_JITTER); RNA_def_property_ui_text(prop, "Jitter", "Use noise for sampling (Constant Jittered sampling)."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "shape", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "area_shape"); RNA_def_property_enum_items(prop, prop_areashape_items); RNA_def_property_ui_text(prop, "Shape", "Shape of the area lamp."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "area_size"); RNA_def_property_ui_range(prop, 0, 100, 0.1, 3); RNA_def_property_ui_text(prop, "Size", "Size of the area of the area Lamp, X direction size for Rectangle shapes."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); prop= RNA_def_property(srna, "size_y", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "area_sizey"); RNA_def_property_ui_range(prop, 0, 100, 0.1, 3); RNA_def_property_ui_text(prop, "Size Y", "Size of the area of the area Lamp in the Y direction for Rectangle shapes."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); prop= RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "k"); RNA_def_property_ui_range(prop, 0.001, 2.0, 0.1, 3); RNA_def_property_ui_text(prop, "Gamma", "Light gamma correction value."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); } static void rna_def_spot_lamp(BlenderRNA *brna) @@ -581,101 +608,101 @@ static void rna_def_spot_lamp(BlenderRNA *brna) prop= RNA_def_property(srna, "square", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SQUARE); RNA_def_property_ui_text(prop, "Square", "Casts a square spot light shape."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); prop= RNA_def_property(srna, "halo", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_HALO); RNA_def_property_ui_text(prop, "Halo", "Renders spotlight with a volumetric halo (Buffer Shadows)."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "halo_intensity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "haint"); RNA_def_property_ui_range(prop, 0, 5.0, 0.1, 3); RNA_def_property_ui_text(prop, "Halo Intensity", "Brightness of the spotlight's halo cone (Buffer Shadows)."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "halo_step", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "shadhalostep"); RNA_def_property_range(prop, 0, 12); RNA_def_property_ui_text(prop, "Halo Step", "Volumetric halo sampling frequency."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "shadow_buffer_size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "bufsize"); RNA_def_property_range(prop, 512, 10240); RNA_def_property_ui_text(prop, "Shadow Buffer Size", "Resolution of the shadow buffer, higher values give crisper shadows but use more memory"); RNA_def_property_int_funcs(prop, NULL, "rna_Lamp_buffer_size_set", NULL); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "shadow_filter_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "filtertype"); RNA_def_property_enum_items(prop, prop_shadbuffiltertype_items); RNA_def_property_ui_text(prop, "Shadow Filter Type", "Type of shadow filter (Buffer Shadows)."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "shadow_sample_buffers", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "buffers"); RNA_def_property_enum_items(prop, prop_numbuffer_items); RNA_def_property_ui_text(prop, "Shadow Sample Buffers", "Number of shadow buffers to render for better AA, this increases memory usage."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "spot_blend", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "spotblend"); RNA_def_property_range(prop, 0.0f ,1.0f); RNA_def_property_ui_text(prop, "Spot Blend", "The softness of the spotlight edge."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); prop= RNA_def_property(srna, "spot_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "spotsize"); RNA_def_property_range(prop, 1.0f ,180.0f); RNA_def_property_ui_text(prop, "Spot Size", "Angle of the spotlight beam in degrees."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); prop= RNA_def_property(srna, "shadow_buffer_clip_start", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "clipsta"); RNA_def_property_range(prop, 0.0f, 9999.0f); RNA_def_property_ui_text(prop, "Shadow Buffer Clip Start", "Shadow map clip start: objects closer will not generate shadows"); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); prop= RNA_def_property(srna, "shadow_buffer_clip_end", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "clipend"); RNA_def_property_range(prop, 0.0f, 9999.0f); RNA_def_property_ui_text(prop, "Shadow Buffer Clip End", "Shadow map clip end beyond which objects will not generate shadows."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); prop= RNA_def_property(srna, "shadow_buffer_bias", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "bias"); RNA_def_property_range(prop, 0.0f, 5.0f); RNA_def_property_ui_text(prop, "Shadow Buffer Bias", "Shadow buffer sampling bias."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "shadow_buffer_soft", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "soft"); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Shadow Buffer Soft", "Size of shadow buffer sampling area."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "shadow_buffer_samples", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "samp"); RNA_def_property_range(prop, 1, 16); RNA_def_property_ui_text(prop, "Samples", "Number of shadow buffer samples."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "shadow_buffer_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "buftype"); RNA_def_property_enum_items(prop, prop_shadbuftype_items); RNA_def_property_ui_text(prop, "Shadow Buffer Type", "Type of shadow buffer."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "auto_clip_start", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "bufflag", LA_SHADBUF_AUTO_START); RNA_def_property_ui_text(prop, "Autoclip Start", "Automatic calculation of clipping-start, based on visible vertices."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); prop= RNA_def_property(srna, "auto_clip_end", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "bufflag", LA_SHADBUF_AUTO_END); RNA_def_property_ui_text(prop, "Autoclip End", "Automatic calculation of clipping-end, based on visible vertices."); - RNA_def_property_update(prop, NC_LAMP|ND_LIGHTING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); } static void rna_def_sun_lamp(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index a6f22017aaa..9f7b97dfa05 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -33,6 +33,7 @@ #include "DNA_material_types.h" #include "DNA_texture_types.h" +#include "WM_api.h" #include "WM_types.h" static EnumPropertyItem prop_texture_coordinates_items[] = { @@ -53,10 +54,28 @@ static EnumPropertyItem prop_texture_coordinates_items[] = { #include "MEM_guardedalloc.h" +#include "BKE_depsgraph.h" +#include "BKE_main.h" #include "BKE_texture.h" #include "ED_node.h" +static void rna_Material_update(bContext *C, PointerRNA *ptr) +{ + Material *ma= ptr->id.data; + + DAG_id_flush_update(&ma->id, 0); + WM_event_add_notifier(C, NC_MATERIAL|ND_SHADING, ma); +} + +static void rna_Material_draw_update(bContext *C, PointerRNA *ptr) +{ + Material *ma= ptr->id.data; + + DAG_id_flush_update(&ma->id, 0); + WM_event_add_notifier(C, NC_MATERIAL|ND_SHADING_DRAW, ma); +} + static PointerRNA rna_Material_mirror_get(PointerRNA *ptr) { return rna_pointer_inherit_refine(ptr, &RNA_MaterialRaytraceMirror, ptr->id.data); @@ -308,122 +327,122 @@ static void rna_def_material_mtex(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_texture_coordinates_items); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Material_texture_coordinates_itemf"); RNA_def_property_ui_text(prop, "Texture Coordinates", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "object"); RNA_def_property_struct_type(prop, "Object"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Object", "Object to use for mapping with Object texture coordinates."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "uvname"); RNA_def_property_ui_text(prop, "UV Layer", "UV layer to use for mapping with UV texture coordinates."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "from_dupli", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_DUPLI_MAPTO); RNA_def_property_ui_text(prop, "From Dupli", "Dupli's instanced from verts, faces or particles, inherit texture coordinate from their parent."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "from_original", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_OB_DUPLI_ORIG); RNA_def_property_ui_text(prop, "From Original", "Dupli's derive their object coordinates from the original objects transformation."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "map_colordiff", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_COL); RNA_def_property_ui_text(prop, "Diffuse Color", "Causes the texture to affect basic color of the material"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "map_normal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_NORM); RNA_def_property_ui_text(prop, "Normal", "Causes the texture to affect the rendered normal"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "map_colorspec", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_COLSPEC); RNA_def_property_ui_text(prop, "Specular Color", "Causes the texture to affect the specularity color"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "map_mirror", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_COLMIR); RNA_def_property_ui_text(prop, "Mirror", "Causes the texture to affect the mirror color"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "map_diffuse", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_REF); RNA_def_property_ui_text(prop, "Diffuse", "Causes the texture to affect the value of the materials diffuse reflectivity"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "map_specular", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_SPEC); RNA_def_property_ui_text(prop, "Specular", "Causes the texture to affect the value of specular reflectivity"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "map_ambient", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_AMB); RNA_def_property_ui_text(prop, "Ambient", "Causes the texture to affect the value of ambient"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "map_hardness", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_HAR); RNA_def_property_ui_text(prop, "Hardness", "Causes the texture to affect the hardness value"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "map_raymir", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_RAYMIRR); RNA_def_property_ui_text(prop, "Ray-Mirror", "Causes the texture to affect the ray-mirror value"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "map_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_ALPHA); RNA_def_property_ui_text(prop, "Alpha", "Causes the texture to affect the alpha value"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "map_emit", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_EMIT); RNA_def_property_ui_text(prop, "Emit", "Causes the texture to affect the emit value"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "map_translucency", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_TRANSLU); RNA_def_property_ui_text(prop, "Translucency", "Causes the texture to affect the translucency value"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "map_displacement", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_DISPLACE); RNA_def_property_ui_text(prop, "Displacement", "Let the texture displace the surface"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "map_warp", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_WARP); RNA_def_property_ui_text(prop, "Warp", "Let the texture warp texture coordinates of next channels"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "x_mapping", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "projx"); RNA_def_property_enum_items(prop, prop_x_mapping_items); RNA_def_property_ui_text(prop, "X Mapping", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "y_mapping", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "projy"); RNA_def_property_enum_items(prop, prop_y_mapping_items); RNA_def_property_ui_text(prop, "Y Mapping", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "z_mapping", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "projz"); RNA_def_property_enum_items(prop, prop_z_mapping_items); RNA_def_property_ui_text(prop, "Z Mapping", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_mapping_items); RNA_def_property_ui_text(prop, "Mapping", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); /* XXX: pmapto, pmaptoneg */ @@ -431,7 +450,7 @@ static void rna_def_material_mtex(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "normapspace"); RNA_def_property_enum_items(prop, prop_normal_map_space_items); RNA_def_property_ui_text(prop, "Normal Map Space", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); /* XXX: MTex.which_output */ @@ -441,158 +460,158 @@ static void rna_def_material_mtex(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "dispfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Displacement Factor", "Amount texture displaces the surface."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "warp_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "warpfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Warp Factor", "Amount texture affects texture coordinates of next channels."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "colorspec_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "colfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Specular Color Factor", "Amount texture affects specular color."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "colordiff_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "colfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Diffuse Color Factor", "Amount texture affects diffuse color."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "mirror_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "colfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Mirror Factor", "Amount texture affects mirror color."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "alpha_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "varfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Alpha Factor", "Amount texture affects alpha."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "diffuse_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "varfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Diffuse Factor", "Amount texture affects diffuse reflectivity."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "specular_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "varfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Specular Factor", "Amount texture affects specular reflectivity."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "emit_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "varfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Emit Factor", "Amount texture affects emission."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "hardness_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "varfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Hardness Factor", "Amount texture affects hardness."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "raymir_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "varfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Ray Mirror Factor", "Amount texture affects ray mirror."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "translucency_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "varfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Translucency Factor", "Amount texture affects translucency."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "ambient_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "varfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Ambient Factor", "Amount texture affects ambient."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); /* volume material */ prop= RNA_def_property(srna, "map_coloremission", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_EMISSION_COL); RNA_def_property_ui_text(prop, "Emission Color", "Causes the texture to affect the colour of emission"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "map_colorabsorption", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_ABSORPTION_COL); RNA_def_property_ui_text(prop, "Absorption Color", "Causes the texture to affect the result colour after absorption"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "map_density", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_DENSITY); RNA_def_property_ui_text(prop, "Density", "Causes the texture to affect the volume's density"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "map_emission", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_EMISSION); RNA_def_property_ui_text(prop, "Emission", "Causes the texture to affect the volume's emission"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "map_absorption", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_ABSORPTION); RNA_def_property_ui_text(prop, "Absorption", "Causes the texture to affect the volume's absorption"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "map_scattering", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_SCATTERING); RNA_def_property_ui_text(prop, "Scattering", "Causes the texture to affect the volume's scattering"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "coloremission_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "colfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Emission Color Factor", "Amount texture affects emission color."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "colorabsorption_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "colfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Absorpion Color Factor", "Amount texture affects diffuse color."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "density_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "varfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Density Factor", "Amount texture affects density."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "emission_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "varfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Emission Factor", "Amount texture affects emission."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "absorption_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "varfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Absorption Factor", "Amount texture affects absorption."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "scattering_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "varfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Scattering Factor", "Amount texture affects scattering."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); /* end volume material */ prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_MaterialTextureSlot_enabled_get", "rna_MaterialTextureSlot_enabled_set"); RNA_def_property_ui_text(prop, "Enabled", "Enable this material texture slot."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "new_bump", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_NEW_BUMP); RNA_def_property_ui_text(prop, "New Bump", "Use new, corrected bump mapping code (backwards compatibility option)."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); } static void rna_def_material_colors(StructRNA *srna) @@ -631,79 +650,79 @@ static void rna_def_material_colors(StructRNA *srna) RNA_def_property_float_sdna(prop, NULL, "r"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Diffuse Color", ""); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Material_draw_update"); prop= RNA_def_property(srna, "specular_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "specr"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Specular Color", "Specular color of the material."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Material_draw_update"); prop= RNA_def_property(srna, "mirror_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "mirr"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Mirror Color", "Mirror color of the material."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_FACTOR); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Alpha", "Alpha transparency of the material."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Material_draw_update"); prop= RNA_def_property(srna, "specular_alpha", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "spectra"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Specular Alpha", "Alpha transparency for specular areas."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); /* Color bands */ prop= RNA_def_property(srna, "use_diffuse_ramp", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAMP_COL); RNA_def_property_boolean_funcs(prop, NULL, "rna_Material_use_diffuse_ramp_set"); RNA_def_property_ui_text(prop, "Use Diffuse Ramp", "Toggle diffuse ramp operations."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "diffuse_ramp", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "ramp_col"); RNA_def_property_struct_type(prop, "ColorRamp"); RNA_def_property_ui_text(prop, "Diffuse Ramp", "Color ramp used to affect diffuse shading."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "use_specular_ramp", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAMP_SPEC); RNA_def_property_boolean_funcs(prop, NULL, "rna_Material_use_specular_ramp_set"); RNA_def_property_ui_text(prop, "Use Specular Ramp", "Toggle specular ramp operations."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "specular_ramp", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "ramp_spec"); RNA_def_property_struct_type(prop, "ColorRamp"); RNA_def_property_ui_text(prop, "Specular Ramp", "Color ramp used to affect specular shading."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "diffuse_ramp_blend", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rampblend_col"); RNA_def_property_enum_items(prop, prop_ramp_blend_diffuse_items); RNA_def_property_ui_text(prop, "Diffuse Ramp Blend", ""); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "specular_ramp_blend", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rampblend_spec"); RNA_def_property_enum_items(prop, prop_ramp_blend_diffuse_items); RNA_def_property_ui_text(prop, "Diffuse Ramp Blend", ""); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "diffuse_ramp_input", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rampin_col"); RNA_def_property_enum_items(prop, prop_ramp_input_items); RNA_def_property_ui_text(prop, "Diffuse Ramp Input", ""); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "specular_ramp_input", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rampin_spec"); RNA_def_property_enum_items(prop, prop_ramp_input_items); RNA_def_property_ui_text(prop, "Specular Ramp Input", ""); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); } @@ -723,47 +742,47 @@ static void rna_def_material_diffuse(StructRNA *srna) RNA_def_property_enum_sdna(prop, NULL, "diff_shader"); RNA_def_property_enum_items(prop, prop_diff_shader_items); RNA_def_property_ui_text(prop, "Diffuse Shader Model", ""); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "diffuse_intensity", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "ref"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Diffuse Intensity", "Amount of diffuse reflection."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Material_draw_update"); prop= RNA_def_property(srna, "roughness", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 3.14f); RNA_def_property_ui_text(prop, "Roughness", "Oren-Nayar Roughness"); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "diffuse_toon_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "param[0]"); RNA_def_property_range(prop, 0.0f, 3.14f); RNA_def_property_ui_text(prop, "Diffuse Toon Size", "Size of diffuse toon area."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "diffuse_toon_smooth", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "param[1]"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Diffuse Toon Smooth", "Smoothness of diffuse toon area."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "diffuse_fresnel", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "param[1]"); RNA_def_property_range(prop, 0.0f, 5.0f); RNA_def_property_ui_text(prop, "Diffuse Fresnel", "Power of Fresnel."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "diffuse_fresnel_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "param[0]"); RNA_def_property_range(prop, 0.0f, 5.0f); RNA_def_property_ui_text(prop, "Diffuse Fresnel Factor", "Blending factor of Frensel."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "darkness", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 2.0f); RNA_def_property_ui_text(prop, "Darkness", "Minnaert darkness."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); } static void rna_def_material_raymirror(BlenderRNA *brna) @@ -784,67 +803,67 @@ static void rna_def_material_raymirror(BlenderRNA *brna) prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAYMIRROR); /* use bitflags */ RNA_def_property_ui_text(prop, "Enabled", "Enable raytraced reflections."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "reflect_factor", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "ray_mirror"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Reflectivity", "Sets the amount mirror reflection for raytrace."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "fresnel", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fresnel_mir"); RNA_def_property_range(prop, 0.0f, 5.0f); RNA_def_property_ui_text(prop, "Fresnel", "Power of Fresnel for mirror reflection."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "fresnel_factor", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "fresnel_mir_i"); RNA_def_property_range(prop, 0.0f, 5.0f); RNA_def_property_ui_text(prop, "Fresnel Factor", "Blending factor for Fresnel."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "gloss_mir"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Gloss Amount", "The shininess of the reflection. Values < 1.0 give diffuse, blurry reflections."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "gloss_anisotropic", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "aniso_gloss_mir"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Gloss Anisotropy", "The shape of the reflection, from 0.0 (circular) to 1.0 (fully stretched along the tangent."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "gloss_samples", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "samp_gloss_mir"); RNA_def_property_range(prop, 0, 1024); RNA_def_property_ui_text(prop, "Gloss Samples", "Number of cone samples averaged for blurry reflections."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "gloss_threshold", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "adapt_thresh_mir"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Gloss Threshold", "Threshold for adaptive sampling. If a sample contributes less than this amount (as a percentage), sampling is stopped."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ray_depth"); RNA_def_property_range(prop, 0, 10); RNA_def_property_ui_text(prop, "Depth", "Maximum allowed number of light inter-reflections."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "dist_mir"); RNA_def_property_range(prop, 0.0f, 10000.0f); RNA_def_property_ui_text(prop, "Maximum Distance", "Maximum distance of reflected rays. Reflections further than this range fade to sky color or material color."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "fade_to", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "fadeto_mir"); RNA_def_property_enum_items(prop, prop_fadeto_mir_items); RNA_def_property_ui_text(prop, "Fade-out Color", "The color that rays with no intersection within the Max Distance take. Material color can be best for indoor scenes, sky color for outdoor."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); } static void rna_def_material_raytra(BlenderRNA *brna) @@ -861,61 +880,61 @@ static void rna_def_material_raytra(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "ang"); RNA_def_property_range(prop, 1.0f, 3.0f); RNA_def_property_ui_text(prop, "IOR", "Sets angular index of refraction for raytraced refraction."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "fresnel", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fresnel_tra"); RNA_def_property_range(prop, 0.0f, 5.0f); RNA_def_property_ui_text(prop, "Fresnel", "Power of Fresnel for transparency (Ray or ZTransp)."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "fresnel_factor", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "fresnel_tra_i"); RNA_def_property_range(prop, 1.0f, 5.0f); RNA_def_property_ui_text(prop, "Fresnel Factor", "Blending factor for Fresnel."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "gloss_tra"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Gloss Amount", "The clarity of the refraction. Values < 1.0 give diffuse, blurry refractions."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "gloss_samples", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "samp_gloss_tra"); RNA_def_property_range(prop, 0, 1024); RNA_def_property_ui_text(prop, "Gloss Samples", "Number of cone samples averaged for blurry refractions."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "gloss_threshold", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "adapt_thresh_tra"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Gloss Threshold", "Threshold for adaptive sampling. If a sample contributes less than this amount (as a percentage), sampling is stopped."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ray_depth_tra"); RNA_def_property_range(prop, 0, 10); RNA_def_property_ui_text(prop, "Depth", "Maximum allowed number of light inter-refractions."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "filter", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "filter"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Filter", "Amount to blend in the material's diffuse color in raytraced transparency (simulating absorption)."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "limit", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "tx_limit"); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Limit", "Maximum depth for light to travel through the transparent material before becoming fully filtered (0.0 is disabled)."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "tx_falloff"); RNA_def_property_range(prop, 0.1f, 10.0f); RNA_def_property_ui_text(prop, "Falloff", "Falloff power for transmissivity filter effect (1.0 is linear)."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); } static void rna_def_material_volume(BlenderRNA *brna) @@ -954,120 +973,120 @@ static void rna_def_material_volume(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "stepsize_type"); RNA_def_property_enum_items(prop, prop_stepsize_items); RNA_def_property_ui_text(prop, "Step Calculation", "Method of calculating the steps through the volume"); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "step_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "stepsize"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3); RNA_def_property_ui_text(prop, "Step Size", "Distance between subsequent volume depth samples."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "shading_step_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "shade_stepsize"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3); RNA_def_property_ui_text(prop, "Shading Step Size", "Distance between subsequent volume shading samples."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "scattering_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "shade_type"); RNA_def_property_enum_items(prop, prop_scattering_items); RNA_def_property_ui_text(prop, "Scattering Mode", "Method of shading, attenuating, and scattering light through the volume"); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "light_cache", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shadeflag", MA_VOL_PRECACHESHADING); /* use bitflags */ RNA_def_property_ui_text(prop, "Light Cache", "Pre-calculate the shading information into a voxel grid, speeds up shading at slightly less accuracy"); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "cache_resolution", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "precache_resolution"); RNA_def_property_range(prop, 0, 1024); RNA_def_property_ui_text(prop, "Resolution", "Resolution of the voxel grid, low resolutions are faster, high resolutions use more memory."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "ms_diffusion", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ms_diff"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_text(prop, "Diffusion", "Diffusion factor, the strength of the blurring effect"); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "ms_spread", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ms_steps"); RNA_def_property_range(prop, 0, 1024); RNA_def_property_ui_text(prop, "Spread", "Simulation steps, the effective distance over which the light is diffused"); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "ms_intensity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ms_intensity"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_text(prop, "Intensity", "Multiplier for multiple scattered light energy"); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "depth_cutoff", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "depth_cutoff"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Depth Cutoff", "Stop ray marching early if transmission drops below this luminance - higher values give speedups in dense volumes at the expense of accuracy."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "density", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "density"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Density", "The base density of the volume"); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "density_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "density_scale"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3); RNA_def_property_ui_text(prop, "Density Scale", "Multiplier for the material's density"); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "absorption", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "absorption"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3); RNA_def_property_ui_text(prop, "Absorption", "Amount of light that gets absorbed by the volume - higher values mean light travels less distance"); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "absorption_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "absorption_col"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Absorption Color", ""); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Material_draw_update"); prop= RNA_def_property(srna, "scattering", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "scattering"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1 ,3); RNA_def_property_ui_text(prop, "Scattering", "Amount of light that gets scattered by the volume - values > 1.0 are non-physical"); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "emission", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "emission"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3); RNA_def_property_ui_text(prop, "Emission", "Amount of light that gets emitted by the volume"); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "emission_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "emission_col"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Emission Color", ""); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Material_draw_update"); prop= RNA_def_property(srna, "phase_function", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "phasefunc_type"); RNA_def_property_enum_items(prop, prop_phasefunction_items); RNA_def_property_ui_text(prop, "Phase Function", "Isotropic/Anisotropic scattering"); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "asymmetry", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "phasefunc_g"); RNA_def_property_range(prop, -1.0f, 1.0f); RNA_def_property_ui_text(prop, "Asymmetry", "Continuum between forward scattering and back scattering"); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); } @@ -1085,118 +1104,118 @@ static void rna_def_material_halo(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "hasize"); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Size", "Sets the dimension of the halo."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "hardness", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "har"); RNA_def_property_range(prop, 0, 127); RNA_def_property_ui_text(prop, "Hardness", "Sets the hardness of the halo."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "add", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "add"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Add", "Sets the strength of the add effect."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "rings", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ringc"); RNA_def_property_range(prop, 0, 24); RNA_def_property_ui_text(prop, "Rings", "Sets the number of rings rendered over the halo."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "line_number", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "linec"); RNA_def_property_range(prop, 0, 250); RNA_def_property_ui_text(prop, "Line Number", "Sets the number of star shaped lines rendered over the halo."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "star_tips", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "starc"); RNA_def_property_range(prop, 3, 50); RNA_def_property_ui_text(prop, "Star Tips", "Sets the number of points on the star shaped halo."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "seed", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "seed1"); RNA_def_property_range(prop, 0, 255); RNA_def_property_ui_text(prop, "Seed", "Randomizes ring dimension and line location."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "flare_mode", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_FLARE); /* use bitflags */ RNA_def_property_ui_text(prop, "Flare", "Renders halo as a lensflare."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "flare_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "flaresize"); RNA_def_property_range(prop, 0.1f, 25.0f); RNA_def_property_ui_text(prop, "Flare Size", "Sets the factor by which the flare is larger than the halo."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "flare_subsize", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "subsize"); RNA_def_property_range(prop, 0.1f, 25.0f); RNA_def_property_ui_text(prop, "Flare Subsize", "Sets the dimension of the subflares, dots and circles."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "flare_boost", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "flareboost"); RNA_def_property_range(prop, 0.1f, 10.0f); RNA_def_property_ui_text(prop, "Flare Boost", "Gives the flare extra strength."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "flare_seed", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "seed2"); RNA_def_property_range(prop, 0, 255); RNA_def_property_ui_text(prop, "Flare Seed", "Specifies an offset in the flare seed table."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "flares_sub", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "flarec"); RNA_def_property_range(prop, 1, 32); RNA_def_property_ui_text(prop, "Flares Sub", "Sets the number of subflares."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "ring", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_RINGS); RNA_def_property_ui_text(prop, "Rings", "Renders rings over halo."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "lines", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_LINES); RNA_def_property_ui_text(prop, "Lines", "Renders star shaped lines over halo."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "star", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_STAR); RNA_def_property_ui_text(prop, "Star", "Renders halo as a star."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "texture", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALOTEX); RNA_def_property_ui_text(prop, "Texture", "Gives halo a texture."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "vertex_normal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALOPUNO); RNA_def_property_ui_text(prop, "Vertex Normal", "Uses the vertex normal to specify the dimension of the halo."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "xalpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_XALPHA); RNA_def_property_ui_text(prop, "Extreme Alpha", "Uses extreme alpha."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "shaded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_SHADE); RNA_def_property_ui_text(prop, "Shaded", "Lets halo receive light and shadows from external objects."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "soft", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_SOFT); RNA_def_property_ui_text(prop, "Soft", "Softens the edges of halos at intersections with other geometry."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); } static void rna_def_material_sss(BlenderRNA *brna) @@ -1214,59 +1233,59 @@ static void rna_def_material_sss(BlenderRNA *brna) RNA_def_property_range(prop, 0.001, FLT_MAX); RNA_def_property_ui_range(prop, 0.001, 10000, 1, 3); RNA_def_property_ui_text(prop, "Radius", "Mean red/green/blue scattering path length."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "sss_col"); RNA_def_property_ui_text(prop, "Color", "Scattering color."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "error_tolerance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "sss_error"); RNA_def_property_ui_range(prop, 0.0001, 10, 1, 3); RNA_def_property_ui_text(prop, "Error Tolerance", "Error tolerance (low values are slower and higher quality)."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "sss_scale"); RNA_def_property_ui_range(prop, 0.001, 1000, 1, 3); RNA_def_property_ui_text(prop, "Scale", "Object scale factor."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "ior", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "sss_ior"); RNA_def_property_ui_range(prop, 0.1, 2, 1, 3); RNA_def_property_ui_text(prop, "IOR", "Index of refraction (higher values are denser)."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "color_factor", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "sss_colfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Color Factor", "Blend factor for SSS colors."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "texture_factor", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "sss_texfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Texture Factor", "Texture scatting blend factor."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "front", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "sss_front"); RNA_def_property_range(prop, 0, 2); RNA_def_property_ui_text(prop, "Front", "Front scattering weight."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "back", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "sss_back"); RNA_def_property_range(prop, 0, 10); RNA_def_property_ui_text(prop, "Back", "Back scattering weight."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "sss_flag", MA_DIFF_SSS); RNA_def_property_ui_text(prop, "Enabled", "Enable diffuse subsurface scatting effects in a material."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); } static void rna_def_material_specularity(StructRNA *srna) @@ -1285,13 +1304,13 @@ static void rna_def_material_specularity(StructRNA *srna) RNA_def_property_enum_sdna(prop, NULL, "spec_shader"); RNA_def_property_enum_items(prop, prop_specular_shader_items); RNA_def_property_ui_text(prop, "Specular Shader Model", ""); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "specular_intensity", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "spec"); RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_text(prop, "Specular Intensity", ""); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); /* NOTE: "har", "param", etc are used for multiple purposes depending on * settings. This should be fixed in DNA once, for RNA we just expose them @@ -1302,31 +1321,31 @@ static void rna_def_material_specularity(StructRNA *srna) RNA_def_property_float_sdna(prop, NULL, "har"); RNA_def_property_range(prop, 1, 511); RNA_def_property_ui_text(prop, "Specular Hardness", ""); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "specular_ior", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "refrac"); RNA_def_property_range(prop, 1, 10); RNA_def_property_ui_text(prop, "Specular IOR", ""); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "specular_toon_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "param[2]"); RNA_def_property_range(prop, 0.0f, 1.53f); RNA_def_property_ui_text(prop, "Specular Toon Size", "Size of specular toon area."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "specular_toon_smooth", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "param[3]"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Specular Toon Smooth", "Ssmoothness of specular toon area."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "specular_slope", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rms"); RNA_def_property_range(prop, 0, 0.4); RNA_def_property_ui_text(prop, "Specular Slope", "The standard deviation of surface slope."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); } static void rna_def_material_strand(BlenderRNA *brna) @@ -1342,58 +1361,58 @@ static void rna_def_material_strand(BlenderRNA *brna) prop= RNA_def_property(srna, "tangent_shading", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TANGENT_STR); RNA_def_property_ui_text(prop, "Tangent Shading", "Uses direction of strands as normal for tangent-shading."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "surface_diffuse", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_STR_SURFDIFF); RNA_def_property_ui_text(prop, "Surface Diffuse", "Make diffuse shading more similar to shading the surface."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "blend_distance", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "strand_surfnor"); RNA_def_property_range(prop, 0, 10); RNA_def_property_ui_text(prop, "Blend Distance", "Worldspace distance over which to blend in the surface normal."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "blender_units", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_STR_B_UNITS); RNA_def_property_ui_text(prop, "Blender Units", "Use Blender units for widths instead of pixels."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "root_size", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "strand_sta"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_MaterialStrand_start_size_range"); RNA_def_property_ui_text(prop, "Root Size", "Start size of strands in pixels Blender units."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "tip_size", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "strand_end"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_MaterialStrand_end_size_range"); RNA_def_property_ui_text(prop, "Tip Size", "Start size of strands in pixels or Blender units."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "min_size", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "strand_min"); RNA_def_property_range(prop, 0.001, 10); RNA_def_property_ui_text(prop, "Minimum Size", "Minimum size of strands in pixels."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "shape", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "strand_ease"); RNA_def_property_range(prop, -0.9, 0.9); RNA_def_property_ui_text(prop, "Shape", "Positive values make strands rounder, negative makes strands spiky."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "width_fade", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "strand_widthfade"); RNA_def_property_range(prop, 0, 2); RNA_def_property_ui_text(prop, "Width Fade", "Transparency along the width of the strand."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "strand_uvname"); RNA_def_property_ui_text(prop, "UV Layer", "Name of UV layer to override."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); } static void rna_def_material_physics(BlenderRNA *brna) @@ -1461,45 +1480,45 @@ void RNA_def_material(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "Type", "Material type defining how the object is rendered."); RNA_def_property_enum_funcs(prop, NULL, "rna_Material_type_set", NULL); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_Material_draw_update"); prop= RNA_def_property(srna, "transparency", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TRANSP); RNA_def_property_ui_text(prop, "Transparency", "Render material as transparent."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "transparency_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, transparency_items); RNA_def_property_ui_text(prop, "Transparency Method", "Method to use for rendering transparency."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "ambient", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "amb"); RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_text(prop, "Ambient", "Amount of global ambient color the material receives."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "emit", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 2.0f, 10, 2); RNA_def_property_ui_text(prop, "Emit", "Amount of light to emit."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "translucency", PROP_FLOAT, PROP_FACTOR); RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_text(prop, "Translucency", "Amount of diffuse shading on the back side."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "cubic", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shade_flag", MA_CUBIC); RNA_def_property_ui_text(prop, "Cubic Interpolation", "Use cubic interpolation for diffuse values, for smoother transitions."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "object_color", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shade_flag", MA_OBCOLOR); RNA_def_property_ui_text(prop, "Object Color", "Modulate the result with a per-object color."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "shadow_ray_bias", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "sbias"); @@ -1515,106 +1534,106 @@ void RNA_def_material(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "shad_alpha"); RNA_def_property_range(prop, 0.001, 1); RNA_def_property_ui_text(prop, "Shadow Casting Alpha", "Shadow casting alpha, only in use for Irregular Shadowbuffer."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "light_group", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "group"); RNA_def_property_struct_type(prop, "Group"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Light Group", "Limit lighting to lamps in this Group."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); /* flags */ prop= RNA_def_property(srna, "light_group_exclusive", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_GROUP_NOLAY); RNA_def_property_ui_text(prop, "Light Group Exclusive", "Material uses the light group exclusively - these lamps are excluded from other scene lighting."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "traceable", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TRACEBLE); RNA_def_property_ui_text(prop, "Traceable", "Include this material and geometry that uses it in ray tracing calculations."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "shadows", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHADOW); RNA_def_property_ui_text(prop, "Shadows", "Allows this material to receive shadows."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "shadeless", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHLESS); RNA_def_property_ui_text(prop, "Shadeless", "Makes this material insensitive to light or shadow."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "vertex_color_light", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_VERTEXCOL); RNA_def_property_ui_text(prop, "Vertex Color Light", "Add vertex colors as additional lighting."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "vertex_color_paint", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_VERTEXCOLP); RNA_def_property_ui_text(prop, "Vertex Color Paint", "Replaces object base color with vertex colors (multiplies with 'texture face' face assigned textures)."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ZINV); RNA_def_property_ui_text(prop, "Invert Z Depth", "Renders material's faces with an inverted Z buffer (scanline only)."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "sky", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ENV); RNA_def_property_ui_text(prop, "Sky", "Renders this material with zero alpha, with sky background in place (scanline only)."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "only_shadow", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ONLYSHADOW); RNA_def_property_ui_text(prop, "Only Shadow", "Renders shadows as the material's alpha value, making materials transparent except for shadowed areas."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "face_texture", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FACETEXTURE); RNA_def_property_ui_text(prop, "Face Textures", "Replaces the object's base color with color from face assigned image textures"); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "face_texture_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FACETEXTURE_ALPHA); RNA_def_property_ui_text(prop, "Face Textures Alpha", "Replaces the object's base alpha value with alpha from face assigned image textures"); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "cast_shadows_only", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ONLYCAST); RNA_def_property_ui_text(prop, "Cast Shadows Only", "Makes objects with this material appear invisible, only casting shadows (not rendered)."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "exclude_mist", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_NOMIST); RNA_def_property_ui_text(prop, "Exclude Mist", "Excludes this material from mist effects (in world settings)"); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "receive_transparent_shadows", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHADOW_TRA); RNA_def_property_ui_text(prop, "Receive Transparent Shadows", "Allow this object to receive transparent shadows casted through other objects"); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "ray_shadow_bias", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAYBIAS); RNA_def_property_ui_text(prop, "Ray Shadow Bias", "Prevents raytraced shadow errors on surfaces with smooth shaded normals (terminator problem)"); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "full_oversampling", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FULL_OSA); RNA_def_property_ui_text(prop, "Full Oversampling", "Force this material to render full shading/textures for all anti-aliasing samples"); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "cast_buffer_shadows", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHADBUF); RNA_def_property_ui_text(prop, "Cast Buffer Shadows", "Allow this material to cast shadows from shadow buffer lamps"); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "tangent_shading", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TANGENT_V); RNA_def_property_ui_text(prop, "Tangent Shading", "Use the material's tangent vector instead of the normal for shading - for anisotropic shading effects"); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, 0, "rna_Material_update"); /* nested structs */ prop= RNA_def_property(srna, "raytrace_mirror", PROP_POINTER, PROP_NONE); @@ -1673,7 +1692,7 @@ void RNA_def_material(BlenderRNA *brna) /* common */ rna_def_animdata_common(srna); rna_def_mtex_common(srna, "rna_Material_mtex_begin", "rna_Material_active_texture_get", - "rna_Material_active_texture_set", "MaterialTextureSlot"); + "rna_Material_active_texture_set", "MaterialTextureSlot", "rna_Material_update"); rna_def_material_colors(srna); rna_def_material_diffuse(srna); @@ -1692,7 +1711,7 @@ void RNA_def_material(BlenderRNA *brna) RNA_api_material(srna); } -void rna_def_mtex_common(StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *structname) +void rna_def_mtex_common(StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *structname, const char *update) { PropertyRNA *prop; @@ -1707,13 +1726,13 @@ void rna_def_mtex_common(StructRNA *srna, const char *begin, const char *activeg RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_pointer_funcs(prop, activeget, activeset, NULL); RNA_def_property_ui_text(prop, "Active Texture", "Active texture slot being displayed."); - RNA_def_property_update(prop, NC_TEXTURE|ND_SHADING_DRAW, NULL); + RNA_def_property_update(prop, 0, update); prop= RNA_def_property(srna, "active_texture_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "texact"); RNA_def_property_range(prop, 0, MAX_MTEX-1); RNA_def_property_ui_text(prop, "Active Texture Index", "Index of active texture slot."); - RNA_def_property_update(prop, NC_TEXTURE|ND_SHADING_DRAW, NULL); + RNA_def_property_update(prop, 0, update); } #endif diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 6fb9a9ca57b..d63f5823b2e 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -40,8 +40,6 @@ #include "BKE_node.h" -#include "WM_types.h" - static EnumPropertyItem texture_filter_items[] = { {TXF_BOX, "BOX", 0, "Box", ""}, {TXF_EWA, "EWA", 0, "EWA", ""}, @@ -52,9 +50,15 @@ static EnumPropertyItem texture_filter_items[] = { #ifdef RNA_RUNTIME +#include "BKE_depsgraph.h" #include "BKE_texture.h" +#include "BKE_main.h" + #include "ED_node.h" +#include "WM_api.h" +#include "WM_types.h" + static StructRNA *rna_Texture_refine(struct PointerRNA *ptr) { Tex *tex= (Tex*)ptr->data; @@ -95,6 +99,14 @@ static StructRNA *rna_Texture_refine(struct PointerRNA *ptr) } } +static void rna_Texture_update(bContext *C, PointerRNA *ptr) +{ + Tex *tex= ptr->id.data; + + DAG_id_flush_update(&tex->id, 0); + WM_event_add_notifier(C, NC_TEXTURE, tex); +} + static void rna_Texture_type_set(PointerRNA *ptr, int value) { Tex *tex= (Tex*)ptr->data; @@ -112,6 +124,28 @@ static void rna_Texture_type_set(PointerRNA *ptr, int value) tex->type = value; } +static void rna_TextureSlot_update(bContext *C, PointerRNA *ptr) +{ + ID *id= ptr->id.data; + + DAG_id_flush_update(id, 0); + + switch(GS(id->name)) { + case ID_MA: + WM_event_add_notifier(C, NC_MATERIAL|ND_SHADING, id); + break; + case ID_WO: + WM_event_add_notifier(C, NC_WORLD, id); + break; + case ID_LA: + WM_event_add_notifier(C, NC_LAMP|ND_LIGHTING, id); + break; + case ID_BR: + WM_event_add_notifier(C, NC_BRUSH, id); + break; + } +} + static int rna_TextureSlot_name_length(PointerRNA *ptr) { MTex *mtex= ptr->data; @@ -271,13 +305,13 @@ static void rna_def_color_ramp_element(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "r"); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Color", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "position", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "pos"); RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_text(prop, "Position", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); } static void rna_def_color_ramp(BlenderRNA *brna) @@ -301,13 +335,13 @@ static void rna_def_color_ramp(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "data", "tot"); RNA_def_property_struct_type(prop, "ColorRampElement"); RNA_def_property_ui_text(prop, "Elements", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ipotype"); RNA_def_property_enum_items(prop, prop_interpolation_items); RNA_def_property_ui_text(prop, "Interpolation", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); } static void rna_def_texmapping(BlenderRNA *brna) @@ -321,37 +355,37 @@ static void rna_def_texmapping(BlenderRNA *brna) prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "loc"); RNA_def_property_ui_text(prop, "Location", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER); RNA_def_property_float_sdna(prop, NULL, "rot"); RNA_def_property_ui_text(prop, "Rotation", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "size"); RNA_def_property_ui_text(prop, "Scale", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "minimum", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "min"); RNA_def_property_ui_text(prop, "Minimum", "Minimum value for clipping"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "maximum", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "max"); RNA_def_property_ui_text(prop, "Maximum", "Maximum value for clipping"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "has_minimum", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MIN); RNA_def_property_ui_text(prop, "Has Minimum", "Whether to use minimum clipping value"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "has_maximum", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MAX); RNA_def_property_ui_text(prop, "Has Maximum", "Whether to use maximum clipping value"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); } static void rna_def_mtex(BlenderRNA *brna) @@ -398,60 +432,60 @@ static void rna_def_mtex(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Texture"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Texture", "Texture datablock used by this texture slot."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_TextureSlot_name_get", "rna_TextureSlot_name_length", NULL); RNA_def_property_ui_text(prop, "Name", "Texture slot name."); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_struct_name_property(srna, prop); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); /* mapping */ prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "ofs"); RNA_def_property_ui_range(prop, -10, 10, 10, 2); RNA_def_property_ui_text(prop, "Offset", "Fine tunes texture mapping X, Y and Z locations."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_XYZ); RNA_def_property_ui_range(prop, -100, 100, 10, 2); RNA_def_property_ui_text(prop, "Size", "Sets scaling for the texture's X, Y and Z sizes."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "r"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Color", "The default color for textures that don't return RGB."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "blendtype"); RNA_def_property_enum_items(prop, prop_blend_type_items); RNA_def_property_ui_text(prop, "Blend Type", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); prop= RNA_def_property(srna, "stencil", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_STENCIL); RNA_def_property_ui_text(prop, "Stencil", "Use this texture as a blending value on the next texture."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); prop= RNA_def_property(srna, "negate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_NEGATIVE); RNA_def_property_ui_text(prop, "Negate", "Inverts the values of the texture to reverse its effect."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); prop= RNA_def_property(srna, "rgb_to_intensity", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_RGBTOINT); RNA_def_property_ui_text(prop, "RGB to Intensity", "Converts texture RGB values to intensity (gray) values."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "rot"); RNA_def_property_range(prop, 0, 360); RNA_def_property_float_funcs(prop, "rna_TextureSlot_angle_get", "rna_TextureSlot_angle_set", NULL); RNA_def_property_ui_text(prop, "Angle", "Defines brush texture rotation."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); prop= RNA_def_property(srna, "brush_map_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_map_mode_items); @@ -461,26 +495,26 @@ static void rna_def_mtex(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "def_var"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Default Value", "Value to use for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); prop= RNA_def_property(srna, "variable_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "varfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Variable Factor", "Amount texture affects other values."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); prop= RNA_def_property(srna, "normal_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "norfac"); RNA_def_property_ui_range(prop, 0, 5, 10, 3); RNA_def_property_ui_text(prop, "Normal Factor", "Amount texture affects normal values."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); prop= RNA_def_property(srna, "output_node", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "which_output"); RNA_def_property_enum_items(prop, output_node_items); RNA_def_property_enum_funcs(prop, "rna_TextureSlot_output_node_get", NULL, "rna_TextureSlot_output_node_itemf"); RNA_def_property_ui_text(prop, "Output Node", "Which output node to use, for node-based textures."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); } static void rna_def_filter_size_common(StructRNA *srna) @@ -491,14 +525,14 @@ static void rna_def_filter_size_common(StructRNA *srna) prop= RNA_def_property(srna, "use_filter", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_FILTER_MIN); RNA_def_property_ui_text(prop, "Use Filter", "Use Filter Size as a minimal filter value in pixels"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "filtersize"); RNA_def_property_range(prop, 0.1, 50.0); RNA_def_property_ui_range(prop, 0.1, 50.0, 1, 0.2); RNA_def_property_ui_text(prop, "Filter Size", "Multiplies the filter size used by MIP Map and Interpolation"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); } static void rna_def_environment_map_common(StructRNA *srna) @@ -515,14 +549,14 @@ static void rna_def_environment_map_common(StructRNA *srna) RNA_def_property_enum_sdna(prop, NULL, "stype"); RNA_def_property_enum_items(prop, prop_source_items); RNA_def_property_ui_text(prop, "Source", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); /* XXX: move this to specific types if needed */ prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "ima"); RNA_def_property_struct_type(prop, "Image"); RNA_def_property_ui_text(prop, "Image", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); } static void rna_def_environment_map(BlenderRNA *brna) @@ -545,28 +579,28 @@ static void rna_def_environment_map(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "Type", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "clipsta"); RNA_def_property_range(prop, 0.01, FLT_MAX); RNA_def_property_ui_range(prop, 0.01, 50, 100, 2); RNA_def_property_ui_text(prop, "Clip Start", "Objects nearer than this are not visible to map."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "clipend"); RNA_def_property_range(prop, 0.01, FLT_MAX); RNA_def_property_ui_range(prop, 0.10, 20000, 100, 2); RNA_def_property_ui_text(prop, "Clip End", "Objects further than this are not visible to map."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "viewscale"); RNA_def_property_range(prop, 0.01, FLT_MAX); RNA_def_property_ui_range(prop, 0.5, 5, 100, 2); RNA_def_property_ui_text(prop, "Zoom", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); /* XXX: EnvMap.notlay */ @@ -574,12 +608,12 @@ static void rna_def_environment_map(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "cuberes"); RNA_def_property_range(prop, 50, 4096); RNA_def_property_ui_text(prop, "Resolution", "Pixel resolution of the rendered environment map."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 0, 5); RNA_def_property_ui_text(prop, "Depth", "Number of times a map will be rendered recursively (mirror effects.)"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); } static EnumPropertyItem prop_noise_basis_items[] = { @@ -620,38 +654,38 @@ static void rna_def_texture_clouds(BlenderRNA *brna) RNA_def_property_range(prop, 0.0001, FLT_MAX); RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2); RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "noisedepth"); RNA_def_property_range(prop, 0, INT_MAX); RNA_def_property_ui_range(prop, 0, 6, 0, 2); RNA_def_property_ui_text(prop, "Noise Depth", "Sets the depth of the cloud calculation"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noisebasis"); RNA_def_property_enum_items(prop, prop_noise_basis_items); RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noisetype"); RNA_def_property_enum_items(prop, prop_noise_type); RNA_def_property_ui_text(prop, "Noise Type", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "stype"); RNA_def_property_enum_items(prop, prop_clouds_stype); RNA_def_property_ui_text(prop, "Color", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.001, 0.1); RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2); RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); } static void rna_def_texture_wood(BlenderRNA *brna) @@ -681,44 +715,44 @@ static void rna_def_texture_wood(BlenderRNA *brna) RNA_def_property_range(prop, 0.0001, FLT_MAX); RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2); RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "turbul"); RNA_def_property_range(prop, 0.0001, FLT_MAX); RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2); RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noisebasis"); RNA_def_property_enum_items(prop, prop_noise_basis_items); RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noisetype"); RNA_def_property_enum_items(prop, prop_noise_type); RNA_def_property_ui_text(prop, "Noise Type", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "stype"); RNA_def_property_enum_items(prop, prop_wood_stype); RNA_def_property_ui_text(prop, "Pattern", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noisebasis2", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noisebasis2"); RNA_def_property_enum_items(prop, prop_wood_noisebasis2); RNA_def_property_ui_text(prop, "Noise Basis 2", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.001, 0.1); RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2); RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); } @@ -748,51 +782,51 @@ static void rna_def_texture_marble(BlenderRNA *brna) RNA_def_property_range(prop, 0.0001, FLT_MAX); RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2); RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "turbul"); RNA_def_property_range(prop, 0.0001, FLT_MAX); RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2); RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "noisedepth"); RNA_def_property_range(prop, 0, INT_MAX); RNA_def_property_ui_range(prop, 0, 6, 0, 2); RNA_def_property_ui_text(prop, "Noise Depth", "Sets the depth of the cloud calculation"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noisetype"); RNA_def_property_enum_items(prop, prop_noise_type); RNA_def_property_ui_text(prop, "Noise Type", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "stype"); RNA_def_property_enum_items(prop, prop_marble_stype); RNA_def_property_ui_text(prop, "Pattern", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noisebasis"); RNA_def_property_enum_items(prop, prop_noise_basis_items); RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noisebasis2", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noisebasis2"); RNA_def_property_enum_items(prop, prop_marble_noisebasis2); RNA_def_property_ui_text(prop, "Noise Basis 2", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.001, 0.1); RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2); RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); } @@ -810,14 +844,14 @@ static void rna_def_texture_magic(BlenderRNA *brna) RNA_def_property_range(prop, 0.0001, FLT_MAX); RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2); RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "noisedepth"); RNA_def_property_range(prop, 0, INT_MAX); RNA_def_property_ui_range(prop, 0, 6, 0, 2); RNA_def_property_ui_text(prop, "Noise Depth", "Sets the depth of the cloud calculation"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); } static void rna_def_texture_blend(BlenderRNA *brna) @@ -848,13 +882,13 @@ static void rna_def_texture_blend(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "stype"); RNA_def_property_enum_items(prop, prop_blend_progression); RNA_def_property_ui_text(prop, "Progression", "Sets the style of the color blending"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "flip_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, prop_flip_axis_items); RNA_def_property_ui_text(prop, "Flip Axis", "Flips the texture's X and Y axis"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); } @@ -878,32 +912,32 @@ static void rna_def_texture_stucci(BlenderRNA *brna) RNA_def_property_range(prop, 0.0001, FLT_MAX); RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2); RNA_def_property_ui_text(prop, "Turbulence", "Sets the turbulence of the bandnoise and ringnoise types"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noisebasis"); RNA_def_property_enum_items(prop, prop_noise_basis_items); RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "noisesize"); RNA_def_property_range(prop, 0.0001, FLT_MAX); RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2); RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noisetype"); RNA_def_property_enum_items(prop, prop_noise_type); RNA_def_property_ui_text(prop, "Noise Type", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "stype", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "stype"); RNA_def_property_enum_items(prop, prop_stucci_stype); RNA_def_property_ui_text(prop, "Pattern", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); } static void rna_def_texture_noise(BlenderRNA *brna) @@ -936,45 +970,45 @@ static void rna_def_texture_image(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_MIPMAP); RNA_def_property_boolean_funcs(prop, NULL, "rna_ImageTexture_mipmap_set"); RNA_def_property_ui_text(prop, "MIP Map", "Uses auto-generated MIP maps for the image"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "mipmap_gauss", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_GAUSS_MIP); RNA_def_property_ui_text(prop, "MIP Map Gauss", "Uses Gauss filter to sample down MIP maps"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "interpolation", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_INTERPOL); RNA_def_property_ui_text(prop, "Interpolation", "Interpolates pixels using Area filter"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); /* XXX: I think flip_axis should be a generic Texture property, enabled for all the texture types */ prop= RNA_def_property(srna, "flip_axis", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_IMAROT); RNA_def_property_ui_text(prop, "Flip Axis", "Flips the texture's X and Y axis"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_USEALPHA); RNA_def_property_ui_text(prop, "Use Alpha", "Uses the alpha channel information in the image"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "calculate_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_CALCALPHA); RNA_def_property_ui_text(prop, "Calculate Alpha", "Calculates an alpha channel based on RGB values in the image"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "invert_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_NEGALPHA); RNA_def_property_ui_text(prop, "Invert Alpha", "Inverts all the alpha values in the image"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); rna_def_filter_size_common(srna); prop= RNA_def_property(srna, "normal_map", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_NORMALMAP); RNA_def_property_ui_text(prop, "Normal Map", "Uses image RGB values for normal mapping"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); /* XXX: mtex->normapspace "Sets space of normal map image" "Normal Space %t|Camera %x0|World %x1|Object %x2|Tangent %x3" * not sure why this goes in mtex instead of texture directly? */ @@ -983,46 +1017,46 @@ static void rna_def_texture_image(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "extend"); RNA_def_property_enum_items(prop, prop_image_extension); RNA_def_property_ui_text(prop, "Extension", "Sets how the image is stretched in the texture"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "repeat_x", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "xrepeat"); RNA_def_property_range(prop, 1, 512); RNA_def_property_ui_text(prop, "Repeat X", "Sets a repetition multiplier in the X direction"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "repeat_y", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "yrepeat"); RNA_def_property_range(prop, 1, 512); RNA_def_property_ui_text(prop, "Repeat Y", "Sets a repetition multiplier in the Y direction"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "mirror_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_REPEAT_XMIR); RNA_def_property_ui_text(prop, "Mirror X", "Mirrors the image repetition on the X direction"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "mirror_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_REPEAT_YMIR); RNA_def_property_ui_text(prop, "Mirror Y", "Mirrors the image repetition on the Y direction"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "checker_odd", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_CHECKER_ODD); RNA_def_property_ui_text(prop, "Checker Odd", "Sets odd checker tiles"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "checker_even", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_CHECKER_EVEN); RNA_def_property_ui_text(prop, "Checker Even", "Sets even checker tiles"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "checker_distance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "checkerdist"); RNA_def_property_range(prop, 0.0, 0.99); RNA_def_property_ui_range(prop, 0.0, 0.99, 0.1, 0.01); RNA_def_property_ui_text(prop, "Checker Distance", "Sets distance between checker tiles"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); #if 0 @@ -1034,7 +1068,7 @@ static void rna_def_texture_image(BlenderRNA *brna) RNA_def_property_array(prop, 4); RNA_def_property_range(prop, -10, 10); RNA_def_property_ui_text(prop, "Crop Rectangle", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); #endif @@ -1043,40 +1077,40 @@ static void rna_def_texture_image(BlenderRNA *brna) RNA_def_property_range(prop, -10.0, 10.0); RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2); RNA_def_property_ui_text(prop, "Crop Minimum X", "Sets minimum X value to crop the image"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "crop_min_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "cropymin"); RNA_def_property_range(prop, -10.0, 10.0); RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2); RNA_def_property_ui_text(prop, "Crop Minimum Y", "Sets minimum Y value to crop the image"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "crop_max_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "cropxmax"); RNA_def_property_range(prop, -10.0, 10.0); RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2); RNA_def_property_ui_text(prop, "Crop Maximum X", "Sets maximum X value to crop the image"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "crop_max_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "cropymax"); RNA_def_property_range(prop, -10.0, 10.0); RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2); RNA_def_property_ui_text(prop, "Crop Maximum Y", "Sets maximum Y value to crop the image"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "ima"); RNA_def_property_struct_type(prop, "Image"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Image", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "iuser"); RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); /* filtering */ prop= RNA_def_property(srna, "filter", PROP_ENUM, PROP_NONE); @@ -1084,19 +1118,19 @@ static void rna_def_texture_image(BlenderRNA *brna) RNA_def_property_enum_items(prop, texture_filter_items); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_ImageTexture_filter_itemf"); RNA_def_property_ui_text(prop, "Filter", "Texture filter to use for sampling image."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "filter_probes", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "afmax"); RNA_def_property_range(prop, 1, 256); RNA_def_property_ui_text(prop, "Filter Probes", "Maximum number of samples. Higher gives less blur at distant/oblique angles, but is also slower."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "filter_eccentricity", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "afmax"); RNA_def_property_range(prop, 1, 256); RNA_def_property_ui_text(prop, "Filter Eccentricity", "Maximum eccentricity. Higher gives less blur at distant/oblique angles, but is also slower."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); } static void rna_def_texture_plugin(BlenderRNA *brna) @@ -1124,13 +1158,13 @@ static void rna_def_texture_environment_map(BlenderRNA *brna) prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "iuser"); RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "environment_map", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "env"); RNA_def_property_struct_type(prop, "EnvironmentMap"); RNA_def_property_ui_text(prop, "Environment Map", "Gets the environment map associated with this texture"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); rna_def_filter_size_common(srna); } @@ -1156,62 +1190,62 @@ static void rna_def_texture_musgrave(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "stype"); RNA_def_property_enum_items(prop, prop_musgrave_type); RNA_def_property_ui_text(prop, "Type", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "highest_dimension", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "mg_H"); RNA_def_property_range(prop, 0.0001, 2); RNA_def_property_ui_text(prop, "Highest Dimension", "Highest fractal dimension"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "lacunarity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "mg_lacunarity"); RNA_def_property_range(prop, 0, 6); RNA_def_property_ui_text(prop, "Lacunarity", "Gap between succesive frequencies"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "octaves", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "mg_octaves"); RNA_def_property_range(prop, 0, 8); RNA_def_property_ui_text(prop, "Octaves", "Number of frequencies used"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "mg_offset"); RNA_def_property_range(prop, 0, 6); RNA_def_property_ui_text(prop, "Offset", "The fractal offset"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "gain", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "mg_gain"); RNA_def_property_range(prop, 0, 6); RNA_def_property_ui_text(prop, "Gain", "The gain multiplier"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_intensity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ns_outscale"); RNA_def_property_range(prop, 0, 10); RNA_def_property_ui_text(prop, "Noise Intensity", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "noisesize"); RNA_def_property_range(prop, 0.0001, FLT_MAX); RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2); RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noisebasis"); RNA_def_property_enum_items(prop, prop_noise_basis_items); RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.001, 0.1); RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2); RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); } static void rna_def_texture_voronoi(BlenderRNA *brna) @@ -1245,62 +1279,62 @@ static void rna_def_texture_voronoi(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "vn_w1"); RNA_def_property_range(prop, -2, 2); RNA_def_property_ui_text(prop, "Weight 1", "Voronoi feature weight 1"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "weight_2", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "vn_w2"); RNA_def_property_range(prop, -2, 2); RNA_def_property_ui_text(prop, "Weight 2", "Voronoi feature weight 2"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "weight_3", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "vn_w3"); RNA_def_property_range(prop, -2, 2); RNA_def_property_ui_text(prop, "Weight 3", "Voronoi feature weight 3"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "weight_4", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "vn_w4"); RNA_def_property_range(prop, -2, 2); RNA_def_property_ui_text(prop, "Weight 4", "Voronoi feature weight 4"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "minkovsky_exponent", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "vn_mexp"); RNA_def_property_range(prop, 0.01, 10); RNA_def_property_ui_text(prop, "Minkovsky Exponent", "Minkovsky exponent"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "distance_metric", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "vn_distm"); RNA_def_property_enum_items(prop, prop_distance_metric_items); RNA_def_property_ui_text(prop, "Distance Metric", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "coloring", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "vn_coltype"); RNA_def_property_enum_items(prop, prop_coloring_items); RNA_def_property_ui_text(prop, "Coloring", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_intensity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ns_outscale"); RNA_def_property_range(prop, 0.01, 10); RNA_def_property_ui_text(prop, "Noise Intensity", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "noisesize"); RNA_def_property_range(prop, 0.0001, FLT_MAX); RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2); RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.001, 0.1); RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2); RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); } static void rna_def_texture_distorted_noise(BlenderRNA *brna) @@ -1316,32 +1350,32 @@ static void rna_def_texture_distorted_noise(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "dist_amount"); RNA_def_property_range(prop, 0, 10); RNA_def_property_ui_text(prop, "Distortion Amount", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "noisesize"); RNA_def_property_range(prop, 0.0001, FLT_MAX); RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2); RNA_def_property_ui_text(prop, "Noise Size", "Sets scaling for noise input"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noisebasis2"); RNA_def_property_enum_items(prop, prop_noise_basis_items); RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_distortion", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noisebasis"); RNA_def_property_enum_items(prop, prop_noise_basis_items); RNA_def_property_ui_text(prop, "Noise Distortion", "Sets the noise basis for the distortion"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.001, 0.1); RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2); RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); } static void rna_def_texture_pointdensity(BlenderRNA *brna) @@ -1397,104 +1431,104 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "source"); RNA_def_property_enum_items(prop, point_source_items); RNA_def_property_ui_text(prop, "Point Source", "Point data to use as renderable point density"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "object"); RNA_def_property_ui_text(prop, "Object", "Object to take point data from"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "psys"); RNA_def_property_ui_text(prop, "Particle System", "Particle System to render as points"); RNA_def_property_struct_type(prop, "ParticleSystem"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "particle_cache", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "psys_cache_space"); RNA_def_property_enum_items(prop, particle_cache_items); RNA_def_property_ui_text(prop, "Particle Cache", "Co-ordinate system to cache particles in"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "vertices_cache", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ob_cache_space"); RNA_def_property_enum_items(prop, vertice_cache_items); RNA_def_property_ui_text(prop, "Vertices Cache", "Co-ordinate system to cache vertices in"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "radius"); RNA_def_property_range(prop, 0.01, FLT_MAX); RNA_def_property_ui_text(prop, "Radius", "Radius from the shaded sample to look for points within"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "falloff_type"); RNA_def_property_enum_items(prop, falloff_items); RNA_def_property_ui_text(prop, "Falloff", "Method of attenuating density by distance from the point"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "falloff_softness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "falloff_softness"); RNA_def_property_range(prop, 0.01, FLT_MAX); RNA_def_property_ui_text(prop, "Softness", "Softness of the 'soft' falloff option"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "color_source", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "color_source"); RNA_def_property_enum_items(prop, color_source_items); RNA_def_property_ui_text(prop, "Color Source", "Data to derive color results from"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "speed_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "speed_scale"); RNA_def_property_range(prop, 0.001, 100.0); RNA_def_property_ui_text(prop, "Scale", "Multipler to bring particle speed within an acceptable range"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "coba"); RNA_def_property_struct_type(prop, "ColorRamp"); RNA_def_property_ui_text(prop, "Color Ramp", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); /* Turbulence */ prop= RNA_def_property(srna, "turbulence", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_PD_TURBULENCE); RNA_def_property_ui_text(prop, "Turbulence", "Add directed noise to the density at render-time"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "turbulence_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "noise_size"); RNA_def_property_range(prop, 0.01, FLT_MAX); RNA_def_property_ui_text(prop, "Size", "Scale of the added turbulent noise"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "turbulence_strength", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "noise_fac"); RNA_def_property_range(prop, 0.01, FLT_MAX); RNA_def_property_ui_text(prop, "Strength", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "turbulence_depth", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "noise_depth"); RNA_def_property_range(prop, 0, INT_MAX); RNA_def_property_ui_text(prop, "Depth", "Level of detail in the added turbulent noise"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "turbulence_influence", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noise_influence"); RNA_def_property_enum_items(prop, turbulence_influence_items); RNA_def_property_ui_text(prop, "Turbulence Influence", "Method for driving added turbulent noise"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noise_basis"); RNA_def_property_enum_items(prop, prop_noise_basis_items); RNA_def_property_ui_text(prop, "Noise Basis", "Noise formula used for tubulence"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); srna= RNA_def_struct(brna, "PointDensityTexture", "Texture"); @@ -1505,7 +1539,7 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "pd"); RNA_def_property_struct_type(prop, "PointDensity"); RNA_def_property_ui_text(prop, "Point Density", "The point density settings associated with this texture"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); } static void rna_def_texture_voxeldata(BlenderRNA *brna) @@ -1537,46 +1571,46 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "interp_type"); RNA_def_property_enum_items(prop, interpolation_type_items); RNA_def_property_ui_text(prop, "Interpolation", "Method to interpolate/smooth values between voxel cells"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "int_multiplier"); RNA_def_property_range(prop, 0.01, FLT_MAX); RNA_def_property_ui_text(prop, "Intensity", "Multiplier for intensity values"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "file_format"); RNA_def_property_enum_items(prop, file_format_items); RNA_def_property_ui_text(prop, "File Format", "Format of the source data set to render "); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "source_path", PROP_STRING, PROP_FILEPATH); RNA_def_property_string_sdna(prop, NULL, "source_path"); RNA_def_property_ui_text(prop, "Source Path", "The external source data file to use"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "resol"); RNA_def_property_ui_text(prop, "Resolution", "Resolution of the voxel grid."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "still", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_VD_STILL); RNA_def_property_ui_text(prop, "Still Frame Only", "Always render a still frame from the voxel data sequence"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "still_frame_number", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "still_frame"); RNA_def_property_range(prop, 0, INT_MAX); RNA_def_property_ui_text(prop, "Still Frame Number", "The frame number to always use"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "domain_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "object"); RNA_def_property_ui_text(prop, "Domain Object", "Object used as the smoke simulation domain"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); srna= RNA_def_struct(brna, "VoxelDataTexture", "Texture"); @@ -1587,7 +1621,7 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "vd"); RNA_def_property_struct_type(prop, "VoxelData"); RNA_def_property_ui_text(prop, "Voxel Data", "The voxel data associated with this texture"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); } static void rna_def_texture(BlenderRNA *brna) @@ -1626,49 +1660,49 @@ static void rna_def_texture(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_enum_funcs(prop, NULL, "rna_Texture_type_set", NULL); RNA_def_property_ui_text(prop, "Type", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "use_color_ramp", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_COLORBAND); RNA_def_property_boolean_funcs(prop, NULL, "rna_Texture_use_color_ramp_set"); RNA_def_property_ui_text(prop, "Use Color Ramp", "Toggle color ramp operations."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "coba"); RNA_def_property_struct_type(prop, "ColorRamp"); RNA_def_property_ui_text(prop, "Color Ramp", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "brightness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "bright"); RNA_def_property_range(prop, 0, 2); RNA_def_property_ui_text(prop, "Brightness", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.01, 5); RNA_def_property_ui_text(prop, "Contrast", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "rgb_factor", PROP_FLOAT, PROP_RGB); RNA_def_property_float_sdna(prop, NULL, "rfac"); RNA_def_property_array(prop, 3); RNA_def_property_range(prop, 0, 2); RNA_def_property_ui_text(prop, "RGB Factor", ""); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); /* nodetree */ prop= RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1); RNA_def_property_boolean_funcs(prop, NULL, "rna_Texture_use_nodes_set"); RNA_def_property_ui_text(prop, "Use Nodes", "Make this a node-based texture"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); prop= RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "nodetree"); RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node-based textures"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_Texture_update"); rna_def_animdata_common(srna); diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c index c6068d0a650..0cbbe28967f 100644 --- a/source/blender/makesrna/intern/rna_world.c +++ b/source/blender/makesrna/intern/rna_world.c @@ -34,14 +34,17 @@ #include "DNA_texture_types.h" #include "DNA_world_types.h" -#include "WM_types.h" - #ifdef RNA_RUNTIME #include "MEM_guardedalloc.h" +#include "BKE_depsgraph.h" +#include "BKE_main.h" #include "BKE_texture.h" +#include "WM_api.h" +#include "WM_types.h" + static PointerRNA rna_World_ambient_occlusion_get(PointerRNA *ptr) { return rna_pointer_inherit_refine(ptr, &RNA_WorldAmbientOcclusion, ptr->id.data); @@ -95,6 +98,22 @@ static void rna_World_active_texture_set(PointerRNA *ptr, PointerRNA value) } } +static void rna_World_update(bContext *C, PointerRNA *ptr) +{ + World *wo= ptr->id.data; + + DAG_id_flush_update(&wo->id, 0); + WM_event_add_notifier(C, NC_WORLD, wo); +} + +static void rna_World_draw_update(bContext *C, PointerRNA *ptr) +{ + World *wo= ptr->id.data; + + DAG_id_flush_update(&wo->id, 0); + WM_event_add_notifier(C, NC_WORLD|ND_WORLD_DRAW, wo); +} + #else static void rna_def_world_mtex(BlenderRNA *brna) @@ -119,22 +138,22 @@ static void rna_def_world_mtex(BlenderRNA *brna) prop= RNA_def_property(srna, "map_blend", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_BLEND); RNA_def_property_ui_text(prop, "Blend", "Affect the color progression of the background."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "map_horizon", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_HORIZ); RNA_def_property_ui_text(prop, "Horizon", "Affect the color of the horizon."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "map_zenith_up", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_ZENUP); RNA_def_property_ui_text(prop, "Zenith Up", "Affect the color of the zenith above."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "map_zenith_down", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_ZENDOWN); RNA_def_property_ui_text(prop, "Zenith Down", "Affect the color of the zenith below."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_World_update"); /* unused prop= RNA_def_property(srna, "map_mist", PROP_BOOLEAN, PROP_NONE); @@ -145,38 +164,38 @@ static void rna_def_world_mtex(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "texco"); RNA_def_property_enum_items(prop, texco_items); RNA_def_property_ui_text(prop, "Texture Coordinates", "Texture coordinates used to map the texture onto the background."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "object"); RNA_def_property_struct_type(prop, "Object"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Object", "Object to use for mapping with Object texture coordinates."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "blend_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "varfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Blend Factor", "Amount texture affects color progression of the background."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "horizon_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "colfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Horizon Factor", "Amount texture affects color of the horizon."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "zenith_up_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "colfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Zenith Up Factor", "Amount texture affects color of the zenith above."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "zenith_down_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "colfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Zenith Down Factor", "Amount texture affects color of the zenith below."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); + RNA_def_property_update(prop, 0, "rna_World_update"); } static void rna_def_ambient_occlusion(BlenderRNA *brna) @@ -215,83 +234,100 @@ static void rna_def_ambient_occlusion(BlenderRNA *brna) prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_AMB_OCC); RNA_def_property_ui_text(prop, "Enabled", "Use Ambient Occlusion to add light based on distance between elements, creating the illusion of omnipresent light"); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "aodist"); RNA_def_property_ui_text(prop, "Distance", "Length of rays, defines how far away other faces give occlusion effect."); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "falloff_strength", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "aodistfac"); RNA_def_property_ui_text(prop, "Strength", "Distance attenuation factor, the higher, the 'shorter' the shadows."); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "energy", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "aoenergy"); RNA_def_property_ui_range(prop, 0, 10, 0.1, 3); RNA_def_property_ui_text(prop, "Energy", "Amount of enerygy generated by ambient occlusion."); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "bias", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "aobias"); RNA_def_property_range(prop, 0, 0.5); RNA_def_property_ui_text(prop, "Bias", "Bias (in radians) to prevent smoothed faces from showing banding (for Raytrace Constant Jittered)."); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ao_adapt_thresh"); RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_text(prop, "Threshold", "Samples below this threshold will be considered fully shadowed/unshadowed and skipped (for Raytrace Adaptive QMC)."); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "adapt_to_speed", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ao_adapt_speed_fac"); RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_text(prop, "Adapt To Speed", "Use the speed vector pass to reduce AO samples in fast moving pixels. Higher values result in more aggressive sample reduction. Requires Vec pass enabled (for Raytrace Adaptive QMC)."); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "error_tolerance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ao_approx_error"); RNA_def_property_range(prop, 0.0001, 10); RNA_def_property_ui_text(prop, "Error Tolerance", "Low values are slower and higher quality (for Approximate)."); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "correction", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ao_approx_correction"); RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_range(prop, 0, 1, 0.1, 2); RNA_def_property_ui_text(prop, "Correction", "Ad-hoc correction for over-occlusion due to the approximation (for Approximate)."); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "falloff", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "aomode", WO_AODIST); RNA_def_property_ui_text(prop, "Falloff", ""); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "pixel_cache", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "aomode", WO_AOCACHE); RNA_def_property_ui_text(prop, "Pixel Cache", "Cache AO results in pixels and interpolate over neighbouring pixels for speedup (for Approximate)."); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "samples", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "aosamp"); RNA_def_property_range(prop, 1, 32); RNA_def_property_ui_text(prop, "Samples", "Amount of ray samples. Higher values give smoother results and longer rendering times"); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "blend_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "aomix"); RNA_def_property_enum_items(prop, blend_mode_items); RNA_def_property_ui_text(prop, "Blend Mode", "Defines how AO mixes with material shading."); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "color", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "aocolor"); RNA_def_property_enum_items(prop, prop_color_items); RNA_def_property_ui_text(prop, "Color", "Defines the color of the AO light"); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "sample_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ao_samp_method"); RNA_def_property_enum_items(prop, prop_sample_method_items); RNA_def_property_ui_text(prop, "Sample Method", "Method for generating shadow samples (for Raytrace)."); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "gather_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ao_gather_method"); RNA_def_property_enum_items(prop, prop_gather_method_items); RNA_def_property_ui_text(prop, "Gather Method", ""); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "passes", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ao_approx_passes"); RNA_def_property_range(prop, 0, 10); RNA_def_property_ui_text(prop, "Passes", "Number of preprocessing passes to reduce overocclusion (for Approximate)."); + RNA_def_property_update(prop, 0, "rna_World_update"); } static void rna_def_world_mist(BlenderRNA *brna) @@ -313,35 +349,39 @@ static void rna_def_world_mist(BlenderRNA *brna) prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_MIST); RNA_def_property_ui_text(prop, "Enabled", "Occlude objects with the environment color as they are further away."); + RNA_def_property_update(prop, 0, "rna_World_draw_update"); prop= RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "misi"); RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_text(prop, "Intensity", "Intensity of the mist effect."); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "start", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "miststa"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 10000, 10, 2); RNA_def_property_ui_text(prop, "Start", "Starting distance of the mist, measured from the camera"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_World_draw_update"); prop= RNA_def_property(srna, "depth", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "mistdist"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 10000, 10, 2); RNA_def_property_ui_text(prop, "Depth", "The distance over which the mist effect fades in"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, 0, "rna_World_draw_update"); prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "misthi"); RNA_def_property_range(prop, 0, 100); RNA_def_property_ui_text(prop, "Height", "Control how much mist density decreases with height"); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "mistype"); RNA_def_property_enum_items(prop, falloff_items); RNA_def_property_ui_text(prop, "Falloff", "Type of transition used to fade mist"); + RNA_def_property_update(prop, 0, "rna_World_update"); } static void rna_def_world_stars(BlenderRNA *brna) @@ -357,37 +397,38 @@ static void rna_def_world_stars(BlenderRNA *brna) prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_STARS); RNA_def_property_ui_text(prop, "Enabled", "Enable starfield generation."); - RNA_def_property_update(prop, NC_WORLD, NULL); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "starsize"); RNA_def_property_range(prop, 0, 10); RNA_def_property_ui_text(prop, "Size", "Average screen dimension of stars."); - RNA_def_property_update(prop, NC_WORLD, NULL); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "min_distance", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "starmindist"); RNA_def_property_range(prop, 0, 1000); RNA_def_property_ui_text(prop, "Minimum Distance", "Minimum distance to the camera for stars."); - RNA_def_property_update(prop, NC_WORLD, NULL); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "average_separation", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "stardist"); RNA_def_property_range(prop, 2, 1000); RNA_def_property_ui_text(prop, "Average Separation", "Average distance between any two stars."); - RNA_def_property_update(prop, NC_WORLD, NULL); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "color_randomization", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "starcolnoise"); RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_text(prop, "Color Randomization", "Randomize star colors."); - RNA_def_property_update(prop, NC_WORLD, NULL); + RNA_def_property_update(prop, 0, "rna_World_update"); /* unused prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "starr"); RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Color", "Stars color.");*/ + RNA_def_property_ui_text(prop, "Color", "Stars color."); + RNA_def_property_update(prop, 0, "rna_World_update");*/ } void RNA_def_world(BlenderRNA *brna) @@ -412,53 +453,55 @@ void RNA_def_world(BlenderRNA *brna) rna_def_animdata_common(srna); rna_def_mtex_common(srna, "rna_World_mtex_begin", "rna_World_active_texture_get", - "rna_World_active_texture_set", "WorldTextureSlot"); + "rna_World_active_texture_set", "WorldTextureSlot", "rna_World_update"); /* colors */ prop= RNA_def_property(srna, "horizon_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "horr"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Horizon Color", "Color at the horizon."); - RNA_def_property_update(prop, NC_WORLD, NULL); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "zenith_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "zenr"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Zenith Color", "Color at the zenith."); - RNA_def_property_update(prop, NC_WORLD, NULL); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "ambient_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "ambr"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Ambient Color", ""); - RNA_def_property_update(prop, NC_WORLD, NULL); + RNA_def_property_update(prop, 0, "rna_World_update"); /* exp, range */ prop= RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "exp"); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Exposure", "Amount of exponential color correction for light."); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "range"); RNA_def_property_range(prop, 0.2, 5.0); RNA_def_property_ui_text(prop, "Range", "The color range that will be mapped to 0-1."); + RNA_def_property_update(prop, 0, "rna_World_update"); /* sky type */ prop= RNA_def_property(srna, "blend_sky", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYBLEND); RNA_def_property_ui_text(prop, "Blend Sky", "Render background with natural progression from horizon to zenith."); - RNA_def_property_update(prop, NC_WORLD, NULL); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "paper_sky", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYPAPER); RNA_def_property_ui_text(prop, "Paper Sky", "Flatten blend or texture coordinates."); - RNA_def_property_update(prop, NC_WORLD, NULL); + RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "real_sky", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYREAL); RNA_def_property_ui_text(prop, "Real Sky", "Render background with a real horizon, relative to the camera angle."); - RNA_def_property_update(prop, NC_WORLD, NULL); + RNA_def_property_update(prop, 0, "rna_World_update"); /* nested structs */ prop= RNA_def_property(srna, "ambient_occlusion", PROP_POINTER, PROP_NONE); |