From 378c95c5a68d86138ea4a525d842db0d8fc33f6c Mon Sep 17 00:00:00 2001 From: Lingjie Mei Date: Wed, 16 Oct 2024 05:36:49 -0400 Subject: [PATCH] Fix asset framing --- infinigen_examples/generate_individual_assets.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/infinigen_examples/generate_individual_assets.py b/infinigen_examples/generate_individual_assets.py index bcc7b810..cd954dcf 100644 --- a/infinigen_examples/generate_individual_assets.py +++ b/infinigen_examples/generate_individual_assets.py @@ -290,8 +290,9 @@ def build_and_save_asset(payload: dict): ) if args.cam_center > 0 and asset: - co = read_base_co(asset) + asset.location - center.location = (np.amin(co, 0) + np.amax(co, 0)) / 2 + co = read_base_co(asset) + location = (np.amin(co, 0) + np.amax(co, 0)) / 2 + center.location = (np.array(asset.matrix_world) @ np.array([*location, 1]))[:-1] center.location[-1] += args.cam_zoff if args.cam_dist <= 0 and asset: