Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_view3d_toolbar.py
| Show First 20 Lines • Show All 1,193 Lines • ▼ Show 20 Lines | |||||
| class TEXTURE_UL_texpaintslots(UIList): | class TEXTURE_UL_texpaintslots(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): | ||||
| mat = data | mat = data | ||||
| if self.layout_type in {'DEFAULT', 'COMPACT'}: | if self.layout_type in {'DEFAULT', 'COMPACT'}: | ||||
| layout.prop(item, "name", text="", emboss=False, icon_value=icon) | layout.prop(item, "name", text="", emboss=False, icon_value=icon) | ||||
| if (not mat.use_nodes) and context.scene.render.engine in {'BLENDER_RENDER', 'BLENDER_GAME'}: | if (not mat.use_nodes) and context.engine in {'BLENDER_RENDER', 'BLENDER_GAME'}: | ||||
| mtex_index = mat.texture_paint_slots[index].index | mtex_index = mat.texture_paint_slots[index].index | ||||
| layout.prop(mat, "use_textures", text="", index=mtex_index) | layout.prop(mat, "use_textures", text="", index=mtex_index) | ||||
| elif self.layout_type == 'GRID': | elif self.layout_type == 'GRID': | ||||
| layout.alignment = 'CENTER' | layout.alignment = 'CENTER' | ||||
| layout.label(text="") | layout.label(text="") | ||||
| class VIEW3D_MT_tools_projectpaint_uvlayer(Menu): | class VIEW3D_MT_tools_projectpaint_uvlayer(Menu): | ||||
| ▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| mat, "texture_paint_images", | mat, "texture_paint_images", | ||||
| mat, "paint_active_slot", rows=2) | mat, "paint_active_slot", rows=2) | ||||
| if mat.texture_paint_slots: | if mat.texture_paint_slots: | ||||
| slot = mat.texture_paint_slots[mat.paint_active_slot] | slot = mat.texture_paint_slots[mat.paint_active_slot] | ||||
| else: | else: | ||||
| slot = None | slot = None | ||||
| if (not mat.use_nodes) and context.scene.render.engine in {'BLENDER_RENDER', 'BLENDER_GAME'}: | if (not mat.use_nodes) and context.engine in {'BLENDER_RENDER', 'BLENDER_GAME'}: | ||||
| row = col.row(align=True) | row = col.row(align=True) | ||||
| row.operator_menu_enum("paint.add_texture_paint_slot", "type") | row.operator_menu_enum("paint.add_texture_paint_slot", "type") | ||||
| row.operator("paint.delete_texture_paint_slot", text="", icon='X') | row.operator("paint.delete_texture_paint_slot", text="", icon='X') | ||||
| if slot: | if slot: | ||||
| col.prop(mat.texture_slots[slot.index], "blend_type") | col.prop(mat.texture_slots[slot.index], "blend_type") | ||||
| col.separator() | col.separator() | ||||
| ▲ Show 20 Lines • Show All 863 Lines • Show Last 20 Lines | |||||