Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions infinigen/assets/objects/shelves/kitchen_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ def create_asset(self, **params):
parts.append(cabinet_bottom)

surface.add_geomod(cabinet_bottom, geometry_nodes_add_cabinet_top, apply=True)
# scale to make the heights of pholder and asset matched
scale_z = (cabinet_bottom_height+0.13) / cabinet_bottom.dimensions.z
cabinet_bottom.dimensions = cabinet_bottom.dimensions * scale_z

if not self.island:
# top
Expand Down Expand Up @@ -298,15 +301,20 @@ def create_asset(self, **params):
else:
raise NotImplementedError

bpy.ops.object.select_all(action="DESELECT")
# offset to make the height of the top mid the same as defined by dimension.z
z_offset = z - (top_mid.matrix_world @ Vector(butil.bounds(top_mid)[1])).z
cabinet_top_left.location.z = cabinet_top_left.location.z + z_offset
cabinet_top_right.location.z = cabinet_top_right.location.z + z_offset
top_mid.location.z = top_mid.location.z + z_offset

# parts += [sink, cabinet_top_left, cabinet_top_right, top_mid]
parts += [cabinet_top_left, cabinet_top_right, top_mid]

kitchen_space = butil.join_objects(
parts
) # [cabinet_bottom, sink, cabinet_top_left, cabinet_top_right, top_mid])

if not self.island:
kitchen_space.dimensions = self.dimensions
butil.apply_transform(kitchen_space)

tagging.tag_system.relabel_obj(kitchen_space)
Expand Down