mesh_object refuses an object in no collection

A deleted object a closure still points to stays in the file; attach, set_params,
report, boolean and every polish operator found it by name. The refusal moves from
close into mesh_object, which they all share (finding
cut-kit-joints.s2.attach-onto-orphan-and-ends-first-unpinned, part 1).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-12-02 02:00:19 +01:00
commit ae56f48d70
2 changed files with 2 additions and 3 deletions

View file

@ -498,9 +498,6 @@ class BROKKR_KITBASH_OT_close(PolishOperator):
other_part, other_built = built_part(other)
if obj == other:
raise Refused(f"{obj.name!r} cannot close on itself; nothing changed.")
for gone in (obj, other):
if not gone.users_collection:
raise Refused(f"{gone.name!r} is in no collection (a deleted object something still points to): a closure is between parts in the scene; nothing changed.")
if closure(obj) is not None:
raise Refused(f"{obj.name!r} already states a closure (its socket {closure(obj)[0]!r}): a part states one, and detach clears it; nothing changed.")
there, here = mated(other, other_part, other_built, obj, part, built, (self.socket, self.other_socket, 0.0), "closing on")

View file

@ -32,6 +32,8 @@ def mesh_object(name: str):
obj = bpy.data.objects.get(name)
if obj is None or obj.type != "MESH":
raise Refused(f"No mesh object named {name!r}.")
if not obj.users_collection:
raise Refused(f"{name!r} is in no collection (a deleted object something still points to); nothing changed.")
return obj