diff options
Diffstat (limited to 'release/scripts/startup/bl_ui')
-rw-r--r-- | release/scripts/startup/bl_ui/__init__.py | 4 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_collection.py | 125 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_camera.py | 32 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_lanpr.py | 100 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_render.py | 321 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_world.py | 4 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 23 |
7 files changed, 575 insertions, 34 deletions
diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py index c2bcb7d5ea5..8fc59ca493a 100644 --- a/release/scripts/startup/bl_ui/__init__.py +++ b/release/scripts/startup/bl_ui/__init__.py @@ -64,6 +64,7 @@ _modules = [ "properties_scene", "properties_texture", "properties_world", + "properties_collection", # Generic Space Modules # @@ -100,6 +101,9 @@ import bpy if bpy.app.build_options.freestyle: _modules.append("properties_freestyle") +if bpy.app.build_options.lanpr: + _modules.append("properties_lanpr") + __import__(name=__name__, fromlist=_modules) _namespace = globals() _modules_loaded = [_namespace[name] for name in _modules] diff --git a/release/scripts/startup/bl_ui/properties_collection.py b/release/scripts/startup/bl_ui/properties_collection.py new file mode 100644 index 00000000000..3713b394b62 --- /dev/null +++ b/release/scripts/startup/bl_ui/properties_collection.py @@ -0,0 +1,125 @@ +# ##### BEGIN GPL LICENSE BLOCK ##### +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ##### END GPL LICENSE BLOCK ##### + +# <pep8 compliant> +from bpy.types import Panel + +class CollectionButtonsPanel: + bl_space_type = 'PROPERTIES' + bl_region_type = 'WINDOW' + bl_context = "collection" + COMPAT_ENGINES = { 'BLENDER_LANPR' } + + @classmethod + def poll(cls, context): + return (context.engine in cls.COMPAT_ENGINES) + + +def lanpr_make_line_type_entry(col, line_type, text_disp, expand, search_from): + col.prop(line_type, "use", text=text_disp) + if line_type.use and expand: + col.prop_search(line_type, "layer", search_from, "layers", icon='GREASEPENCIL') + col.prop_search(line_type, "material", search_from, "materials", icon='SHADING_TEXTURE') + +class COLLECTION_PT_collection_flags(CollectionButtonsPanel, Panel): + bl_label = "Collection Flags" + COMPAT_ENGINES = { 'BLENDER_LANPR', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH', 'CYCLES' } + + def draw(self, context): + layout=self.layout + collection=context.collection + vl = context.view_layer + vlc = vl.active_layer_collection + if vlc.name == 'Master Collection': + row = layout.row() + row.label(text="This is the master collection") + return + + row = layout.row() + col = row.column(align=True) + col.prop(vlc,"hide_viewport") + col.prop(vlc,"holdout") + col.prop(vlc,"indirect_only") + row = layout.row() + col = row.column(align=True) + col.prop(collection,"hide_select") + col.prop(collection,"hide_viewport") + col.prop(collection,"hide_render") + +class COLLECTION_PT_lanpr_collection(CollectionButtonsPanel, Panel): + bl_label = "Collection LANPR" + COMPAT_ENGINES = { 'BLENDER_LANPR' } + + @classmethod + def poll(cls, context): + return context.scene.render.engine == 'BLENDER_LANPR' or context.scene.lanpr.enabled + + def draw_header(self, context): + layout = self.layout + collection = context.collection + layout.prop(collection, "configure_lanpr", text="") + + def draw(self,context): + layout = self.layout + layout.use_property_split = True + layout.use_property_decorate = False + collection = context.collection + if not collection.configure_lanpr: + return + + lanpr = collection.lanpr + row = layout.row() + row.prop(lanpr,"usage") + if lanpr.usage!='INCLUDE': + layout.prop(lanpr,"force") + else: + layout.prop(lanpr,"target") + + if lanpr.target: + + layout.prop(lanpr,'use_multiple_levels', text="Multiple Levels") + + if lanpr.use_multiple_levels: + col = layout.column(align=True) + col.prop(lanpr,'level_start',text="Level Begin") + col.prop(lanpr,'level_end',text="End") + else: + layout.prop(lanpr,'level_start',text="Level") + + layout.prop(lanpr, "use_same_style") + + if lanpr.use_same_style: + layout.prop_search(lanpr, 'target_layer', lanpr.target.data, "layers", icon='GREASEPENCIL') + layout.prop_search(lanpr, 'target_material', lanpr.target.data, "materials", icon='SHADING_TEXTURE') + + expand = not lanpr.use_same_style + lanpr_make_line_type_entry(layout, lanpr.contour, "Contour", expand, lanpr.target.data) + lanpr_make_line_type_entry(layout, lanpr.crease, "Crease", expand, lanpr.target.data) + lanpr_make_line_type_entry(layout, lanpr.material, "Material", expand, lanpr.target.data) + lanpr_make_line_type_entry(layout, lanpr.edge_mark, "Edge Mark", expand, lanpr.target.data) + lanpr_make_line_type_entry(layout, lanpr.intersection, "Intersection", expand, lanpr.target.data) + +classes = ( + COLLECTION_PT_collection_flags, + COLLECTION_PT_lanpr_collection, +) + +if __name__ == "__main__": # only for live edit. + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_data_camera.py b/release/scripts/startup/bl_ui/properties_data_camera.py index aee909e3a6c..957b119e9ba 100644 --- a/release/scripts/startup/bl_ui/properties_data_camera.py +++ b/release/scripts/startup/bl_ui/properties_data_camera.py @@ -39,7 +39,7 @@ class CAMERA_PT_presets(PresetPanel, Panel): preset_subdir = "camera" preset_operator = "script.execute_preset" preset_add_operator = "camera.preset_add" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_LANPR', 'BLENDER_WORKBENCH'} class SAFE_AREAS_PT_presets(PresetPanel, Panel): @@ -47,13 +47,13 @@ class SAFE_AREAS_PT_presets(PresetPanel, Panel): preset_subdir = "safe_areas" preset_operator = "script.execute_preset" preset_add_operator = "safe_areas.preset_add" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_LANPR', 'BLENDER_WORKBENCH'} class DATA_PT_context_camera(CameraButtonsPanel, Panel): bl_label = "" bl_options = {'HIDE_HEADER'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_LANPR', 'BLENDER_WORKBENCH'} def draw(self, context): layout = self.layout @@ -70,7 +70,7 @@ class DATA_PT_context_camera(CameraButtonsPanel, Panel): class DATA_PT_lens(CameraButtonsPanel, Panel): bl_label = "Lens" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_LANPR', 'BLENDER_WORKBENCH'} def draw(self, context): layout = self.layout @@ -111,7 +111,7 @@ class DATA_PT_lens(CameraButtonsPanel, Panel): sub = col.column(align=True) sub.prop(ccam, "longitude_min", text="Longitude Min") sub.prop(ccam, "longitude_max", text="Max") - elif engine in {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}: + elif engine in {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_LANPR', 'BLENDER_WORKBENCH'}: if cam.lens_unit == 'MILLIMETERS': col.prop(cam, "lens") elif cam.lens_unit == 'FOV': @@ -133,7 +133,7 @@ class DATA_PT_lens(CameraButtonsPanel, Panel): class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel): bl_label = "Stereoscopy" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_LANPR', 'BLENDER_WORKBENCH'} @classmethod def poll(cls, context): @@ -182,7 +182,7 @@ class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel): class DATA_PT_camera(CameraButtonsPanel, Panel): bl_label = "Camera" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_LANPR', 'BLENDER_WORKBENCH'} def draw_header_preset(self, _context): CAMERA_PT_presets.draw_panel_header(self.layout) @@ -212,7 +212,7 @@ class DATA_PT_camera(CameraButtonsPanel, Panel): class DATA_PT_camera_dof(CameraButtonsPanel, Panel): bl_label = "Depth of Field" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} + COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_LANPR', 'BLENDER_WORKBENCH'} def draw_header(self, context): cam = context.camera @@ -237,7 +237,7 @@ class DATA_PT_camera_dof(CameraButtonsPanel, Panel): class DATA_PT_camera_dof_aperture(CameraButtonsPanel, Panel): bl_label = "Aperture" bl_parent_id = "DATA_PT_camera_dof" - COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} + COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_LANPR', 'BLENDER_WORKBENCH'} def draw(self, context): layout = self.layout @@ -261,7 +261,7 @@ class DATA_PT_camera_dof_aperture(CameraButtonsPanel, Panel): class DATA_PT_camera_background_image(CameraButtonsPanel, Panel): bl_label = "Background Images" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_LANPR', 'BLENDER_WORKBENCH'} def draw_header(self, context): cam = context.camera @@ -367,7 +367,7 @@ class DATA_PT_camera_background_image(CameraButtonsPanel, Panel): class DATA_PT_camera_display(CameraButtonsPanel, Panel): bl_label = "Viewport Display" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_LANPR', 'BLENDER_WORKBENCH'} def draw(self, context): layout = self.layout @@ -399,7 +399,7 @@ class DATA_PT_camera_display_composition_guides(CameraButtonsPanel, Panel): bl_label = "Composition Guides" bl_parent_id = "DATA_PT_camera_display" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_LANPR', 'BLENDER_WORKBENCH'} def draw(self, context): layout = self.layout @@ -431,7 +431,7 @@ class DATA_PT_camera_display_passepartout(CameraButtonsPanel, Panel): bl_label = "Passepartout" bl_parent_id = "DATA_PT_camera_display" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_LANPR', 'BLENDER_WORKBENCH'} def draw_header(self, context): cam = context.camera @@ -451,7 +451,7 @@ class DATA_PT_camera_display_passepartout(CameraButtonsPanel, Panel): class DATA_PT_camera_safe_areas(CameraButtonsPanel, Panel): bl_label = "Safe Areas" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_LANPR', 'BLENDER_WORKBENCH'} def draw_header(self, context): cam = context.camera @@ -481,7 +481,7 @@ class DATA_PT_camera_safe_areas_center_cut(CameraButtonsPanel, Panel): bl_label = "Center-Cut Safe Areas" bl_parent_id = "DATA_PT_camera_safe_areas" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_LANPR', 'BLENDER_WORKBENCH'} def draw_header(self, context): cam = context.camera @@ -505,7 +505,7 @@ class DATA_PT_camera_safe_areas_center_cut(CameraButtonsPanel, Panel): class DATA_PT_custom_props_camera(CameraButtonsPanel, PropertyPanel, Panel): - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_LANPR', 'BLENDER_WORKBENCH'} _context_path = "object.data" _property_type = bpy.types.Camera diff --git a/release/scripts/startup/bl_ui/properties_lanpr.py b/release/scripts/startup/bl_ui/properties_lanpr.py new file mode 100644 index 00000000000..6bb42ec75ba --- /dev/null +++ b/release/scripts/startup/bl_ui/properties_lanpr.py @@ -0,0 +1,100 @@ +# ##### BEGIN GPL LICENSE BLOCK ##### +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ##### END GPL LICENSE BLOCK ##### + +# <pep8 compliant> +from bpy.types import Panel + +class LanprButtonsPanel: + bl_space_type = 'PROPERTIES' + bl_region_type = 'WINDOW' + bl_context = "lanpr" + COMPAT_ENGINES = { 'BLENDER_LANPR' } + +def lanpr_make_line_type_entry(col, line_type, text_disp, expand, search_from): + col.prop(line_type, "use", text=text_disp) + if line_type.use and expand: + col.prop_search(line_type, "layer", search_from, "layers", icon='GREASEPENCIL') + col.prop_search(line_type, "material", search_from, "materials", icon='SHADING_TEXTURE') + +class OBJECT_PT_lanpr_settings(LanprButtonsPanel, Panel): + bl_label = "LANPR settings" + COMPAT_ENGINES = { 'BLENDER_LANPR' } + + @classmethod + def poll(cls, context): + ob = context.object + obl = ob.lanpr + return (context.scene.render.engine == 'BLENDER_LANPR' or context.scene.lanpr.enabled) and\ + obl.usage == 'INCLUDE' and obl.target + + def draw(self,context): + collection = context.collection + lanpr = collection.lanpr + ob = context.object + obl = ob.lanpr + + layout = self.layout + layout.use_property_split = True + layout.use_property_decorate = False + + layout.prop(obl,'use_multiple_levels', text="Multiple Levels") + if obl.use_multiple_levels: + col = layout.column(align=True) + col.prop(obl,'level_start') + col.prop(obl,'level_end', text="End") + else: + layout.prop(obl,'level_start', text="Level") + + layout.prop(obl,'use_same_style') + if obl.use_same_style: + layout.prop_search(obl, 'target_layer', obl.target.data, "layers", icon='GREASEPENCIL') + layout.prop_search(obl, 'target_material', obl.target.data, "materials", icon='SHADING_TEXTURE') + + expand = not obl.use_same_style + lanpr_make_line_type_entry(layout, obl.contour, "Contour", expand, obl.target.data) + lanpr_make_line_type_entry(layout, obl.crease, "Crease", expand, obl.target.data) + lanpr_make_line_type_entry(layout, obl.material, "Material", expand, obl.target.data) + lanpr_make_line_type_entry(layout, obl.edge_mark, "Edge Mark", expand, obl.target.data) + + +class OBJECT_PT_lanpr(LanprButtonsPanel, Panel): + bl_label = "Usage" + COMPAT_ENGINES = { 'BLENDER_LANPR' } + + @classmethod + def poll(cls, context): + return context.scene.render.engine == 'BLENDER_LANPR' or context.scene.lanpr.enabled + + def draw(self, context): + layout=self.layout + lanpr = context.object.lanpr + if context.object.type == 'MESH': + layout.prop(lanpr,'usage') + if lanpr.usage == 'INCLUDE': + layout.prop(lanpr, "target") + + +classes = ( + OBJECT_PT_lanpr, + OBJECT_PT_lanpr_settings, +) + +if __name__ == "__main__": # only for live edit. + from bpy.utils import register_class + for cls in classes: + register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py index b4c864c16cd..6a89fb007cf 100644 --- a/release/scripts/startup/bl_ui/properties_render.py +++ b/release/scripts/startup/bl_ui/properties_render.py @@ -18,12 +18,15 @@ # ##### END GPL LICENSE BLOCK ##### # <pep8 compliant> -from bpy.types import Panel from bl_ui.space_view3d import ( VIEW3D_PT_shading_lighting, VIEW3D_PT_shading_color, VIEW3D_PT_shading_options, ) +from bpy.types import ( + Panel, + UIList, +) from bl_ui.properties_grease_pencil_common import GreasePencilSimplifyPanel @@ -66,7 +69,7 @@ class RENDER_PT_color_management(RenderButtonsPanel, Panel): bl_label = "Color Management" bl_options = {'DEFAULT_CLOSED'} bl_order = 100 - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH', 'BLENDER_LANPR'} def draw(self, context): layout = self.layout @@ -99,7 +102,7 @@ class RENDER_PT_color_management_curves(RenderButtonsPanel, Panel): bl_label = "Use Curves" bl_parent_id = "RENDER_PT_color_management" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH', 'BLENDER_LANPR'} def draw_header(self, context): @@ -463,7 +466,7 @@ class RENDER_PT_eevee_indirect_lighting_display(RenderButtonsPanel, Panel): class RENDER_PT_eevee_film(RenderButtonsPanel, Panel): bl_label = "Film" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_EEVEE', 'BLENDER_LANPR'} @classmethod def poll(cls, context): @@ -662,6 +665,308 @@ class RENDER_PT_simplify_greasepencil(RenderButtonsPanel, Panel, GreasePencilSim bl_options = {'DEFAULT_CLOSED'} +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'} + + 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) + + + col.prop(lanpr,'auto_update', text='Auto Update') + + 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": + 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_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="") + + 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 + + layout.prop(active_layer,"normal_mode", text="Mode") + if active_layer.normal_mode != "DISABLED": + layout.prop(active_layer,"normal_control_object") + layout.prop(active_layer,"normal_effect_inverse") + col = layout.column(align=True) + col.prop(active_layer,"normal_ramp_begin") + col.prop(active_layer,"normal_ramp_end", text="End") + col = layout.column(align=True) + col.prop(active_layer,"normal_thickness_start", slider=True) + col.prop(active_layer,"normal_thickness_end", slider=True, text="End") + +class RENDER_PT_lanpr_line_gpu_effects(RenderButtonsPanel, Panel): + bl_label = "Effects" + 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 lanpr.master_mode == "DPIX" + + 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 + + col = layout.column(align = True) + col.prop(lanpr, "crease_threshold") + col.prop(lanpr, "crease_fade_threshold", text="Fade") + col = layout.column(align = True) + col.prop(lanpr, "depth_width_influence") + col.prop(lanpr, "depth_width_curve", text="Curve") + col = layout.column(align = True) + col.prop(lanpr, "depth_alpha_influence") + col.prop(lanpr, "depth_alpha_curve", text="Curve") + +class RENDER_PT_lanpr_gpencil(RenderButtonsPanel, Panel): + bl_label = "Grease Pencil" + 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 + return scene.render.engine!='BLENDER_LANPR' + + def draw(self, context): + scene = context.scene + lanpr = scene.lanpr + + layout = self.layout + layout.use_property_split = True + layout.use_property_decorate = False + + if not scene.camera: + has_camera=False + layout.label(text="No active camera.") + else: + has_camera=True + + layout.enabled=has_camera + layout.prop(lanpr,"auto_update", text='Auto Update') + layout.prop(lanpr,"gpencil_overwrite", text='Overwrite') + if not lanpr.auto_update: + layout.operator("scene.lanpr_update_gp_strokes", icon='FILE_REFRESH', text='Update Grease Pencil Targets') + layout.operator("scene.lanpr_bake_gp_strokes", icon='RENDER_ANIMATION', text='Bake All Frames') + +class RENDER_PT_lanpr_software_chain_styles(RenderButtonsPanel, Panel): + bl_label = "Chaining" + 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 + return scene.render.engine!='BLENDER_LANPR' or lanpr.enable_chaining and (not (scene.render.engine=='BLENDER_LANPR' and lanpr.master_mode=='DPIX')) + + def draw(self, context): + scene = context.scene + lanpr = scene.lanpr + + layout = self.layout + layout.use_property_split = True + layout.use_property_decorate = False + + if scene.render.engine=="BLENDER_LANPR": + layout.prop(lanpr, "use_same_taper", text="Taper Tips") + if lanpr.use_same_taper == "DISABLED": + col = layout.column(align = True) + col.prop(lanpr,"taper_left_distance") + col.prop(lanpr,"taper_left_strength", text="Strength") + col = layout.column(align = True) + col.prop(lanpr,"taper_right_distance") + col.prop(lanpr,"taper_right_strength", text="Strength") + else: + col = layout.column(align = True) + col.prop(lanpr,"taper_left_distance", text="Distance") + col.prop(lanpr,"taper_left_strength", text="Strength") + else: + layout.prop(lanpr, "chaining_geometry_threshold") + layout.prop(lanpr, "chaining_image_threshold") + +class RENDER_PT_lanpr_options(RenderButtonsPanel, Panel): + bl_label = "Settings" + bl_parent_id = "RENDER_PT_lanpr" + bl_options = {'DEFAULT_CLOSED'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_LANPR', 'BLENDER_OPENGL', 'BLENDER_EEVEE'} + + def draw(self, context): + scene = context.scene + lanpr = scene.lanpr + + layout = self.layout + layout.use_property_split = True + layout.use_property_decorate = False + + mode = lanpr.master_mode + if scene.render.engine!="BLENDER_LANPR": + mode = "SOFTWARE" + + if mode == "DPIX": + layout.prop(lanpr,"gpu_cache_size") + + layout.prop(lanpr,"use_intersections") + + if scene.render.engine=='BLENDER_LANPR' and lanpr.master_mode=='SOFTWARE': + layout.prop(lanpr,"enable_chaining", text = "Chained Lines") + + classes = ( RENDER_PT_context, RENDER_PT_eevee_sampling, @@ -691,6 +996,14 @@ classes = ( RENDER_PT_simplify_viewport, RENDER_PT_simplify_render, RENDER_PT_simplify_greasepencil, + RENDER_PT_lanpr, + RENDER_PT_lanpr_layer_settings, + RENDER_PT_lanpr_gpencil, + RENDER_PT_lanpr_line_normal_effects, + RENDER_PT_lanpr_line_gpu_effects, + RENDER_PT_lanpr_software_chain_styles, + RENDER_PT_lanpr_options, + LANPR_UL_linesets, ) if __name__ == "__main__": # only for live edit. diff --git a/release/scripts/startup/bl_ui/properties_world.py b/release/scripts/startup/bl_ui/properties_world.py index 705be66ecc1..a6a58ec4e2b 100644 --- a/release/scripts/startup/bl_ui/properties_world.py +++ b/release/scripts/startup/bl_ui/properties_world.py @@ -37,7 +37,7 @@ class WorldButtonsPanel: class WORLD_PT_context_world(WorldButtonsPanel, Panel): bl_label = "" bl_options = {'HIDE_HEADER'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_LANPR', 'BLENDER_WORKBENCH'} @classmethod def poll(cls, context): @@ -83,7 +83,7 @@ class EEVEE_WORLD_PT_mist(WorldButtonsPanel, Panel): class WORLD_PT_custom_props(WorldButtonsPanel, PropertyPanel, Panel): - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_LANPR', 'BLENDER_WORKBENCH'} _context_path = "world" _property_type = bpy.types.World diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 3a3869068b0..aa8f343e1a0 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -3611,9 +3611,9 @@ class VIEW3D_MT_edit_mesh_context_menu(Menu): col.operator("mesh.mark_sharp") col.operator("mesh.mark_sharp", text="Clear Sharp").clear = True - if render.use_freestyle: - col.separator() - + scene = context.scene + if render.use_freestyle or scene.lanpr.enabled or scene.render.engine=="BLENDER_LANPR": + layout.separator() col.operator("mesh.mark_freestyle_edge").clear = False col.operator("mesh.mark_freestyle_edge", text="Clear Freestyle Edge").clear = True @@ -3804,9 +3804,8 @@ class VIEW3D_MT_edit_mesh_edges_data(Menu): props.use_verts = True props.clear = True - if render.use_freestyle: + if render.use_freestyle or context.scene.lanpr.enabled or render.engine=="BLENDER_LANPR": layout.separator() - layout.operator("mesh.mark_freestyle_edge").clear = False layout.operator("mesh.mark_freestyle_edge", text="Clear Freestyle Edge").clear = True @@ -3814,7 +3813,7 @@ class VIEW3D_MT_edit_mesh_edges_data(Menu): class VIEW3D_MT_edit_mesh_edges(Menu): bl_label = "Edge" - def draw(self, _context): + def draw(self, context): layout = self.layout with_freestyle = bpy.app.build_options.freestyle @@ -3861,9 +3860,9 @@ class VIEW3D_MT_edit_mesh_edges(Menu): props.use_verts = True props.clear = True - if with_freestyle: + scene = context.scene + if with_freestyle or scene.lanpr.enabled or scene.render.engine=="BLENDER_LANPR": layout.separator() - layout.operator("mesh.mark_freestyle_edge").clear = False layout.operator("mesh.mark_freestyle_edge", text="Clear Freestyle Edge").clear = True @@ -3871,7 +3870,7 @@ class VIEW3D_MT_edit_mesh_edges(Menu): class VIEW3D_MT_edit_mesh_faces_data(Menu): bl_label = "Face Data" - def draw(self, _context): + def draw(self, context): layout = self.layout with_freestyle = bpy.app.build_options.freestyle @@ -3886,9 +3885,9 @@ class VIEW3D_MT_edit_mesh_faces_data(Menu): layout.operator("mesh.uvs_rotate") layout.operator("mesh.uvs_reverse") - layout.separator() - - if with_freestyle: + scene = context.scene + if with_freestyle or scene.lanpr.enabled or scene.render.engine=="BLENDER_LANPR": + layout.separator() layout.operator("mesh.mark_freestyle_face").clear = False layout.operator("mesh.mark_freestyle_face", text="Clear Freestyle Face").clear = True |