Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_node.py
| Show First 20 Lines • Show All 369 Lines • ▼ Show 20 Lines | class NODE_PT_material_slots(Panel): | ||||
| bl_space_type = 'NODE_EDITOR' | bl_space_type = 'NODE_EDITOR' | ||||
| bl_region_type = 'HEADER' | bl_region_type = 'HEADER' | ||||
| bl_label = "Slot" | bl_label = "Slot" | ||||
| bl_ui_units_x = 12 | bl_ui_units_x = 12 | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| ob = context.object | ob = context.object | ||||
| self.bl_label = ( | self.bl_label = ( | ||||
| "Slot " + str(ob.active_material_index + 1) if ob.material_slots else | iface_("Slot %d") % (ob.active_material_index + 1) if ob.material_slots else | ||||
| "Slot" | iface_("Slot") | ||||
| ) | ) | ||||
| # Duplicate part of 'EEVEE_MATERIAL_PT_context_material'. | # Duplicate part of 'EEVEE_MATERIAL_PT_context_material'. | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| row = layout.row() | row = layout.row() | ||||
| col = row.column() | col = row.column() | ||||
| ▲ Show 20 Lines • Show All 525 Lines • Show Last 20 Lines | |||||