Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_grease_pencil_common.py
| Show First 20 Lines • Show All 606 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.material_select", text="Select").deselect = False | row.operator("gpencil.material_select", text="Select").deselect = False | ||||
| row.operator("gpencil.material_select", text="Deselect").deselect = True | row.operator("gpencil.material_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: | if len(ob.material_slots) > 0 and 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 gpcolor.stroke_style == 'SOLID': | if gpcolor.stroke_style == 'SOLID': | ||||
| row = layout.row() | row = layout.row() | ||||
| ▲ Show 20 Lines • Show All 299 Lines • Show Last 20 Lines | |||||