Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_freestyle.py
| Show All 15 Lines | def poll(cls, context): | ||||
| with_freestyle = bpy.app.build_options.freestyle | with_freestyle = bpy.app.build_options.freestyle | ||||
| return scene and with_freestyle and (context.engine in cls.COMPAT_ENGINES) | return scene and with_freestyle and (context.engine in cls.COMPAT_ENGINES) | ||||
| class RENDER_PT_freestyle(RenderFreestyleButtonsPanel, Panel): | class RENDER_PT_freestyle(RenderFreestyleButtonsPanel, Panel): | ||||
| bl_label = "Freestyle" | bl_label = "Freestyle" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| bl_order = 10 | bl_order = 10 | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| rd = context.scene.render | rd = context.scene.render | ||||
| self.layout.prop(rd, "use_freestyle", text="") | self.layout.prop(rd, "use_freestyle", text="") | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| ▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | def poll(cls, context): | ||||
| view_layer | view_layer | ||||
| and view_layer.use_freestyle | and view_layer.use_freestyle | ||||
| and view_layer.freestyle_settings.mode == 'EDITOR' | and view_layer.freestyle_settings.mode == 'EDITOR' | ||||
| ) | ) | ||||
| class ViewLayerFreestyleLineStyle(ViewLayerFreestyleEditorButtonsPanel): | class ViewLayerFreestyleLineStyle(ViewLayerFreestyleEditorButtonsPanel): | ||||
| # Freestyle Linestyle Panels | # Freestyle Linestyle Panels | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| if not super().poll(context): | if not super().poll(context): | ||||
| return False | return False | ||||
| view_layer = context.view_layer | view_layer = context.view_layer | ||||
| lineset = view_layer.freestyle_settings.linesets.active | lineset = view_layer.freestyle_settings.linesets.active | ||||
| if lineset is None: | if lineset is None: | ||||
| Show All 27 Lines | class RENDER_MT_lineset_context_menu(Menu): | ||||
| def draw(self, _context): | def draw(self, _context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.operator("scene.freestyle_lineset_copy", icon='COPYDOWN') | layout.operator("scene.freestyle_lineset_copy", icon='COPYDOWN') | ||||
| layout.operator("scene.freestyle_lineset_paste", icon='PASTEDOWN') | layout.operator("scene.freestyle_lineset_paste", icon='PASTEDOWN') | ||||
| class VIEWLAYER_PT_freestyle(ViewLayerFreestyleButtonsPanel, Panel): | class VIEWLAYER_PT_freestyle(ViewLayerFreestyleButtonsPanel, Panel): | ||||
| bl_label = "Freestyle" | bl_label = "Freestyle" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| view_layer = context.view_layer | view_layer = context.view_layer | ||||
| rd = context.scene.render | rd = context.scene.render | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.active = rd.use_freestyle | layout.active = rd.use_freestyle | ||||
| Show All 13 Lines | def draw(self, context): | ||||
| col.prop(freestyle, "mode", text="Control Mode") | col.prop(freestyle, "mode", text="Control Mode") | ||||
| col.prop(freestyle, "use_view_map_cache", text="View Map Cache") | col.prop(freestyle, "use_view_map_cache", text="View Map Cache") | ||||
| col.prop(freestyle, "as_render_pass", text="As Render Pass") | col.prop(freestyle, "as_render_pass", text="As Render Pass") | ||||
| class VIEWLAYER_PT_freestyle_edge_detection(ViewLayerFreestyleButtonsPanel, Panel): | class VIEWLAYER_PT_freestyle_edge_detection(ViewLayerFreestyleButtonsPanel, Panel): | ||||
| bl_label = "Edge Detection" | bl_label = "Edge Detection" | ||||
| bl_parent_id = "VIEWLAYER_PT_freestyle" | bl_parent_id = "VIEWLAYER_PT_freestyle" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| layout.use_property_decorate = False | layout.use_property_decorate = False | ||||
| view_layer = context.view_layer | view_layer = context.view_layer | ||||
| freestyle = view_layer.freestyle_settings | freestyle = view_layer.freestyle_settings | ||||
| Show All 13 Lines | def draw(self, context): | ||||
| col.prop(freestyle, "use_suggestive_contours") | col.prop(freestyle, "use_suggestive_contours") | ||||
| col.prop(freestyle, "sphere_radius") | col.prop(freestyle, "sphere_radius") | ||||
| col.prop(freestyle, "kr_derivative_epsilon") | col.prop(freestyle, "kr_derivative_epsilon") | ||||
| class VIEWLAYER_PT_freestyle_style_modules(ViewLayerFreestyleButtonsPanel, Panel): | class VIEWLAYER_PT_freestyle_style_modules(ViewLayerFreestyleButtonsPanel, Panel): | ||||
| bl_label = "Style Modules" | bl_label = "Style Modules" | ||||
| bl_parent_id = "VIEWLAYER_PT_freestyle" | bl_parent_id = "VIEWLAYER_PT_freestyle" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| view_layer = context.view_layer | view_layer = context.view_layer | ||||
| freestyle = view_layer.freestyle_settings | freestyle = view_layer.freestyle_settings | ||||
| return freestyle.mode == 'SCRIPT' | return freestyle.mode == 'SCRIPT' | ||||
| def draw(self, context): | def draw(self, context): | ||||
| Show All 19 Lines | def draw(self, context): | ||||
| row.operator("scene.freestyle_module_open", icon='FILEBROWSER', text="") | row.operator("scene.freestyle_module_open", icon='FILEBROWSER', text="") | ||||
| row.operator("scene.freestyle_module_remove", icon='X', text="") | row.operator("scene.freestyle_module_remove", icon='X', text="") | ||||
| row.operator("scene.freestyle_module_move", icon='TRIA_UP', text="").direction = 'UP' | row.operator("scene.freestyle_module_move", icon='TRIA_UP', text="").direction = 'UP' | ||||
| row.operator("scene.freestyle_module_move", icon='TRIA_DOWN', text="").direction = 'DOWN' | row.operator("scene.freestyle_module_move", icon='TRIA_DOWN', text="").direction = 'DOWN' | ||||
| class VIEWLAYER_PT_freestyle_lineset(ViewLayerFreestyleEditorButtonsPanel, Panel): | class VIEWLAYER_PT_freestyle_lineset(ViewLayerFreestyleEditorButtonsPanel, Panel): | ||||
| bl_label = "Freestyle Line Set" | bl_label = "Freestyle Line Set" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw_edge_type_buttons(self, box, lineset, edge_type): | def draw_edge_type_buttons(self, box, lineset, edge_type): | ||||
| # property names | # property names | ||||
| select_edge_type = "select_" + edge_type | select_edge_type = "select_" + edge_type | ||||
| exclude_edge_type = "exclude_" + edge_type | exclude_edge_type = "exclude_" + edge_type | ||||
| # draw edge type buttons | # draw edge type buttons | ||||
| row = box.row(align=True) | row = box.row(align=True) | ||||
| row.prop(lineset, select_edge_type) | row.prop(lineset, select_edge_type) | ||||
| ▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| col.use_property_decorate = False | col.use_property_decorate = False | ||||
| col.prop(lineset, "select_by_image_border", text="Image Border") | col.prop(lineset, "select_by_image_border", text="Image Border") | ||||
| # Freestyle Lineset Sub Panels | # Freestyle Lineset Sub Panels | ||||
| class VIEWLAYER_PT_freestyle_lineset_visibilty(ViewLayerFreestyleLineStyle, Panel): | class VIEWLAYER_PT_freestyle_lineset_visibilty(ViewLayerFreestyleLineStyle, Panel): | ||||
| bl_label = "Visibility" | bl_label = "Visibility" | ||||
| bl_parent_id = "VIEWLAYER_PT_freestyle_lineset" | bl_parent_id = "VIEWLAYER_PT_freestyle_lineset" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| view_layer = context.view_layer | view_layer = context.view_layer | ||||
| freestyle = view_layer.freestyle_settings | freestyle = view_layer.freestyle_settings | ||||
| lineset = freestyle.linesets.active | lineset = freestyle.linesets.active | ||||
| Show All 17 Lines | def draw(self, context): | ||||
| col.use_property_split = True | col.use_property_split = True | ||||
| col.prop(lineset, "qi_start") | col.prop(lineset, "qi_start") | ||||
| col.prop(lineset, "qi_end") | col.prop(lineset, "qi_end") | ||||
| class VIEWLAYER_PT_freestyle_lineset_edgetype(ViewLayerFreestyleLineStyle, Panel): | class VIEWLAYER_PT_freestyle_lineset_edgetype(ViewLayerFreestyleLineStyle, Panel): | ||||
| bl_label = "Edge Type" | bl_label = "Edge Type" | ||||
| bl_parent_id = "VIEWLAYER_PT_freestyle_lineset" | bl_parent_id = "VIEWLAYER_PT_freestyle_lineset" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| view_layer = context.view_layer | view_layer = context.view_layer | ||||
| freestyle = view_layer.freestyle_settings | freestyle = view_layer.freestyle_settings | ||||
| lineset = freestyle.linesets.active | lineset = freestyle.linesets.active | ||||
| Show All 33 Lines | def draw(self, context): | ||||
| self.draw_edge_type_buttons(col, lineset, "material_boundary") | self.draw_edge_type_buttons(col, lineset, "material_boundary") | ||||
| self.draw_edge_type_buttons(col, lineset, "suggestive_contour") | self.draw_edge_type_buttons(col, lineset, "suggestive_contour") | ||||
| self.draw_edge_type_buttons(col, lineset, "ridge_valley") | self.draw_edge_type_buttons(col, lineset, "ridge_valley") | ||||
| class VIEWLAYER_PT_freestyle_lineset_facemarks(ViewLayerFreestyleLineStyle, Panel): | class VIEWLAYER_PT_freestyle_lineset_facemarks(ViewLayerFreestyleLineStyle, Panel): | ||||
| bl_label = "Face Marks" | bl_label = "Face Marks" | ||||
| bl_parent_id = "VIEWLAYER_PT_freestyle_lineset" | bl_parent_id = "VIEWLAYER_PT_freestyle_lineset" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| view_layer = context.view_layer | view_layer = context.view_layer | ||||
| freestyle = view_layer.freestyle_settings | freestyle = view_layer.freestyle_settings | ||||
| lineset = freestyle.linesets.active | lineset = freestyle.linesets.active | ||||
| Show All 12 Lines | def draw(self, context): | ||||
| layout.active = lineset.select_by_face_marks | layout.active = lineset.select_by_face_marks | ||||
| layout.row().prop(lineset, "face_mark_negation", expand=True, text="Negation") | layout.row().prop(lineset, "face_mark_negation", expand=True, text="Negation") | ||||
| layout.row().prop(lineset, "face_mark_condition", expand=True, text="Condition") | layout.row().prop(lineset, "face_mark_condition", expand=True, text="Condition") | ||||
| class VIEWLAYER_PT_freestyle_lineset_collection(ViewLayerFreestyleLineStyle, Panel): | class VIEWLAYER_PT_freestyle_lineset_collection(ViewLayerFreestyleLineStyle, Panel): | ||||
| bl_label = "Collection" | bl_label = "Collection" | ||||
| bl_parent_id = "VIEWLAYER_PT_freestyle_lineset" | bl_parent_id = "VIEWLAYER_PT_freestyle_lineset" | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| view_layer = context.view_layer | view_layer = context.view_layer | ||||
| freestyle = view_layer.freestyle_settings | freestyle = view_layer.freestyle_settings | ||||
| lineset = freestyle.linesets.active | lineset = freestyle.linesets.active | ||||
| ▲ Show 20 Lines • Show All 824 Lines • ▼ Show 20 Lines | def poll(cls, context): | ||||
| and scene.render.use_freestyle | and scene.render.use_freestyle | ||||
| and (context.engine in cls.COMPAT_ENGINES) | and (context.engine in cls.COMPAT_ENGINES) | ||||
| ) | ) | ||||
| class MATERIAL_PT_freestyle_line(MaterialFreestyleButtonsPanel, Panel): | class MATERIAL_PT_freestyle_line(MaterialFreestyleButtonsPanel, Panel): | ||||
| bl_label = "Freestyle Line" | bl_label = "Freestyle Line" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH','BLENDER_WORKBENCH_NEXT'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| layout.use_property_decorate = False | layout.use_property_decorate = False | ||||
| mat = context.material | mat = context.material | ||||
| Show All 37 Lines | |||||