Merge pull request #367 from fi6/main

fix: Incompatible xformOpOrder
This commit is contained in:
Balakumar Sundaralingam
2024-11-16 18:34:07 -08:00
committed by GitHub

View File

@@ -63,6 +63,9 @@ def set_prim_translate(prim, translation):
def set_prim_transform( def set_prim_transform(
prim, pose: List[float], scale: List[float] = [1, 1, 1], use_float: bool = False prim, pose: List[float], scale: List[float] = [1, 1, 1], use_float: bool = False
): ):
if not prim.GetAttribute("xformOp:translate").IsValid():
UsdGeom.Xformable(prim).AddTranslateOp(UsdGeom.XformOp.PrecisionFloat)
if prim.GetAttribute("xformOp:orient").IsValid(): if prim.GetAttribute("xformOp:orient").IsValid():
if isinstance(prim.GetAttribute("xformOp:orient").Get(), Gf.Quatf): if isinstance(prim.GetAttribute("xformOp:orient").Get(), Gf.Quatf):
use_float = True use_float = True
@@ -70,8 +73,6 @@ def set_prim_transform(
UsdGeom.Xformable(prim).AddOrientOp(UsdGeom.XformOp.PrecisionFloat) UsdGeom.Xformable(prim).AddOrientOp(UsdGeom.XformOp.PrecisionFloat)
use_float = True use_float = True
if not prim.GetAttribute("xformOp:translate").IsValid():
UsdGeom.Xformable(prim).AddTranslateOp(UsdGeom.XformOp.PrecisionFloat)
if not prim.GetAttribute("xformOp:scale").IsValid(): if not prim.GetAttribute("xformOp:scale").IsValid():
UsdGeom.Xformable(prim).AddScaleOp(UsdGeom.XformOp.PrecisionFloat) UsdGeom.Xformable(prim).AddScaleOp(UsdGeom.XformOp.PrecisionFloat)
quat = pose[3:] quat = pose[3:]