USD: Skeleton and blend shape import #110912
|
@ -995,9 +995,9 @@ Mesh *USDMeshReader::read_mesh(Mesh *existing_mesh,
|
|||
std::string USDMeshReader::get_skeleton_path() const
|
||||
{
|
||||
/* Make sure we can apply UsdSkelBindingAPI to the prim.
|
||||
* Attempting to apply the API to instance proxies or
|
||||
* prototypes generates an error. */
|
||||
if (!prim_ || prim_.IsInstanceProxy() || prim_.IsInPrototype()) {
|
||||
* Attempting to apply the API to instance proxies generates
|
||||
* a USD error. */
|
||||
if (!prim_ || prim_.IsInstanceProxy()) {
|
||||
return "";
|
||||
}
|
||||
|
||||
|
@ -1022,9 +1022,10 @@ bool USDMeshReader::get_local_usd_xform(const float time,
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!import_params_.import_skeletons || prim_.IsInstanceProxy() || prim_.IsInPrototype()) {
|
||||
if (!import_params_.import_skeletons || prim_.IsInstanceProxy()) {
|
||||
/* Use the standard transform computation, since we are ignoring
|
||||
makowalski marked this conversation as resolved
Outdated
|
||||
* skinning data. */
|
||||
* skinning data. Note that applying theUsdSkelBindingAPI to an
|
||||
* instance proxy generates a USD error. */
|
||||
return USDXformReader::get_local_usd_xform(time, r_xform, r_is_constant);
|
||||
}
|
||||
|
||||
|
|
|
@ -82,36 +82,15 @@ void add_bezt(FCurve *fcu,
|
|||
|
||||
namespace blender::io::usd {
|
||||
|
||||
//pxr::GfMatrix4d get_world_matrix(const pxr::UsdPrim &prim, pxr::UsdTimeCode time)
|
||||
//{
|
||||
// pxr::GfMatrix4d local_xf(1.0f);
|
||||
//
|
||||
// if (!prim) {
|
||||
// return local_xf;
|
||||
// }
|
||||
//
|
||||
// pxr::UsdGeomXformable xformable(prim);
|
||||
//
|
||||
// if (xformable) {
|
||||
// bool reset_xform_stack = false;
|
||||
// if (!xformable.GetLocalTransformation(&local_xf, &reset_xform_stack, time)) {
|
||||
// std::cout << "WARNING: couldn't get local xform for prim " << prim.GetPath() << std::endl;
|
||||
// return local_xf;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return local_xf * get_world_matrix(prim.GetParent(), time);
|
||||
//}
|
||||
|
||||
void import_blendshapes(Main *bmain, Object *obj, pxr::UsdPrim prim)
|
||||
{
|
||||
if (!(obj && obj->data && obj->type == OB_MESH && prim)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (prim.IsInstanceProxy() || prim.IsInPrototype()) {
|
||||
if (prim.IsInstanceProxy()) {
|
||||
/* Attempting to create a UsdSkelBindingAPI for
|
||||
* instance proxies and prototypes generates USD errors. */
|
||||
* instance proxies generates USD errors. */
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -535,9 +514,9 @@ void import_skel_bindings(Main *bmain, Object *mesh_obj, pxr::UsdPrim prim)
|
|||
return;
|
||||
}
|
||||
|
||||
if (prim.IsInstanceProxy() || prim.IsInPrototype()) {
|
||||
if (prim.IsInstanceProxy()) {
|
||||
/* Attempting to create a UsdSkelBindingAPI for
|
||||
* instance proxies and prototypes generates USD errors. */
|
||||
* instance proxies generates USD errors. */
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
theUsdSkelBindingAPI
missing space ;)