Compare commits

..

No commits in common. '22892ef702783b3651dc7d713b17f31841e2f87c' and '3939f6e64252a3a0ac65c2002f89baecc79ac443' have entirely different histories.

  1. 9
      korman/helpers.py

9
korman/helpers.py

@ -18,7 +18,6 @@ import bpy
from contextlib import contextmanager
import math
from typing import *
from uuid import uuid4
@contextmanager
def bmesh_from_object(bl):
@ -63,14 +62,12 @@ class GoodNeighbor:
@contextmanager
def TemporaryCollectionItem(collection):
item = collection.add()
# Blender may recreate the `item` instance as the collection grows and shrink...
# Assign it a unique name so we know which item to delete later on.
name = item.name = str(uuid4())
try:
yield item
finally:
index = collection.find(name)
collection.remove(index)
index = next((i for i, j in enumerate(collection) if j == item), None)
if index is not None:
collection.remove(index)
class TemporaryObject:
def __init__(self, obj, remove_func):

Loading…
Cancel
Save