Skip to content

Commit

Permalink
Fixed a bug where all built BSP faces were being marked as read-only
Browse files Browse the repository at this point in the history
  • Loading branch information
cmbasnett committed Aug 8, 2024
1 parent 8dde552 commit f599446
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bdk_addon/bsp/operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,8 +774,8 @@ def _get_or_add_material(material: Optional[Material]) -> int:
# TODO: We can now have multiple brushes with the same object. We must only add the object once, and only if it
# is not part of an instance collection.
# TODO: this may even need to be done at the level of the data pointer.
concrete_brush_objects = filter(lambda x: x[1] is None, brush_objects)
for brush_index, (brush_object, instance_object, _) in enumerate(concrete_brush_objects):
concrete_brush_objects = filter(lambda x: len(x[1]) == 0, brush_objects)
for brush_index, (brush_object, _, _) in enumerate(concrete_brush_objects):
level_brush = level_object.bdk.level.brushes.add()
level_brush.index = brush_index
level_brush.brush_object = brush_object
Expand All @@ -788,9 +788,9 @@ def _get_or_add_material(material: Optional[Material]) -> int:
instanced_brush_indices = []

brushes: List[Brush] = []
for brush_index, (brush_object, asset_instance, matrix_world) in enumerate(brush_objects):
for brush_index, (brush_object, asset_instances, matrix_world) in enumerate(brush_objects):

if asset_instance is not None:
if asset_instances:
instanced_brush_indices.append(brush_index)

# Create a new Poly object for each face of the brush.
Expand Down

0 comments on commit f599446

Please sign in to comment.