Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_grease_pencil_common.py
| Show First 20 Lines • Show All 886 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| row.operator("gpencil.stroke_change_color", text="Assign") | row.operator("gpencil.stroke_change_color", text="Assign") | ||||
| row.operator("gpencil.color_select", text="Select").deselect = False | row.operator("gpencil.color_select", text="Select").deselect = False | ||||
| row.operator("gpencil.color_select", text="Deselect").deselect = True | row.operator("gpencil.color_select", text="Deselect").deselect = True | ||||
| # stroke color | # stroke color | ||||
| ma = None | ma = None | ||||
| if is_view3d and brush is not None: | if is_view3d and brush is not None: | ||||
| gp_settings = brush.gpencil_settings | gp_settings = brush.gpencil_settings | ||||
| if gp_settings.use_material_pin is False: | if gp_settings.use_material_pin is False: | ||||
| if ob.active_material_index > 0: | |||||
| ma = ob.material_slots[ob.active_material_index].material | ma = ob.material_slots[ob.active_material_index].material | ||||
| else: | else: | ||||
| ma = gp_settings.material | ma = gp_settings.material | ||||
| if ma is not None and ma.grease_pencil is not None: | if ma is not None and ma.grease_pencil is not None: | ||||
| gpcolor = ma.grease_pencil | gpcolor = ma.grease_pencil | ||||
| if ( | if ( | ||||
| gpcolor.stroke_style == 'SOLID' or | gpcolor.stroke_style == 'SOLID' or | ||||
| gpcolor.use_stroke_pattern or | gpcolor.use_stroke_pattern or | ||||
| ▲ Show 20 Lines • Show All 69 Lines • Show Last 20 Lines | |||||