Skip to content

Commit

Permalink
Remove vertex paint eraser toggle hack for Blender 4.3 since it's no …
Browse files Browse the repository at this point in the history
…longer necessary
  • Loading branch information
ucupumar committed Nov 15, 2024
1 parent e414fd0 commit cde28d9
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions vcol_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,34 +138,9 @@ def execute(self, context):
if mode == 'TEXTURE_PAINT':
context.tool_settings.image_paint.brush = new_brush

# HACK: Blender 4.3 sometimes can't set the active brush this way
if is_bl_newer_than(4, 3) and context.tool_settings.image_paint.brush != new_brush:
catalog_id = new_brush.asset_data.catalog_id if new_brush.asset_data else ''
try:
bpy.ops.brush.asset_activate(
asset_library_type='ESSENTIALS',
asset_library_identifier="",
relative_asset_identifier="brushes\\essentials_brushes-mesh_texture.blend\\Brush\\" + new_brush.name
)
except:
self.report({'ERROR'}, 'Cannot set the brush to \'' + new_brush.name + '\'!')
return {'CANCELLED'}

elif mode == 'VERTEX_PAINT':
context.tool_settings.vertex_paint.brush = new_brush

# HACK: Blender 4.3 sometimes can't set the active brush this way
if is_bl_newer_than(4, 3) and context.tool_settings.vertex_paint.brush != new_brush:
try:
bpy.ops.brush.asset_activate(
asset_library_type='ESSENTIALS',
asset_library_identifier="",
relative_asset_identifier="brushes\\essentials_brushes-mesh_vertex.blend\\Brush\\" + new_brush.name
)
except:
self.report({'ERROR'}, 'Cannot set the brush to \'' + new_brush.name + '\'!')
return {'CANCELLED'}

elif mode == 'SCULPT':
context.tool_settings.sculpt.brush = new_brush

Expand Down

0 comments on commit cde28d9

Please sign in to comment.