diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-15 11:53:35 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-15 11:53:35 +0300 |
commit | df9bedddcfd1cc4888eeafb71586830e95d03ebc (patch) | |
tree | 21f62e1897223661c08e54d839e21bf182a570e3 /source/blender | |
parent | 4661fb03a9f5836abb3a2eeb3cc2b67b2d4ecc81 (diff) |
bugfix [#24708] World Notifier Problems
also draw stars when 'Only Render' option is enabled.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_view3d/space_view3d.c | 7 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 23 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_world.c | 19 | ||||
-rw-r--r-- | source/blender/windowmanager/WM_types.h | 1 |
4 files changed, 35 insertions, 15 deletions
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index f5c1612f786..612f2b4af48 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -654,6 +654,13 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn) case ND_WORLD_DRAW: /* handled by space_view3d_listener() for v3d access */ break; + case ND_WORLD_STARS: + { + RegionView3D *rv3d= ar->regiondata; + if(rv3d->persp == RV3D_CAMOB) { + ED_region_tag_redraw(ar); + } + } } break; case NC_LAMP: diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index d21a0ac6721..2bdba27a237 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2332,22 +2332,25 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) // needs to be done always, gridview is adjusted in drawgrid() now rv3d->gridview= v3d->grid; - - if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) { - if(rv3d->view==0 || rv3d->persp != RV3D_ORTHO) { + if(rv3d->view==0 || rv3d->persp != RV3D_ORTHO) { + if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) { drawfloor(scene, v3d); - if(rv3d->persp==RV3D_CAMOB) { - if(scene->world) { - if(scene->world->mode & WO_STARS) { - RE_make_stars(NULL, scene, star_stuff_init_func, star_stuff_vertex_func, - star_stuff_term_func); - } + } + if(rv3d->persp==RV3D_CAMOB) { + if(scene->world) { + if(scene->world->mode & WO_STARS) { + RE_make_stars(NULL, scene, star_stuff_init_func, star_stuff_vertex_func, + star_stuff_term_func); } + } + if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) { if(v3d->flag & V3D_DISPBGPICS) draw_bgpic(scene, ar, v3d); } } - else { + } + else { + if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) { ED_region_pixelspace(ar); drawgrid(&scene->unit, ar, v3d, &grid_unit); /* XXX make function? replaces persp(1) */ diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c index 726d64f26f4..5807143f3a3 100644 --- a/source/blender/makesrna/intern/rna_world.c +++ b/source/blender/makesrna/intern/rna_world.c @@ -98,6 +98,15 @@ static void rna_World_draw_update(Main *bmain, Scene *scene, PointerRNA *ptr) WM_main_add_notifier(NC_WORLD|ND_WORLD_DRAW, wo); } +static void rna_World_stars_update(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + World *wo= ptr->id.data; + + DAG_id_flush_update(&wo->id, 0); + WM_main_add_notifier(NC_WORLD|ND_WORLD_STARS, wo); +} + + #else static void rna_def_world_mtex(BlenderRNA *brna) @@ -414,31 +423,31 @@ static void rna_def_world_stars(BlenderRNA *brna) prop= RNA_def_property(srna, "use_stars", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_STARS); RNA_def_property_ui_text(prop, "Use Stars", "Enable starfield generation"); - RNA_def_property_update(prop, 0, "rna_World_draw_update"); + RNA_def_property_update(prop, 0, "rna_World_stars_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, 0, "rna_World_update"); + RNA_def_property_update(prop, 0, "rna_World_draw_update"); /* use normal update since this isnt visualized */ prop= RNA_def_property(srna, "distance_min", 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, 0, "rna_World_update"); + RNA_def_property_update(prop, 0, "rna_World_stars_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, 0, "rna_World_draw_update"); + RNA_def_property_update(prop, 0, "rna_World_stars_update"); prop= RNA_def_property(srna, "color_random", 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, 0, "rna_World_update"); + RNA_def_property_update(prop, 0, "rna_World_stars_update"); /* unused prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 134e3890b16..cae875a9b06 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -219,6 +219,7 @@ typedef struct wmNotifier { /* NC_WORLD World */ #define ND_WORLD_DRAW (45<<16) +#define ND_WORLD_STARS (46<<16) /* NC_TEXT Text */ #define ND_CURSOR (50<<16) |