[Bf-blender-cvs] [2948779839c] soc-2019-npr: LANPR: option to use the world background.

YimingWu noreply at git.blender.org
Mon Jul 8 08:30:11 CEST 2019


Commit: 2948779839c4154a794ab394aca9a94355c00816
Author: YimingWu
Date:   Mon Jul 8 14:29:31 2019 +0800
Branches: soc-2019-npr
https://developer.blender.org/rB2948779839c4154a794ab394aca9a94355c00816

LANPR: option to use the world background.

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

M	release/scripts/startup/bl_ui/properties_render.py
M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/makesdna/DNA_scene_types.h
M	source/blender/makesrna/intern/rna_scene.c

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

diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py
index 69074a20bec..ffbd6234c56 100644
--- a/release/scripts/startup/bl_ui/properties_render.py
+++ b/release/scripts/startup/bl_ui/properties_render.py
@@ -777,7 +777,13 @@ class RENDER_PT_lanpr(RenderButtonsPanel, Panel):
 
             layout.prop(lanpr, "disable_edge_splits")
             
-            layout.prop(lanpr, "background_color")
+            layout.label(text="Background Color:")
+            row = layout.row(align=True)
+            row.prop(lanpr,"use_world_background",toggle=True,icon='WORLD',text="Use World")
+            if(lanpr.use_world_background):
+                row.prop(scene.world, "color",text="")
+            else:
+                row.prop(lanpr, "background_color",text="")
             layout.prop(lanpr, "crease_threshold")
 
             if lanpr.master_mode == "DPIX" and len(lanpr.layers)==0:
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 3d1abcc0ed2..2a3821a653f 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -3534,6 +3534,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
       sce->lanpr.background_color[2] = 0.75;
       sce->lanpr.background_color[3] = 1;
 
+      sce->lanpr.use_world_background = 1;
+
       zero_v4(sce->lanpr.line_color);
 
       sce->lanpr.enable_intersections = 1;
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index f8f2031d7ae..cd58a9d9484 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -1670,6 +1670,8 @@ typedef struct SceneLANPR {
 
   float line_color[4];
   float background_color[4];
+  int use_world_background; /* color only */
+  char _pad1[4];
 
   float depth_width_influence;
   float depth_width_curve;
@@ -1692,7 +1694,7 @@ typedef struct SceneLANPR {
   char enable_intersections;
   char enable_chaining;
   char enable_chain_connection;
-  char _pad1;
+  char _pad2;
   float chaining_geometry_threshold;
   float chaining_image_threshold;
 
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index c1905b25038..2a2de2762c4 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -7367,6 +7367,11 @@ static void rna_def_scene_lanpr(BlenderRNA *brna)
   RNA_def_property_flag(prop, PROP_EDITABLE);
   RNA_def_property_update(prop, NC_SCENE, NULL);
 
+  prop = RNA_def_property(srna, "use_world_background", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_default(prop, 1);
+  RNA_def_property_ui_text(
+      prop, "Use World Background", "Use the background color set in the world panels");
+
   prop = RNA_def_property(srna, "crease_threshold", PROP_FLOAT, PROP_NONE);
   RNA_def_property_float_default(prop, 0.5f);
   RNA_def_property_ui_text(prop, "Crease Threshold", "cosine value of face angle");



More information about the Bf-blender-cvs mailing list