[Bf-blender-cvs] [013c6d6c382] soc-2019-npr: LANPR:Added option to use the same style for different line types

YimingWu noreply at git.blender.org
Tue Jun 18 10:23:42 CEST 2019


Commit: 013c6d6c38226176d095111449c9970a05003c20
Author: YimingWu
Date:   Tue Jun 18 15:53:21 2019 +0800
Branches: soc-2019-npr
https://developer.blender.org/rB013c6d6c38226176d095111449c9970a05003c20

LANPR:Added option to use the same style for different line types

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

M	release/scripts/startup/bl_ui/properties_render.py
M	source/blender/draw/engines/lanpr/lanpr_ops.c
M	source/blender/makesdna/DNA_lanpr_types.h
M	source/blender/makesrna/intern/rna_lanpr.c

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

diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py
index 6fa0d011c79..ad8b4b0743b 100644
--- a/release/scripts/startup/bl_ui/properties_render.py
+++ b/release/scripts/startup/bl_ui/properties_render.py
@@ -780,7 +780,7 @@ class RENDER_PT_lanpr(RenderButtonsPanel, Panel):
 
 
 class RENDER_PT_lanpr_line_types(RenderButtonsPanel, Panel):
-    bl_label = "Types"
+    bl_label = "Styles"
     bl_parent_id = "RENDER_PT_lanpr"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_LANPR', 'BLENDER_OPENGL', 'BLENDER_EEVEE'}
 
@@ -798,40 +798,52 @@ class RENDER_PT_lanpr_line_types(RenderButtonsPanel, Panel):
         active_layer = lanpr.layers.active_layer
         if active_layer and lanpr.master_mode == "DPIX":
             active_layer = lanpr.layers[0]
-
-        layout.operator("scene.lanpr_enable_all_line_types")
-
-        split = layout.split(factor=0.3)
-        col = split.column()
-        col.prop(active_layer, "enable_contour", text="Contour", toggle=True)
-        col.prop(active_layer, "enable_crease", text="Crease", toggle=True)
-        col.prop(active_layer, "enable_edge_mark", text="Mark", toggle=True)
-        col.prop(active_layer, "enable_material_seperate", text="Material", toggle=True)
-        col.prop(active_layer, "enable_intersection", text="Intersection", toggle=True)
-        col = split.column()
-        row = col.row(align = True)
-        #row.enabled = active_layer.enable_contour this is always enabled now
-        row.prop(active_layer, "color", text="")
-        row.prop(active_layer, "thickness", text="")
-        row = col.row(align = True)
-        row.enabled = active_layer.enable_crease
-        row.prop(active_layer, "crease_color", text="")
-        row.prop(active_layer, "thickness_crease", text="")
-        row = col.row(align = True)
-        row.enabled = active_layer.enable_edge_mark
-        row.prop(active_layer, "edge_mark_color", text="")
-        row.prop(active_layer, "thickness_edge_mark", text="")
-        row = col.row(align = True)
-        row.enabled = active_layer.enable_material_seperate
-        row.prop(active_layer, "material_color", text="")
-        row.prop(active_layer, "thickness_material", text="")
-        row = col.row(align = True)
-        if lanpr.enable_intersections:
-            row.enabled = active_layer.enable_intersection
-            row.prop(active_layer, "intersection_color", text="")
-            row.prop(active_layer, "thickness_intersection", text="")
+        
+        row = layout.row(align=True)
+        row.prop(active_layer,"use_same_style")
+        if active_layer.use_same_style:
+            row = layout.row(align=True)
+            row.prop(active_layer, "color", text="")
+            row.prop(active_layer, "thickness", text="")
+            row = layout.row(align=True)
+            row.prop(active_layer, "enable_contour", text="Contour", toggle=True)
+            row.prop(active_layer, "enable_crease", text="Crease", toggle=True)
+            row.prop(active_layer, "enable_edge_mark", text="Mark", toggle=True)
+            row.prop(active_layer, "enable_material_seperate", text="Material", toggle=True)
+            row.prop(active_layer, "enable_intersection", text="Intersection", toggle=True)
         else:
-            row.label(text= "Intersection Calculation Disabled")
+            layout.operator("scene.lanpr_enable_all_line_types",text='Set All')
+            split = layout.split(factor=0.3)
+            col = split.column()
+            col.prop(active_layer, "enable_contour", text="Contour", toggle=True)
+            col.prop(active_layer, "enable_crease", text="Crease", toggle=True)
+            col.prop(active_layer, "enable_edge_mark", text="Mark", toggle=True)
+            col.prop(active_layer, "enable_material_seperate", text="Material", toggle=True)
+            col.prop(active_layer, "enable_intersection", text="Intersection", toggle=True)
+            col = split.column()
+            row = col.row(align = True)
+            #row.enabled = active_layer.enable_contour this is always enabled now
+            row.prop(active_layer, "color", text="")
+            row.prop(active_layer, "thickness", text="")
+            row = col.row(align = True)
+            row.enabled = active_layer.enable_crease
+            row.prop(active_layer, "crease_color", text="")
+            row.prop(active_layer, "thickness_crease", text="")
+            row = col.row(align = True)
+            row.enabled = active_layer.enable_edge_mark
+            row.prop(active_layer, "crease_color", text="")
+            row.prop(active_layer, "thickness_edge_mark", text="")
+            row = col.row(align = True)
+            row.enabled = active_layer.enable_material_seperate
+            row.prop(active_layer, "material_color", text="")
+            row.prop(active_layer, "thickness_material", text="")
+            row = col.row(align = True)
+            if lanpr.enable_intersections:
+                row.enabled = active_layer.enable_intersection
+                row.prop(active_layer, "intersection_color", text="")
+                row.prop(active_layer, "thickness_intersection", text="")
+            else:
+                row.label(text= "Intersection Calculation Disabled")
 
         if lanpr.master_mode == "DPIX" and active_layer.enable_intersection:
             row = col.row(align = True)
diff --git a/source/blender/draw/engines/lanpr/lanpr_ops.c b/source/blender/draw/engines/lanpr/lanpr_ops.c
index e388af437c6..94dc09a77e4 100644
--- a/source/blender/draw/engines/lanpr/lanpr_ops.c
+++ b/source/blender/draw/engines/lanpr/lanpr_ops.c
@@ -3836,18 +3836,18 @@ void lanpr_software_draw_scene(void *vedata, GPUFrameBuffer *dfb, int is_render)
         lanpr_calculate_normal_object_vector(ll, normal_object_direction);
 
         DRW_shgroup_uniform_vec4(rb->ChainShgrp, "color", ll->color, 1);
-        DRW_shgroup_uniform_vec4(rb->ChainShgrp, "crease_color", ll->crease_color, 1);
-        DRW_shgroup_uniform_vec4(rb->ChainShgrp, "material_color", ll->material_color, 1);
-        DRW_shgroup_uniform_vec4(rb->ChainShgrp, "edge_mark_color", ll->edge_mark_color, 1);
-        DRW_shgroup_uniform_vec4(rb->ChainShgrp, "intersection_color", ll->intersection_color, 1);
+        DRW_shgroup_uniform_vec4(rb->ChainShgrp, "crease_color", ll->use_same_style?ll->color:ll->crease_color, 1);
+        DRW_shgroup_uniform_vec4(rb->ChainShgrp, "material_color", ll->use_same_style?ll->color:ll->material_color, 1);
+        DRW_shgroup_uniform_vec4(rb->ChainShgrp, "edge_mark_color", ll->use_same_style?ll->color:ll->edge_mark_color, 1);
+        DRW_shgroup_uniform_vec4(rb->ChainShgrp, "intersection_color", ll->use_same_style?ll->color:ll->intersection_color, 1);
         DRW_shgroup_uniform_float(rb->ChainShgrp, "thickness", &ll->thickness, 1);
-        DRW_shgroup_uniform_float(rb->ChainShgrp, "thickness_crease", &ll->thickness_crease, 1);
+        DRW_shgroup_uniform_float(rb->ChainShgrp, "thickness_crease", ll->use_same_style?&ll->thickness:&ll->thickness_crease, 1);
         DRW_shgroup_uniform_float(
-            rb->ChainShgrp, "thickness_material", &ll->thickness_material, 1);
+            rb->ChainShgrp, "thickness_material", ll->use_same_style?&ll->thickness:&ll->thickness_material, 1);
         DRW_shgroup_uniform_float(
-            rb->ChainShgrp, "thickness_edge_mark", &ll->thickness_edge_mark, 1);
+            rb->ChainShgrp, "thickness_edge_mark", ll->use_same_style?&ll->thickness:&ll->thickness_edge_mark, 1);
         DRW_shgroup_uniform_float(
-            rb->ChainShgrp, "thickness_intersection", &ll->thickness_intersection, 1);
+            rb->ChainShgrp, "thickness_intersection", ll->use_same_style?&ll->thickness:&ll->thickness_intersection, 1);
         DRW_shgroup_uniform_int(rb->ChainShgrp, "enable_contour", &ll->enable_contour, 1);
         DRW_shgroup_uniform_int(rb->ChainShgrp, "enable_crease", &ll->enable_crease, 1);
         DRW_shgroup_uniform_int(
@@ -3904,16 +3904,16 @@ void lanpr_software_draw_scene(void *vedata, GPUFrameBuffer *dfb, int is_render)
           lanpr_calculate_normal_object_vector(ll, normal_object_direction);
 
           DRW_shgroup_uniform_vec4(ll->shgrp, "color", ll->color, 1);
-          DRW_shgroup_uniform_vec4(ll->shgrp, "crease_color", ll->crease_color, 1);
-          DRW_shgroup_uniform_vec4(ll->shgrp, "material_color", ll->material_color, 1);
-          DRW_shgroup_uniform_vec4(ll->shgrp, "edge_mark_color", ll->edge_mark_color, 1);
-          DRW_shgroup_uniform_vec4(ll->shgrp, "intersection_color", ll->intersection_color, 1);
+          DRW_shgroup_uniform_vec4(ll->shgrp, "crease_color",ll->use_same_style?ll->color:ll->crease_color, 1);
+          DRW_shgroup_uniform_vec4(ll->shgrp, "material_color", ll->use_same_style?ll->color:ll->material_color, 1);
+          DRW_shgroup_uniform_vec4(ll->shgrp, "edge_mark_color", ll->use_same_style?ll->color:ll->edge_mark_color, 1);
+          DRW_shgroup_uniform_vec4(ll->shgrp, "intersection_color", ll->use_same_style?ll->color:ll->intersection_color, 1);
           DRW_shgroup_uniform_float(ll->shgrp, "thickness", &ll->thickness, 1);
-          DRW_shgroup_uniform_float(ll->shgrp, "thickness_crease", &ll->thickness_crease, 1);
-          DRW_shgroup_uniform_float(ll->shgrp, "thickness_material", &ll->thickness_material, 1);
-          DRW_shgroup_uniform_float(ll->shgrp, "thickness_edge_mark", &ll->thickness_edge_mark, 1);
+          DRW_shgroup_uniform_float(ll->shgrp, "thickness_crease", ll->use_same_style?&ll->thickness:&ll->thickness_crease, 1);
+          DRW_shgroup_uniform_float(ll->shgrp, "thickness_material", ll->use_same_style?&ll->thickness:&ll->thickness_material, 1);
+          DRW_shgroup_uniform_float(ll->shgrp, "thickness_edge_mark", ll->use_same_style?&ll->thickness:&ll->thickness_edge_mark, 1);
           DRW_shgroup_uniform_float(
-              ll->shgrp, "thickness_intersection", &ll->thickness_intersection, 1);
+              ll->shgrp, "thickness_intersection",ll->use_same_style?&ll->thickness:&ll->thickness_intersection, 1);
           DRW_shgroup_uniform_vec4(ll->shgrp, "preview_viewport", stl->g_data->dpi

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list