Skip to content

Commit

Permalink
Version 1.11.1
Browse files Browse the repository at this point in the history
  • Loading branch information
clemense committed Nov 20, 2024
1 parent 06a2d28 commit 7f7ff94
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
7 changes: 6 additions & 1 deletion src/scene_synthesizer/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,12 @@ def _usd_prim_path_to_node_name(path):
scale = usd_import.get_scale(mesh_prim)
if not np.allclose(scale, [1.0, 1.0, 1.0]):
geometry.apply_scale(scale)


# Store the original mesh exents, note that this *includes* the file-specific
# scaling factor. During reference-based export we will use this information
# to infer any additional necessary scaling factor.
# Note: There might be a use case in which storing the extents *before* scaling
# the geometry is helpful.
utils.add_extents_to_trimesh_metadata(mesh_or_scene=geometry)

node_name = _usd_prim_path_to_node_name(mesh_path)
Expand Down
10 changes: 5 additions & 5 deletions tests/scene_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def _set_random_seed():
def test_mass():
_set_random_seed()

cabinet = synth.RecursivelyPartitionedCabinetAsset(
cabinet = pa.RecursivelyPartitionedCabinetAsset(
width=1, depth=1, height=1, use_box_handle=True
)

Expand Down Expand Up @@ -109,7 +109,7 @@ def test_volume_density_mass_consistency():
def test_density():
_set_random_seed()

cabinet = synth.RecursivelyPartitionedCabinetAsset(
cabinet = pa.RecursivelyPartitionedCabinetAsset(
width=1, depth=1, height=1, use_box_handle=True
)

Expand Down Expand Up @@ -408,7 +408,7 @@ def test_asset_function():
_set_random_seed()

scene = synth.Scene()
cabinet = synth.RecursivelyPartitionedCabinetAsset(
cabinet = pa.RecursivelyPartitionedCabinetAsset(
width=1, depth=1, height=1, use_box_handle=True
)
box = synth.BoxAsset(extents=[0.05, 0.05, 0.05], origin=("com", "com", "bottom"))
Expand All @@ -430,7 +430,7 @@ def test_rename_geometries():
_set_random_seed()

scene = synth.Scene()
cabinet = synth.RecursivelyPartitionedCabinetAsset(
cabinet = pa.RecursivelyPartitionedCabinetAsset(
width=1, depth=1, height=1, use_box_handle=True
)
box = synth.BoxAsset(extents=[0.05, 0.05, 0.05], origin=("com", "com", "bottom"))
Expand All @@ -450,7 +450,7 @@ def test_move_object():
_set_random_seed()

scene = synth.Scene()
cabinet = synth.RecursivelyPartitionedCabinetAsset(
cabinet = pa.RecursivelyPartitionedCabinetAsset(
width=1, depth=1, height=1, use_box_handle=True
)
box = synth.BoxAsset(extents=[0.05, 0.05, 0.05], origin=("com", "com", "bottom"))
Expand Down
2 changes: 1 addition & 1 deletion tests/usd_export_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def test_cabinet_usd_export(tmp_path):
usd_expected = str(TEST_DIR / "golden/cabinet_box_handles.usda")
usd_actual = str(Path(tmp_path) / "cabinet_box_handles.usda")

x = synth.RecursivelyPartitionedCabinetAsset(1, 2, 3, use_box_handle=True, seed=111).scene()
x = procedural_assets.RecursivelyPartitionedCabinetAsset(1, 2, 3, use_box_handle=True, seed=111).scene()
x.export(usd_actual)

assert filecmp.cmp(
Expand Down

0 comments on commit 7f7ff94

Please sign in to comment.