fix: Incompatible xformOpOrder
fix usd helper: [omni.usd._impl.utils] Incompatible xformOpOrder, translation applied before rotation or too many rotation ops.
This commit is contained in:
@@ -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:]
|
||||||
|
|||||||
Reference in New Issue
Block a user