USD: Skeleton and blend shape import #110912

Merged
Michael Kowalski merged 38 commits from makowalski/blender:usdskel_import into main 2023-08-17 20:11:58 +02:00
1 changed files with 3 additions and 0 deletions
Showing only changes of commit 85ad6b89a7 - Show all commits

View File

@ -169,6 +169,9 @@ std::optional<XformResult> USDXformReader::get_local_usd_xform(const float time)
return std::nullopt;
}
/* The USD bind transform is a matrix of doubles,
makowalski marked this conversation as resolved Outdated

As xform is already a pxr::GfMatrix4f, and that's the expected type for a XformResult, why is this cast necessary? Might be worth a comment.

As `xform` is already a `pxr::GfMatrix4f`, and that's the expected type for a `XformResult`, why is this cast necessary? Might be worth a comment.

That's a good point, and I've added a comment to explain this. xform is a matrix for doubles (GfMatrix4d), but Blender expects a matrix of floats, so I explicitly convert to a GfMatrix4f for the return value.

That's a good point, and I've added a comment to explain this. `xform` is a matrix for doubles (`GfMatrix4d`), but Blender expects a matrix of floats, so I explicitly convert to a `GfMatrix4f` for the return value.
* but we cast it to GfMatrix4f because Blender expects
* a matrix of floats. */
return XformResult(pxr::GfMatrix4f(xform), is_constant);
}