Allow explicit control over world background.

Previosuly, world was shown on the background if "Render Only" was used.
Now user should be able to set it independently. This is a prelude to
(drumroll)...
This commit is contained in:
Antonis Ryakiotakis 2014-11-24 14:29:09 +01:00
parent 08fd38cf52
commit fae3850293
4 changed files with 27 additions and 16 deletions

View File

@ -2813,6 +2813,7 @@ class VIEW3D_PT_view3d_display(Panel):
col = layout.column()
col.prop(view, "show_only_render")
col.prop(view, "show_world")
col = layout.column()
display_all = not view.show_only_render

View File

@ -3211,7 +3211,7 @@ static void view3d_main_area_draw_engine_info(View3D *v3d, RegionView3D *rv3d, A
static void view3d_main_area_clear(Scene *scene, View3D *v3d, ARegion *ar)
{
/* clear background */
if (scene->world && (v3d->flag2 & V3D_RENDER_OVERRIDE)) { /* clear with solid color */
if (scene->world && (v3d->flag3 & V3D_SHOW_WORLD)) { /* clear with solid color */
if (scene->world->skytype & WO_SKYBLEND) { /* blend sky */
int x, y;
float col_hor[3];

View File

@ -201,7 +201,9 @@ typedef struct View3D {
char gridflag;
/* transform widget info */
char twtype, twmode, twflag, pad2[2];
char twtype, twmode, twflag;
short flag3;
/* afterdraw, for xray & transparent */
struct ListBase afterdraw_transp;
@ -267,22 +269,25 @@ typedef struct View3D {
((view >= RV3D_VIEW_FRONT) && (view <= RV3D_VIEW_BOTTOM))
/* View3d->flag2 (short) */
#define V3D_RENDER_OVERRIDE 4
#define V3D_SOLID_TEX 8
#define V3D_SHOW_GPENCIL 16
#define V3D_LOCK_CAMERA 32
#define V3D_RENDER_SHADOW 64 /* This is a runtime only flag that's used to tell draw_mesh_object() that we're doing a shadow pass instead of a regular draw */
#define V3D_SHOW_RECONSTRUCTION 128
#define V3D_SHOW_CAMERAPATH 256
#define V3D_SHOW_BUNDLENAME 512
#define V3D_BACKFACE_CULLING 1024
#define V3D_RENDER_BORDER 2048
#define V3D_SOLID_MATCAP 4096 /* user flag */
#define V3D_SHOW_SOLID_MATCAP 8192 /* runtime flag */
#define V3D_OCCLUDE_WIRE 16384
#define V3D_SHADELESS_TEX 32768
#define V3D_RENDER_OVERRIDE (1 << 2)
#define V3D_SOLID_TEX (1 << 3)
#define V3D_SHOW_GPENCIL (1 << 4)
#define V3D_LOCK_CAMERA (1 << 5)
#define V3D_RENDER_SHADOW (1 << 6) /* This is a runtime only flag that's used to tell draw_mesh_object() that we're doing a shadow pass instead of a regular draw */
#define V3D_SHOW_RECONSTRUCTION (1 << 7)
#define V3D_SHOW_CAMERAPATH (1 << 8)
#define V3D_SHOW_BUNDLENAME (1 << 9)
#define V3D_BACKFACE_CULLING (1 << 10)
#define V3D_RENDER_BORDER (1 << 11)
#define V3D_SOLID_MATCAP (1 << 12) /* user flag */
#define V3D_SHOW_SOLID_MATCAP (1 << 13) /* runtime flag */
#define V3D_OCCLUDE_WIRE (1 << 14)
#define V3D_SHADELESS_TEX (1 << 15)
/* View3d->flag3 (short) */
#define V3D_SHOW_WORLD (1 << 0)
/* View3D->around */
#define V3D_CENTER 0
#define V3D_CENTROID 3

View File

@ -2041,6 +2041,11 @@ static void rna_def_space_view3d(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Only Render", "Display only objects which will be rendered");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
prop = RNA_def_property(srna, "show_world", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag3", V3D_SHOW_WORLD);
RNA_def_property_ui_text(prop, "World Background", "Display world colors in the background");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
prop = RNA_def_property(srna, "use_occlude_geometry", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_ZBUF_SELECT);
RNA_def_property_ui_text(prop, "Occlude Geometry", "Limit selection to visible (clipped with depth buffer)");