Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
| Show All 33 Lines | def draw_item(self, _context, layout, _data, item, icon, _active_data, _active_propname, _index): | ||||
| surf = item | surf = item | ||||
| sticon = layout.enum_item_icon(surf, "surface_type", surf.surface_type) | sticon = layout.enum_item_icon(surf, "surface_type", surf.surface_type) | ||||
| if self.layout_type in {'DEFAULT', 'COMPACT'}: | if self.layout_type in {'DEFAULT', 'COMPACT'}: | ||||
| row = layout.row(align=True) | row = layout.row(align=True) | ||||
| row.label(text="", icon_value=icon) | row.label(text="", icon_value=icon) | ||||
| row.prop(surf, "name", text="", emboss=False, icon_value=sticon) | row.prop(surf, "name", text="", emboss=False, icon_value=sticon) | ||||
| row = layout.row(align=True) | row = layout.row(align=True) | ||||
| if surf.use_color_preview: | |||||
| row.prop( | |||||
| surf, | |||||
| "show_preview", | |||||
| text="", | |||||
| emboss=False, | |||||
| icon='RESTRICT_VIEW_OFF' if surf.show_preview else 'RESTRICT_VIEW_ON' | |||||
| ) | |||||
| row.prop(surf, "is_active", text="") | row.prop(surf, "is_active", text="") | ||||
| elif self.layout_type == 'GRID': | elif self.layout_type == 'GRID': | ||||
| layout.alignment = 'CENTER' | layout.alignment = 'CENTER' | ||||
| row = layout.row(align=True) | row = layout.row(align=True) | ||||
| row.label(text="", icon_value=icon) | row.label(text="", icon_value=icon) | ||||
| row.label(text="", icon_value=sticon) | row.label(text="", icon_value=sticon) | ||||
| ▲ Show 20 Lines • Show All 309 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| surface = canvas.canvas_surfaces.active | surface = canvas.canvas_surfaces.active | ||||
| ob = context.object | ob = context.object | ||||
| surface_type = surface.surface_type | surface_type = surface.surface_type | ||||
| # vertex format outputs. | # vertex format outputs. | ||||
| if surface.surface_format == 'VERTEX': | if surface.surface_format == 'VERTEX': | ||||
| if surface_type == 'PAINT': | if surface_type == 'PAINT': | ||||
| # toggle active preview. | |||||
| layout.prop(surface, "preview_id") | |||||
| # paint-map output. | # paint-map output. | ||||
| row = layout.row() | row = layout.row() | ||||
| row.prop_search(surface, "output_name_a", ob.data, "vertex_colors", text="Paintmap Layer") | row.prop_search(surface, "output_name_a", ob.data, "vertex_colors", text="Paintmap Layer") | ||||
| icons = 'REMOVE' if surface.output_exists(object=ob, index=0) else 'ADD' | icons = 'REMOVE' if surface.output_exists(object=ob, index=0) else 'ADD' | ||||
| row.operator("dpaint.output_toggle", icon=icons, text="").output = 'A' | row.operator("dpaint.output_toggle", icon=icons, text="").output = 'A' | ||||
| # wet-map output. | # wet-map output. | ||||
| ▲ Show 20 Lines • Show All 560 Lines • Show Last 20 Lines | |||||