[Bf-blender-cvs] [dc7d5baaabf] temp-lanpr-cleanup: Merge remote-tracking branch 'origin/master' into temp-lanpr-cleanup

YimingWu noreply at git.blender.org
Sat Sep 14 10:20:17 CEST 2019


Commit: dc7d5baaabfc686a495012a9c6f41974938cce13
Author: YimingWu
Date:   Fri Sep 13 13:23:57 2019 +0800
Branches: temp-lanpr-cleanup
https://developer.blender.org/rBdc7d5baaabfc686a495012a9c6f41974938cce13

Merge remote-tracking branch 'origin/master' into temp-lanpr-cleanup

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



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

diff --cc release/scripts/startup/bl_ui/properties_render.py
index 74632d0ab44,b4c864c16cd..30237130539
--- a/release/scripts/startup/bl_ui/properties_render.py
+++ b/release/scripts/startup/bl_ui/properties_render.py
@@@ -23,11 -24,9 +23,13 @@@ from bl_ui.space_view3d import 
      VIEW3D_PT_shading_color,
      VIEW3D_PT_shading_options,
  )
 +from bpy.types import (
 +    Panel,
 +    UIList,
 +)
  
+ from bl_ui.properties_grease_pencil_common import GreasePencilSimplifyPanel
+ 
  
  class RenderButtonsPanel:
      bl_space_type = 'PROPERTIES'
@@@ -656,467 -655,13 +658,442 @@@ class RENDER_PT_simplify_render(RenderB
          col.prop(rd, "simplify_child_particles_render", text="Max Child Particles")
  
  
- class RENDER_PT_simplify_greasepencil(RenderButtonsPanel, Panel):
+ class RENDER_PT_simplify_greasepencil(RenderButtonsPanel, Panel, GreasePencilSimplifyPanel):
      bl_label = "Grease Pencil"
      bl_parent_id = "RENDER_PT_simplify"
-     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
+     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
      bl_options = {'DEFAULT_CLOSED'}
  
-     def draw_header(self, context):
-         rd = context.scene.render
-         self.layout.prop(rd, "simplify_gpencil", text="")
- 
-     def draw(self, context):
-         layout = self.layout
-         layout.use_property_split = True
-         layout.use_property_decorate = False
- 
-         rd = context.scene.render
- 
-         layout.active = rd.simplify_gpencil
- 
-         col = layout.column()
-         col.prop(rd, "simplify_gpencil_onplay", text="Playback Only")
-         col.prop(rd, "simplify_gpencil_view_modifier", text="Modifiers")
-         col.prop(rd, "simplify_gpencil_shader_fx", text="ShaderFX")
-         col.prop(rd, "simplify_gpencil_blend", text="Layers Blending")
-         col.prop(rd, "simplify_gpencil_tint", text="Layers Tinting")
- 
-         col.prop(rd, "simplify_gpencil_view_fill")
-         sub = col.column()
-         sub.active = rd.simplify_gpencil_view_fill
-         sub.prop(rd, "simplify_gpencil_remove_lines", text="Lines")
- 
  
 +class LANPR_UL_linesets(UIList):
 +    def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
 +        layout.prop(item,"name", text="", emboss=False)
 +
 +class RENDER_PT_lanpr(RenderButtonsPanel, Panel):
 +    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_LANPR', 'BLENDER_OPENGL', 'BLENDER_EEVEE'}
 +    bl_label = "LANPR"
 +    bl_options = {'DEFAULT_CLOSED'}
 +    
 +    @classmethod
 +    def poll(cls, context):
 +        return True
 +
 +    def draw_header(self, context):
 +        if context.scene.render.engine != 'BLENDER_LANPR':
 +            self.layout.prop(context.scene.lanpr, "enabled", text="")
 +
 +    def draw(self, context):
 +        scene = context.scene
 +        lanpr = scene.lanpr
 +        active_layer = lanpr.layers.active_layer 
 +        mode = lanpr.master_mode
 +
 +        layout = self.layout
 +        layout.active = scene.render.engine=="BLENDER_LANPR" or lanpr.enabled
 +        layout.use_property_split = True
 +        layout.use_property_decorate = False  # No animation.
 +
 +        col = layout.column()
 +
 +        if scene.render.engine=="BLENDER_LANPR":
 +            col.prop(lanpr, "master_mode") 
 +        else:
 +            mode = "SOFTWARE"
 +
 +        if mode == "DPIX" and lanpr.shader_error:
 +            layout.label(text="DPIX transform shader compile error!")
 +            return
 +        
 +        layout.prop(lanpr, "crease_threshold", slider=True)
 +
 +        if not scene.camera:
 +            has_camera=False
 +            col.label(text="No active camera.")
 +        else:
 +            has_camera=True
 +        
 +        c=col.column()
 +        c.enabled = has_camera
 +
 +        if scene.render.engine=="BLENDER_LANPR":
 +            c.prop(lanpr,'auto_update', text='Auto Update')
 +            txt = "Update" if mode == "SOFTWARE" else "Intersection Cache"
 +            if not lanpr.auto_update:
 +                c.operator("scene.lanpr_calculate", icon='FILE_REFRESH', text=txt)
 +
 +        if mode == "DPIX" and len(lanpr.layers)==0:
 +            layout.label(text="You don't have a layer to display.")
 +            layout.operator("scene.lanpr_add_line_layer");
 +
 +        if scene.render.engine=="BLENDER_LANPR" and mode == "SOFTWARE":
 +            layout.operator("scene.lanpr_auto_create_line_layer", text = "Default", icon = "ADD")
 +            row=layout.row()
 +            row.template_list("LANPR_UL_linesets", "", lanpr, "layers", lanpr.layers, "active_layer_index", rows=4)
 +            col=row.column(align=True)
 +            if active_layer:
 +                col.operator("scene.lanpr_add_line_layer", icon="ADD", text='')
 +                col.operator("scene.lanpr_delete_line_layer", icon="REMOVE", text='')
 +                col.separator()
 +                col.operator("scene.lanpr_move_line_layer",icon='TRIA_UP', text='').direction = "UP"
 +                col.operator("scene.lanpr_move_line_layer",icon='TRIA_DOWN', text='').direction = "DOWN"
 +                col.separator()
 +                col.operator("scene.lanpr_rebuild_all_commands",icon="FILE_REFRESH", text='')
 +            else:
 +                col.operator("scene.lanpr_add_line_layer", icon="ADD", text='')
 +
 +def lanpr_make_line_type(expand,layout,line_type,label):
 +    layout.prop(line_type, "use", text=label)
 +    if expand and line_type.use:
 +        c = layout.column(align=True)
 +        c.prop(line_type, "color", text="Color")
 +        c.prop(line_type, "thickness", slider=True)
 +
 +class RENDER_PT_lanpr_layer_settings(RenderButtonsPanel, Panel):
 +    bl_label = "Layer Settings"
 +    bl_parent_id = "RENDER_PT_lanpr"
 +    bl_options = {'DEFAULT_CLOSED'}
 +    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_LANPR', 'BLENDER_OPENGL', 'BLENDER_EEVEE'}
 +
 +    @classmethod
 +    def poll(cls, context):
 +        scene = context.scene
 +        lanpr = scene.lanpr
 +        active_layer = lanpr.layers.active_layer
 +        return scene.render.engine=="BLENDER_LANPR" and active_layer
 +
 +    def draw(self, context):
 +        scene = context.scene
 +        lanpr = scene.lanpr
 +        active_layer = lanpr.layers.active_layer
 +
 +        layout = self.layout
 +        layout.use_property_split = True
 +        layout.use_property_decorate = False  # No animation.
 +
 +        mode = lanpr.master_mode
 +        if scene.render.engine!="BLENDER_LANPR" and mode != "SOFTWARE":
 +            mode = "SOFTWARE"
 +
 +        if active_layer and mode == "DPIX":
 +            active_layer = lanpr.layers[0]
 +
 +        if mode == "SOFTWARE":
 +            layout.prop(active_layer, "use_multiple_levels", text="Multiple Levels")
 +            col = layout.column(align=True)
 +            col.prop(active_layer, "level_start", text='Level Start')
 +            if active_layer.use_multiple_levels:
 +                col.prop(active_layer, "level_end", text='End')
 +        
 +        layout.prop(active_layer,"use_same_style")
 +
 +        expand = not active_layer.use_same_style
 +
 +        col = layout.column(align=True)
 +        if not expand:
 +            col.prop(active_layer, "color")
 +        col.prop(active_layer, "thickness", text="Main Thickness")
 +
 +        lanpr_make_line_type(expand,layout,active_layer.contour,"Contour")
 +        lanpr_make_line_type(expand,layout,active_layer.crease,"Crease")
 +        lanpr_make_line_type(expand,layout,active_layer.edge_mark,"EdgeMark")
 +        lanpr_make_line_type(expand,layout,active_layer.material_separate,"Material")
 +
 +        if lanpr.use_intersections:
 +            lanpr_make_line_type(expand,layout,active_layer.intersection,"Intersection")
 +        else:
 +            layout.label(text= "Intersection calculation disabled.")
 +
 +class RENDER_PT_lanpr_line_components(RenderButtonsPanel, Panel):
 +    bl_label = "Including"
 +    bl_parent_id = "RENDER_PT_lanpr"
 +    bl_options = {'DEFAULT_CLOSED'}
 +    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_LANPR', 'BLENDER_OPENGL', 'BLENDER_EEVEE'}
 +
 +    @classmethod
 +    def poll(cls, context):
 +        scene = context.scene
 +        lanpr = scene.lanpr
 +        active_layer = lanpr.layers.active_layer
 +        return scene.render.engine=="BLENDER_LANPR" and active_layer and not lanpr.enable_chaining
 +
 +    def draw(self, context):
 +        layout = self.layout
 +        scene = context.scene
 +        lanpr = scene.lanpr
 +        active_layer = lanpr.layers.active_layer
 +
 +        layout.operator("scene.lanpr_add_line_component")#, icon = "ZOOMIN")
 +        
 +        i=0
 +        for c in active_layer.components:
 +            split = layout.split(factor=0.85)
 +            col = split.column()
 +            sp2 = col.split(factor=0.4)
 +            cl = sp2.column()
 +            cl.prop(c,"component_mode", text = "")
 +            cl = sp2.column()
 +            if c.component_mode == "OBJECT":
 +                cl.prop(c,"object_select", text = "")
 +            elif c.component_mode == "MATERIAL":
 +                cl.prop(c,"material_select", text = "")
 +            elif c.component_mode == "COLLECTION":
 +                cl.prop(c,"collection_select", text = "")
 +            col = split.column()
 +            col.operator("scene.lanpr_delete_line_component", text="").index=i
 +            i=i+1
 +
 +
 +class RENDER_PT_lanpr_line_normal_effects(RenderButtonsPanel, Panel):
 +    bl_label = "Normal Based Line Weight"
 +    bl_parent_id = "RENDER_PT_lanpr"
 +    bl_options = {'DEFAULT_CLOSED'}
 +    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_LANPR', 'BLENDER_OPENGL', 'BLENDER_EEVEE'}
 +
 +    @classmethod
 +    def poll(cls, context):
 +        scene = context.scene
 +        lanpr = scene.lanpr
 +        active_layer = lanpr.layers.active_layer
 +        return scene.render.engine=="BLENDER_LANPR" and active_layer
 +
 +    def draw_header(self, context):
 +        active_layer = context.scene.lanpr.layers.active_layer
 +        self.layout.prop(active_layer, "normal_enabled", text="")   
 +


@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list