Skip to content

Commit

Permalink
Update __init__.py
Browse files Browse the repository at this point in the history
Fixed small bug in the new Isolate by Material Trait operator. If the operator was used on a mesh object that had already been isolated and separated before, it was re-isolating it into another object, and then leaving an empty object (with no polygons) as well. The object is now correctly skipped if it detects that *all* of the mesh's faces are about to be isolated.
  • Loading branch information
theanine3D authored Dec 30, 2024
1 parent dc23b28 commit 8d6a7a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Material Batch Tools",
"description": "Batch tools for quickly modifying, copying, and pasting nodes on all materials in selected objects",
"author": "Theanine3D",
"version": (1, 5, 0),
"version": (1, 5, 1),
"blender": (3, 0, 0),
"category": "Material",
"location": "Properties -> Material Properties",
Expand Down Expand Up @@ -2026,6 +2026,8 @@ def execute(self, context):
materials_matched_count += 1

if len(matching_faces) > 0:
if len(obj.data.polygons) == len(matching_faces):
continue
separated_obj = separate_faces(obj, matching_faces)
separated_obj.name = obj.name + "_" + trait

Expand Down

0 comments on commit 8d6a7a0

Please sign in to comment.