[Bf-blender-cvs] [8d53b72b812] blender2.8: World: Added 'Viewport Display' panel

Jeroen Bakker noreply at git.blender.org
Tue Jul 17 12:40:55 CEST 2018


Commit: 8d53b72b81212d9d87c71375d299af1dc535b487
Author: Jeroen Bakker
Date:   Tue Jul 17 12:35:45 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB8d53b72b81212d9d87c71375d299af1dc535b487

World: Added 'Viewport Display' panel

The Properties->World tab had no Viewport Display panel. The world color
itself was hidden when the 'use_node_tree' was enabled.

Also renamed the World.horizon_color to World.color as it has nothing to
do with the color of the horizon (old BI feature)

===================================================================

M	intern/cycles/blender/addon/ui.py
M	intern/cycles/blender/blender_shader.cpp
M	release/scripts/startup/bl_ui/properties_world.py
M	source/blender/makesrna/intern/rna_world.c

===================================================================

diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 6e56e42f9b2..3d5ed6b9b44 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -1227,7 +1227,7 @@ class CYCLES_WORLD_PT_surface(CyclesButtonsPanel, Panel):
         world = context.world
 
         if not panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Surface'):
-            layout.prop(world, "horizon_color", text="Color")
+            layout.prop(world, "color")
 
 
 class CYCLES_WORLD_PT_volume(CyclesButtonsPanel, Panel):
diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp
index 6129565fec5..b3dfe1f6800 100644
--- a/intern/cycles/blender/blender_shader.cpp
+++ b/intern/cycles/blender/blender_shader.cpp
@@ -1330,7 +1330,7 @@ void BlenderSync::sync_world(BL::Depsgraph& b_depsgraph, bool update_all)
 		}
 		else if(b_world) {
 			BackgroundNode *background = new BackgroundNode();
-			background->color = get_float3(b_world.horizon_color());
+			background->color = get_float3(b_world.color());
 			graph->add(background);
 
 			ShaderNode *out = graph->output();
diff --git a/release/scripts/startup/bl_ui/properties_world.py b/release/scripts/startup/bl_ui/properties_world.py
index b6ea8054b0c..ed1b17a911d 100644
--- a/release/scripts/startup/bl_ui/properties_world.py
+++ b/release/scripts/startup/bl_ui/properties_world.py
@@ -90,7 +90,6 @@ class WORLD_PT_custom_props(WorldButtonsPanel, PropertyPanel, Panel):
 
 class EEVEE_WORLD_PT_surface(WorldButtonsPanel, Panel):
     bl_label = "Surface"
-    bl_context = "world"
     COMPAT_ENGINES = {'BLENDER_EEVEE'}
 
     @classmethod
@@ -119,13 +118,29 @@ class EEVEE_WORLD_PT_surface(WorldButtonsPanel, Panel):
             else:
                 layout.label(text="No output node")
         else:
-            layout.prop(world, "horizon_color", text="Color")
+            layout.prop(world, "color")
+
+
+class WORLD_PT_viewport_display(WorldButtonsPanel, Panel):
+    bl_label = "Viewport Display"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    @classmethod
+    def poll(cls, context):
+        return context.world
+
+    def draw(self, context):
+        layout = self.layout
+        layout.use_property_split = True
+        world = context.world
+        layout.prop(world, "color")
 
 
 classes = (
     WORLD_PT_context_world,
     EEVEE_WORLD_PT_surface,
     EEVEE_WORLD_PT_mist,
+    WORLD_PT_viewport_display,
     WORLD_PT_custom_props,
 )
 
diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c
index ead67814f01..f4dc07cf6c3 100644
--- a/source/blender/makesrna/intern/rna_world.c
+++ b/source/blender/makesrna/intern/rna_world.c
@@ -207,10 +207,10 @@ void RNA_def_world(BlenderRNA *brna)
 	rna_def_animdata_common(srna);
 
 	/* colors */
-	prop = RNA_def_property(srna, "horizon_color", PROP_FLOAT, PROP_COLOR);
+	prop = RNA_def_property(srna, "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_ui_text(prop, "Color", "Color of the background");
 	/* RNA_def_property_update(prop, 0, "rna_World_update"); */
 	/* render-only uses this */
 	RNA_def_property_update(prop, 0, "rna_World_draw_update");



More information about the Bf-blender-cvs mailing list