Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_node.py
| Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
| class NODE_HT_header(Header): | class NODE_HT_header(Header): | ||||
| bl_space_type = 'NODE_EDITOR' | bl_space_type = 'NODE_EDITOR' | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| scene = context.scene | scene = context.scene | ||||
| snode = context.space_data | snode = context.space_data | ||||
| overlay = snode.overlay | |||||
| snode_id = snode.id | snode_id = snode.id | ||||
| id_from = snode.id_from | id_from = snode.id_from | ||||
| tool_settings = context.tool_settings | tool_settings = context.tool_settings | ||||
| is_compositor = snode.tree_type == 'CompositorNodeTree' | is_compositor = snode.tree_type == 'CompositorNodeTree' | ||||
| layout.template_header() | layout.template_header() | ||||
| # Now expanded via the 'ui_type' | # Now expanded via the 'ui_type' | ||||
| ▲ Show 20 Lines • Show All 140 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| # Snap | # Snap | ||||
| row = layout.row(align=True) | row = layout.row(align=True) | ||||
| row.prop(tool_settings, "use_snap", text="") | row.prop(tool_settings, "use_snap", text="") | ||||
| row.prop(tool_settings, "snap_node_element", icon_only=True) | row.prop(tool_settings, "snap_node_element", icon_only=True) | ||||
| if tool_settings.snap_node_element != 'GRID': | if tool_settings.snap_node_element != 'GRID': | ||||
| row.prop(tool_settings, "snap_target", text="") | row.prop(tool_settings, "snap_target", text="") | ||||
| # Overlay toggle & popover | |||||
| row = layout.row(align=True) | |||||
| row.prop(overlay, "show_overlays", icon='OVERLAY', text="") | |||||
| sub = row.row(align=True) | |||||
| sub.active = overlay.show_overlays | |||||
| sub.popover(panel="NODE_PT_overlay", text="") | |||||
| class NODE_MT_editor_menus(Menu): | class NODE_MT_editor_menus(Menu): | ||||
| bl_idname = "NODE_MT_editor_menus" | bl_idname = "NODE_MT_editor_menus" | ||||
| bl_label = "" | bl_label = "" | ||||
| def draw(self, _context): | def draw(self, _context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.menu("NODE_MT_view") | layout.menu("NODE_MT_view") | ||||
| ▲ Show 20 Lines • Show All 459 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| col.prop(tree, "use_opencl") | col.prop(tree, "use_opencl") | ||||
| col.prop(tree, "use_groupnode_buffer") | col.prop(tree, "use_groupnode_buffer") | ||||
| col.prop(tree, "use_two_pass") | col.prop(tree, "use_two_pass") | ||||
| col.prop(tree, "use_viewer_border") | col.prop(tree, "use_viewer_border") | ||||
| col.separator() | col.separator() | ||||
| col.prop(snode, "use_auto_render") | col.prop(snode, "use_auto_render") | ||||
| class NODE_PT_overlay(Panel): | |||||
| bl_space_type = 'NODE_EDITOR' | |||||
| bl_region_type = 'HEADER' | |||||
| bl_label = "Overlays" | |||||
| bl_ui_units_x = 7 | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| layout.label(text="Node Editor Overlays") | |||||
HooglyBoogly: What about "Node Editor Overlays"? Feels a bit more complete to me. | |||||
| snode = context.space_data | |||||
| overlay = snode.overlay | |||||
| layout.active = overlay.show_overlays | |||||
| col = layout.column() | |||||
| col.prop(overlay, "show_wire_color", text="Wire Colors") | |||||
Done Inline ActionsAnother picky language thing, but maybe "Wire Colors" sounds a bit more natural and more like a noun than "Color Wires". Unless you were going for the "Color as a verb" thing. HooglyBoogly: Another picky language thing, but maybe "Wire Colors" sounds a bit more natural and more like a… | |||||
Done Inline ActionsIt was indeed written as verb but you're right it, "Wire Colors" sounds more natural. pablovazquez: It was indeed written as verb but you're right it, "Wire Colors" sounds more natural. | |||||
| col.separator() | |||||
Done Inline ActionsThis is a little ambiguous as it could mean "use dashed wires for everything". I suspect a better set of words might be "Dashed Field Wires" to better indicate that only the Field noodles will change. If "Field" isn't to be used in the UI, then maybe something else is still needed? deadpin: This is a little ambiguous as it could mean "use dashed wires for everything". I suspect a… | |||||
| col.prop(snode, "show_annotation", text="Annotations") | |||||
| class NODE_UL_interface_sockets(bpy.types.UIList): | class NODE_UL_interface_sockets(bpy.types.UIList): | ||||
| def draw_item(self, context, layout, _data, item, icon, _active_data, _active_propname, _index): | def draw_item(self, context, layout, _data, item, icon, _active_data, _active_propname, _index): | ||||
| socket = item | socket = item | ||||
| color = socket.draw_color(context) | color = socket.draw_color(context) | ||||
| if self.layout_type in {'DEFAULT', 'COMPACT'}: | if self.layout_type in {'DEFAULT', 'COMPACT'}: | ||||
| row = layout.row(align=True) | row = layout.row(align=True) | ||||
| ▲ Show 20 Lines • Show All 152 Lines • ▼ Show 20 Lines | classes = ( | ||||
| NODE_PT_active_node_generic, | NODE_PT_active_node_generic, | ||||
| NODE_PT_active_node_color, | NODE_PT_active_node_color, | ||||
| NODE_PT_active_node_properties, | NODE_PT_active_node_properties, | ||||
| NODE_PT_texture_mapping, | NODE_PT_texture_mapping, | ||||
| NODE_PT_active_tool, | NODE_PT_active_tool, | ||||
| NODE_PT_backdrop, | NODE_PT_backdrop, | ||||
| NODE_PT_quality, | NODE_PT_quality, | ||||
| NODE_PT_annotation, | NODE_PT_annotation, | ||||
| NODE_PT_overlay, | |||||
| NODE_UL_interface_sockets, | NODE_UL_interface_sockets, | ||||
| NODE_PT_node_tree_interface_inputs, | NODE_PT_node_tree_interface_inputs, | ||||
| NODE_PT_node_tree_interface_outputs, | NODE_PT_node_tree_interface_outputs, | ||||
| node_panel(EEVEE_MATERIAL_PT_settings), | node_panel(EEVEE_MATERIAL_PT_settings), | ||||
| node_panel(MATERIAL_PT_viewport), | node_panel(MATERIAL_PT_viewport), | ||||
| node_panel(WORLD_PT_viewport_display), | node_panel(WORLD_PT_viewport_display), | ||||
| node_panel(DATA_PT_light), | node_panel(DATA_PT_light), | ||||
| node_panel(DATA_PT_EEVEE_light), | node_panel(DATA_PT_EEVEE_light), | ||||
| ) | ) | ||||
| if __name__ == "__main__": # only for live edit. | if __name__ == "__main__": # only for live edit. | ||||
| from bpy.utils import register_class | from bpy.utils import register_class | ||||
| for cls in classes: | for cls in classes: | ||||
| register_class(cls) | register_class(cls) | ||||
What about "Node Editor Overlays"? Feels a bit more complete to me.