(stage: Any, prim_path: str)
| 284 | |
| 285 | |
| 286 | def _default_scale_reader(stage: Any, prim_path: str) -> tuple[float, ...]: |
| 287 | from pxr import UsdGeom # type: ignore[import] |
| 288 | |
| 289 | prim = stage.GetPrimAtPath(prim_path) |
| 290 | if prim is None or (hasattr(prim, "IsValid") and not prim.IsValid()): |
| 291 | raise RuntimeError(f"Invalid prim for scale read: {prim_path}") |
| 292 | |
| 293 | scale = [1.0, 1.0, 1.0] |
| 294 | xformable = UsdGeom.Xformable(prim) |
| 295 | for op in xformable.GetOrderedXformOps(): |
| 296 | if op.GetOpType() != UsdGeom.XformOp.TypeScale: |
| 297 | continue |
| 298 | value = op.Get() |
| 299 | if value is None: |
| 300 | continue |
| 301 | scale[0] *= float(value[0]) |
| 302 | scale[1] *= float(value[1]) |
| 303 | scale[2] *= float(value[2]) |
| 304 | return tuple(scale) |
nothing calls this directly
no outgoing calls
no test coverage detected