diff --git a/package/com.unity.formats.usd/Editor/Scripts/Behaviors/UsdAssetEditor.cs b/package/com.unity.formats.usd/Editor/Scripts/Behaviors/UsdAssetEditor.cs index d951246e3..0771d395b 100644 --- a/package/com.unity.formats.usd/Editor/Scripts/Behaviors/UsdAssetEditor.cs +++ b/package/com.unity.formats.usd/Editor/Scripts/Behaviors/UsdAssetEditor.cs @@ -314,6 +314,7 @@ private void DrawSimpleInspector(UsdAsset usdAsset) usdAsset.m_importCameras = EditorGUILayout.Toggle("Import Cameras", usdAsset.m_importCameras); usdAsset.m_importMeshes = EditorGUILayout.Toggle("Import Meshes", usdAsset.m_importMeshes); usdAsset.m_importSkinning = EditorGUILayout.Toggle("Import Skinning", usdAsset.m_importSkinning); + usdAsset.m_importBlendShapes = EditorGUILayout.Toggle("Import BlendShapes", usdAsset.m_importBlendShapes); usdAsset.m_importTransforms = EditorGUILayout.Toggle("Import Transforms", usdAsset.m_importTransforms); if (EditorGUI.EndChangeCheck()) EditorUtility.SetDirty(usdAsset); diff --git a/package/com.unity.formats.usd/Runtime/Plugins/USD.NET.dll b/package/com.unity.formats.usd/Runtime/Plugins/USD.NET.dll index e3c03a3f2..e134dc0a8 100644 Binary files a/package/com.unity.formats.usd/Runtime/Plugins/USD.NET.dll and b/package/com.unity.formats.usd/Runtime/Plugins/USD.NET.dll differ diff --git a/package/com.unity.formats.usd/Runtime/Plugins/x86_64/Windows/UsdCs.dll b/package/com.unity.formats.usd/Runtime/Plugins/x86_64/Windows/UsdCs.dll index 5f4dea452..3ecda4b31 100644 Binary files a/package/com.unity.formats.usd/Runtime/Plugins/x86_64/Windows/UsdCs.dll and b/package/com.unity.formats.usd/Runtime/Plugins/x86_64/Windows/UsdCs.dll differ diff --git a/package/com.unity.formats.usd/Runtime/Scripts/Behaviors/UsdAsset.cs b/package/com.unity.formats.usd/Runtime/Scripts/Behaviors/UsdAsset.cs index 0c257f8a2..c6827ec34 100644 --- a/package/com.unity.formats.usd/Runtime/Scripts/Behaviors/UsdAsset.cs +++ b/package/com.unity.formats.usd/Runtime/Scripts/Behaviors/UsdAsset.cs @@ -160,6 +160,7 @@ [HideInInspector] [Tooltip("When enabled, set the GPU Instancing flag on all mat public bool m_importCameras = true; public bool m_importMeshes = true; public bool m_importSkinning = true; + public bool m_importBlendShapes = true; public bool m_importTransforms = true; public bool m_importSceneInstances = true; public bool m_importPointInstances = true; @@ -264,6 +265,7 @@ public void OptionsToState(SceneImportOptions options) m_importCameras = options.importCameras; m_importMeshes = options.importMeshes; m_importSkinning = options.importSkinning; + m_importBlendShapes = options.importBlendShapes; m_importHierarchy = options.importHierarchy; m_importTransforms = options.importTransforms; m_importSceneInstances = options.importSceneInstances; @@ -317,6 +319,7 @@ public void StateToOptions(ref SceneImportOptions options) options.importCameras = m_importCameras; options.importMeshes = m_importMeshes; options.importSkinning = m_importSkinning; + options.importBlendShapes = m_importBlendShapes; options.importHierarchy = m_importHierarchy; options.importTransforms = m_importTransforms; options.importSceneInstances = m_importSceneInstances; @@ -751,6 +754,7 @@ public static void PrepOptionsForTimeChange(ref SceneImportOptions options) options.meshOptions.generateLightmapUVs = false; options.importSkinWeights = false; + options.importBlendShapeTargets = false; // Note that tangent and Normals must be updated when the mesh deforms. options.importHierarchy = false; diff --git a/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/SceneImportOptions.cs b/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/SceneImportOptions.cs index 339c99cab..1d1541689 100644 --- a/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/SceneImportOptions.cs +++ b/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/SceneImportOptions.cs @@ -103,6 +103,8 @@ public class SceneImportOptions public bool importMeshes = true; public bool importSkinning = true; public bool importSkinWeights = true; + public bool importBlendShapeTargets = true; + public bool importBlendShapes = true; public bool importTransforms = true; public bool importSceneInstances = true; public bool importPointInstances = true; diff --git a/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/SceneImporter.cs b/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/SceneImporter.cs index 996f4e5d9..00ae339f6 100644 --- a/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/SceneImporter.cs +++ b/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/SceneImporter.cs @@ -960,7 +960,7 @@ public static IEnumerator BuildScene(Scene scene, // // SkinnedMesh bone bindings. // - if (importOptions.importSkinning) + if (importOptions.importSkinning || importOptions.importBlendShapes) { Profiler.BeginSample("USD: Build Skeletons"); var skeletonSamples = new Dictionary(); @@ -989,6 +989,7 @@ public static IEnumerator BuildScene(Scene scene, Profiler.BeginSample("Build Bind Transforms"); var skelPath = skelBinding.GetSkeleton().GetPath(); SkeletonSample skelSample = null; + if (!skeletonSamples.TryGetValue(skelPath, out skelSample)) { skelSample = new SkeletonSample(); @@ -1026,43 +1027,87 @@ public static IEnumerator BuildScene(Scene scene, Profiler.EndSample(); - if (importOptions.importSkinWeights) + if (importOptions.importSkinWeights || importOptions.importBlendShapeTargets) { // // Apply skinning weights to each skinned mesh. // - Profiler.BeginSample("Apply Skin Weights"); + Profiler.BeginSample("Apply Skin Weights and Blend Shapes"); foreach (var skinningQuery in skelBinding.GetSkinningTargetsAsVector()) { + pxr.SdfPath meshPath = skinningQuery.GetPrim().GetPath(); - try - { - var goMesh = primMap[meshPath]; - - Profiler.BeginSample("Build Skinned Mesh"); - SkeletonImporter.BuildSkinnedMesh( - meshPath, - skelPath, - skelSample, - skinningQuery, - goMesh, - primMap, - importOptions); - Profiler.EndSample(); + var goMesh = primMap[meshPath]; - // In terms of performance, this is almost free. - // TODO: Check if this is correct or should be something specific (not always the first child). - goMesh.GetComponent().rootBone = - primMap[skelPath].transform.GetChild(0); + + if (importOptions.importSkinWeights && skinningQuery.HasJointInfluences()) + { + try + { + + Profiler.BeginSample("Build Skinned Mesh"); + SkeletonImporter.BuildSkinnedMesh( + meshPath, + skelPath, + skelSample, + skinningQuery, + goMesh, + primMap, + importOptions); + Profiler.EndSample(); + + // In terms of performance, this is almost free. + SkinnedMeshRenderer smr = goMesh.GetComponent(); + smr.sharedMesh.ClearBlendShapes(); + // TODO: Check if this is correct or should be something specific (not always the first child). + smr.rootBone = primMap[skelPath].transform.GetChild(0); + } + catch (System.Exception ex) + { + Debug.LogException(new ImportException("Error skinning mesh: " + meshPath, + ex)); + } } - catch (System.Exception ex) + + if (importOptions.importBlendShapeTargets && skinningQuery.HasBlendShapes()) { - Debug.LogException(new ImportException("Error skinning mesh: " + meshPath, ex)); + try + { + Profiler.BeginSample("Add Blend Shapes"); + BlendShapeImporter.BuildBlendShapeTargets( + meshPath, + goMesh, + scene, + skinningQuery, + importOptions); + Profiler.EndSample(); + } + catch (System.Exception ex) + { + Debug.LogException(new ImportException($"Error adding blend shapes: {meshPath}", ex)); + } } } + Profiler.EndSample(); } + + Profiler.BeginSample("Apply Blend Shape Weights"); + if (importOptions.importBlendShapes) + { + foreach (var skinningQuery in skelBinding.GetSkinningTargetsAsVector()) + { + if (skinningQuery.HasBlendShapes()) + { + var go = primMap[skinningQuery.GetPrim().GetPath()]; + Profiler.BeginSample("Build Blend Shape Weights"); + BlendShapeImporter.BuildBlendShapeWeights(go, scene, skinningQuery); + Profiler.EndSample(); + } + } + } + Profiler.EndSample(); } } catch (System.Exception ex) diff --git a/package/com.unity.formats.usd/Runtime/Scripts/IO/Skel/BlendShapeImporter.cs b/package/com.unity.formats.usd/Runtime/Scripts/IO/Skel/BlendShapeImporter.cs new file mode 100644 index 000000000..28b2bd9cd --- /dev/null +++ b/package/com.unity.formats.usd/Runtime/Scripts/IO/Skel/BlendShapeImporter.cs @@ -0,0 +1,157 @@ +using System; +using System.Collections.Generic; +using System.Net; +using pxr; +using UnityEngine; +using UnityEngine.Profiling; +using USD.NET; +using USD.NET.Unity; + +namespace Unity.Formats.USD +{ + public static class BlendShapeImporter + { + public static void BuildBlendShapeTargets( + string meshPath, + GameObject go, + Scene scene, + UsdSkelSkinningQuery skinningQuery, + SceneImportOptions options + ) + { + if (!skinningQuery.HasBlendShapes()) + { + return; + } + + var smr = go.GetComponent(); + if (!smr) + { + throw new Exception( + $"Error importing {meshPath} SkinnedMeshRenderer not present on GameObject" + ); + } + + var mesh = smr.sharedMesh; + mesh.ClearBlendShapes(); + + Dictionary blendShapeSamples = new Dictionary(); + var skelBindingApi = new UsdSkelBindingAPI(skinningQuery.GetPrim()); + var blendShapeQuery = new UsdSkelBlendShapeQuery(skelBindingApi); + + for (uint i = 0; i < blendShapeQuery.GetNumBlendShapes(); ++i) + { + BlendShapeSample blendShapeSample = new BlendShapeSample(); + var blendShape = blendShapeQuery.GetBlendShape(i).GetPrim(); + scene.Read(blendShape.GetPath(), blendShapeSample); + blendShapeSamples[blendShape.GetName()] = blendShapeSample; + } + + bool changeHandedness = options.changeHandedness == BasisTransformation.SlowAndSafe || + options.changeHandedness == BasisTransformation.SlowAndSafeAsFBX; + + VtTokenArray blendShapeOrder = new VtTokenArray(); + skinningQuery.GetBlendShapeOrder(blendShapeOrder); + + Profiler.BeginSample("Add Blend Shape Offsets"); + for (int i = 0; i < blendShapeQuery.GetNumBlendShapes(); ++i) + { + var blendShapeName = blendShapeOrder[i].ToString(); + var blendShapeIndices = blendShapeSamples[blendShapeName].pointIndices; + var blendShapeOffsets = blendShapeSamples[blendShapeName].offsets; + var blendShapeNormalOffsets = blendShapeSamples[blendShapeName].normalOffsets; + + if (blendShapeIndices != null && blendShapeIndices?.Length != mesh.vertexCount) + { + Vector3[] offsets = new Vector3[mesh.vertexCount]; + Vector3[] normalOffsets = new Vector3[mesh.vertexCount]; + for (int j = 0; j < blendShapeIndices?.Length; ++j) + { + int blendIndex = blendShapeIndices[j]; + offsets[blendIndex] = blendShapeOffsets[j]; + normalOffsets[blendIndex] = blendShapeNormalOffsets[j]; + if (changeHandedness) + { + offsets[blendIndex] = UnityTypeConverter.ChangeBasis(offsets[blendIndex]); + normalOffsets[blendIndex] = UnityTypeConverter.ChangeBasis(normalOffsets[blendIndex]); + } + } + mesh.AddBlendShapeFrame(blendShapeName, 100f, + offsets, normalOffsets, null); + } + else + { + if (changeHandedness) + { + Vector3[] offsets = new Vector3[mesh.vertexCount]; + Vector3[] normalOffsets = new Vector3[mesh.vertexCount]; + for (int j = 0; j < mesh.vertexCount; ++j) + { + offsets[j] = UnityTypeConverter.ChangeBasis(blendShapeOffsets[j]); + normalOffsets[j] = UnityTypeConverter.ChangeBasis(blendShapeNormalOffsets[j]); + } + mesh.AddBlendShapeFrame(blendShapeName, 100f, + offsets, normalOffsets, null); + } + else + { + mesh.AddBlendShapeFrame(blendShapeName, 100f, + blendShapeOffsets, blendShapeNormalOffsets, null); + } + } + } + Profiler.EndSample(); + } + + public static void BuildBlendShapeWeights( + GameObject go, + Scene scene, + UsdSkelSkinningQuery skinningQuery + ) + { + Profiler.BeginSample("Get Skeleton"); + var skelBindingApi = new UsdSkelBindingAPI(skinningQuery.GetPrim()); + var skeletonTargets = skelBindingApi.GetSkeletonRel().GetForwardedTargets(); + Profiler.EndSample(); + if (skeletonTargets.Count == 0) + { + return; + } + Profiler.BeginSample("Get Animation Target"); + skelBindingApi = new UsdSkelBindingAPI(scene.GetPrimAtPath(skeletonTargets[0])); + var animTargets = skelBindingApi.GetAnimationSourceRel().GetForwardedTargets(); + Profiler.EndSample(); + if (animTargets.Count == 0) + { + return; + } + + Profiler.BeginSample("Get SkelAnim"); + var skelAnimTarget = scene.GetPrimAtPath(animTargets[0]); + var skelAnimation = new UsdSkelAnimation(skelAnimTarget); + var skelAnimSample = new SkelAnimationSample(); + Profiler.EndSample(); + + Profiler.BeginSample("Read Animation Sample"); + scene.Read(skelAnimation.GetPath(), skelAnimSample); + Profiler.EndSample(); + + Profiler.BeginSample("Get Skinned Mesh"); + var smr = go.GetComponent(); + if (!smr) + { + throw new Exception( + $"Error settingWeights on {skinningQuery.GetPrim().GetPath()} SkinnedMeshRenderer not present on GameObject" + ); + } + Profiler.EndSample(); + + Profiler.BeginSample("Set Blend Shape Weights"); + for (int i = 0; i < skelAnimSample.blendShapeWeights.Length; ++i) + { + smr.SetBlendShapeWeight(i, skelAnimSample.blendShapeWeights[i] * 100f); + } + Profiler.EndSample(); + } + } +} diff --git a/package/com.unity.formats.usd/Runtime/Scripts/IO/Skel/BlendShapeImporter.cs.meta b/package/com.unity.formats.usd/Runtime/Scripts/IO/Skel/BlendShapeImporter.cs.meta new file mode 100644 index 000000000..3963d6514 --- /dev/null +++ b/package/com.unity.formats.usd/Runtime/Scripts/IO/Skel/BlendShapeImporter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f850c6a04a11530479f2d7a51f6d7474 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/package/com.unity.formats.usd/Runtime/Scripts/IO/Skel/SkeletonIo.cs b/package/com.unity.formats.usd/Runtime/Scripts/IO/Skel/SkeletonIo.cs index 2a6443e59..19a750012 100644 --- a/package/com.unity.formats.usd/Runtime/Scripts/IO/Skel/SkeletonIo.cs +++ b/package/com.unity.formats.usd/Runtime/Scripts/IO/Skel/SkeletonIo.cs @@ -88,15 +88,16 @@ public class SkelAnimationSample : SampleBase [UsdVariability(Variability.Uniform)] public string[] blendShapes; - [UsdVariability(Variability.Uniform)] public float[] blendShapeWeights; + public float[] blendShapeWeights; } [System.Serializable] [UsdSchema("BlendShape")] public class BlendShapeSample : SampleBase { - public Vector3[] offsets; - public uint[] pointIndices; + [UsdVariability(Variability.Uniform)] public Vector3[] offsets; + [UsdVariability(Variability.Uniform)] public Vector3[] normalOffsets; + [UsdVariability(Variability.Uniform)] public int[] pointIndices; } public class SkeletonIo diff --git a/src/Swig/pxr/usd/usdSkel/usdSkel.i b/src/Swig/pxr/usd/usdSkel/usdSkel.i index 753ee6007..c97623e93 100644 --- a/src/Swig/pxr/usd/usdSkel/usdSkel.i +++ b/src/Swig/pxr/usd/usdSkel/usdSkel.i @@ -27,6 +27,7 @@ %include "usdSkelSkeleton.i" %include "usdSkelSkeletonQuery.i" %include "usdSkelSkinningQuery.i" +%include "usdSkelBlendShapeQuery.i" %include "usdSkelTopology.i" %include "usdSkelUtils.i" diff --git a/src/Swig/pxr/usd/usdSkel/usdSkelBlendShapeQuery.i b/src/Swig/pxr/usd/usdSkel/usdSkelBlendShapeQuery.i new file mode 100644 index 000000000..ec3c819ce --- /dev/null +++ b/src/Swig/pxr/usd/usdSkel/usdSkelBlendShapeQuery.i @@ -0,0 +1,10 @@ +%module UsdSkelSkinningQuery +%{ +#include "pxr/usd/usdSkel/blendShapeQuery.h" +#include "pxr/base/vt/array.h" +%} + +// TODO: Need type AnimMapperRefPtr. +%ignore UsdSkelBlendShapeQuery::GetMapper; + +%include "pxr/usd/usdSkel/blendShapeQuery.h" diff --git a/src/USD.NET/generated/SWIG/SWIGTYPE_p_TfSpanT_unsigned_int_const_t.cs b/src/USD.NET/generated/SWIG/SWIGTYPE_p_TfSpanT_unsigned_int_const_t.cs new file mode 100644 index 000000000..959ead543 --- /dev/null +++ b/src/USD.NET/generated/SWIG/SWIGTYPE_p_TfSpanT_unsigned_int_const_t.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 3.0.12 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ + +namespace pxr { + +public class SWIGTYPE_p_TfSpanT_unsigned_int_const_t { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + internal SWIGTYPE_p_TfSpanT_unsigned_int_const_t(global::System.IntPtr cPtr, bool futureUse) { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + protected SWIGTYPE_p_TfSpanT_unsigned_int_const_t() { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_TfSpanT_unsigned_int_const_t obj) { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } +} + +} diff --git a/src/USD.NET/generated/SWIG/SWIGTYPE_p_std__vectorT_VtArrayT_int_t_t.cs b/src/USD.NET/generated/SWIG/SWIGTYPE_p_std__vectorT_VtArrayT_int_t_t.cs new file mode 100644 index 000000000..2b44da0e3 --- /dev/null +++ b/src/USD.NET/generated/SWIG/SWIGTYPE_p_std__vectorT_VtArrayT_int_t_t.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 3.0.12 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ + +namespace pxr { + +public class SWIGTYPE_p_std__vectorT_VtArrayT_int_t_t { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + internal SWIGTYPE_p_std__vectorT_VtArrayT_int_t_t(global::System.IntPtr cPtr, bool futureUse) { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + protected SWIGTYPE_p_std__vectorT_VtArrayT_int_t_t() { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_std__vectorT_VtArrayT_int_t_t obj) { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } +} + +} diff --git a/src/USD.NET/generated/pxr/usd/usdSkel/UsdSkelBlendShapeQuery.cs b/src/USD.NET/generated/pxr/usd/usdSkel/UsdSkelBlendShapeQuery.cs new file mode 100644 index 000000000..b116caad7 --- /dev/null +++ b/src/USD.NET/generated/pxr/usd/usdSkel/UsdSkelBlendShapeQuery.cs @@ -0,0 +1,136 @@ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 3.0.12 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ + +namespace pxr { + +public class UsdSkelBlendShapeQuery : global::System.IDisposable { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + protected bool swigCMemOwn; + + internal UsdSkelBlendShapeQuery(global::System.IntPtr cPtr, bool cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(UsdSkelBlendShapeQuery obj) { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + ~UsdSkelBlendShapeQuery() { + Dispose(); + } + + public virtual void Dispose() { + lock(this) { + if (swigCPtr.Handle != global::System.IntPtr.Zero) { + if (swigCMemOwn) { + swigCMemOwn = false; + UsdCsPINVOKE.delete_UsdSkelBlendShapeQuery(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + global::System.GC.SuppressFinalize(this); + } + } + + public UsdSkelBlendShapeQuery() : this(UsdCsPINVOKE.new_UsdSkelBlendShapeQuery__SWIG_0(), true) { + } + + public UsdSkelBlendShapeQuery(UsdSkelBindingAPI binding) : this(UsdCsPINVOKE.new_UsdSkelBlendShapeQuery__SWIG_1(UsdSkelBindingAPI.getCPtr(binding)), true) { + if (UsdCsPINVOKE.SWIGPendingException.Pending) throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); + } + + public bool IsValid() { + bool ret = UsdCsPINVOKE.UsdSkelBlendShapeQuery_IsValid(swigCPtr); + return ret; + } + + public UsdPrim GetPrim() { + UsdPrim ret = new UsdPrim(UsdCsPINVOKE.UsdSkelBlendShapeQuery_GetPrim(swigCPtr), false); + return ret; + } + + public UsdSkelBlendShape GetBlendShape(uint blendShapeIndex) { + UsdSkelBlendShape ret = new UsdSkelBlendShape(UsdCsPINVOKE.UsdSkelBlendShapeQuery_GetBlendShape(swigCPtr, blendShapeIndex), true); + return ret; + } + + public UsdSkelInbetweenShape GetInbetween(uint subShapeIndex) { + UsdSkelInbetweenShape ret = new UsdSkelInbetweenShape(UsdCsPINVOKE.UsdSkelBlendShapeQuery_GetInbetween(swigCPtr, subShapeIndex), true); + return ret; + } + + public uint GetBlendShapeIndex(uint subShapeIndex) { + uint ret = UsdCsPINVOKE.UsdSkelBlendShapeQuery_GetBlendShapeIndex(swigCPtr, subShapeIndex); + return ret; + } + + public uint GetNumBlendShapes() { + uint ret = UsdCsPINVOKE.UsdSkelBlendShapeQuery_GetNumBlendShapes(swigCPtr); + return ret; + } + + public uint GetNumSubShapes() { + uint ret = UsdCsPINVOKE.UsdSkelBlendShapeQuery_GetNumSubShapes(swigCPtr); + return ret; + } + + public SWIGTYPE_p_std__vectorT_VtArrayT_int_t_t ComputeBlendShapePointIndices() { + SWIGTYPE_p_std__vectorT_VtArrayT_int_t_t ret = new SWIGTYPE_p_std__vectorT_VtArrayT_int_t_t(UsdCsPINVOKE.UsdSkelBlendShapeQuery_ComputeBlendShapePointIndices(swigCPtr), true); + return ret; + } + + public VtVec3fArrayVector ComputeSubShapePointOffsets() { + VtVec3fArrayVector ret = new VtVec3fArrayVector(UsdCsPINVOKE.UsdSkelBlendShapeQuery_ComputeSubShapePointOffsets(swigCPtr), true); + return ret; + } + + public VtVec3fArrayVector ComputeSubShapeNormalOffsets() { + VtVec3fArrayVector ret = new VtVec3fArrayVector(UsdCsPINVOKE.UsdSkelBlendShapeQuery_ComputeSubShapeNormalOffsets(swigCPtr), true); + return ret; + } + + public bool ComputeSubShapeWeights(SWIGTYPE_p_TfSpanT_float_const_t weights, VtFloatArray subShapeWeights, VtUIntArray blendShapeIndices, VtUIntArray subShapeIndices) { + bool ret = UsdCsPINVOKE.UsdSkelBlendShapeQuery_ComputeSubShapeWeights(swigCPtr, SWIGTYPE_p_TfSpanT_float_const_t.getCPtr(weights), VtFloatArray.getCPtr(subShapeWeights), VtUIntArray.getCPtr(blendShapeIndices), VtUIntArray.getCPtr(subShapeIndices)); + if (UsdCsPINVOKE.SWIGPendingException.Pending) throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public bool ComputeFlattenedSubShapeWeights(SWIGTYPE_p_TfSpanT_float_const_t weights, VtFloatArray subShapeWeights) { + bool ret = UsdCsPINVOKE.UsdSkelBlendShapeQuery_ComputeFlattenedSubShapeWeights(swigCPtr, SWIGTYPE_p_TfSpanT_float_const_t.getCPtr(weights), VtFloatArray.getCPtr(subShapeWeights)); + if (UsdCsPINVOKE.SWIGPendingException.Pending) throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public bool ComputeDeformedPoints(SWIGTYPE_p_TfSpanT_float_const_t subShapeWeights, SWIGTYPE_p_TfSpanT_unsigned_int_const_t blendShapeIndices, SWIGTYPE_p_TfSpanT_unsigned_int_const_t subShapeIndices, SWIGTYPE_p_std__vectorT_VtArrayT_int_t_t blendShapePointIndices, VtVec3fArrayVector subShapePointOffsets, SWIGTYPE_p_TfSpanT_GfVec3f_t points) { + bool ret = UsdCsPINVOKE.UsdSkelBlendShapeQuery_ComputeDeformedPoints(swigCPtr, SWIGTYPE_p_TfSpanT_float_const_t.getCPtr(subShapeWeights), SWIGTYPE_p_TfSpanT_unsigned_int_const_t.getCPtr(blendShapeIndices), SWIGTYPE_p_TfSpanT_unsigned_int_const_t.getCPtr(subShapeIndices), SWIGTYPE_p_std__vectorT_VtArrayT_int_t_t.getCPtr(blendShapePointIndices), VtVec3fArrayVector.getCPtr(subShapePointOffsets), SWIGTYPE_p_TfSpanT_GfVec3f_t.getCPtr(points)); + if (UsdCsPINVOKE.SWIGPendingException.Pending) throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public bool ComputeDeformedNormals(SWIGTYPE_p_TfSpanT_float_const_t subShapeWeights, SWIGTYPE_p_TfSpanT_unsigned_int_const_t blendShapeIndices, SWIGTYPE_p_TfSpanT_unsigned_int_const_t subShapeIndices, SWIGTYPE_p_std__vectorT_VtArrayT_int_t_t blendShapePointIndices, VtVec3fArrayVector subShapeNormalOffsets, SWIGTYPE_p_TfSpanT_GfVec3f_t noramls) { + bool ret = UsdCsPINVOKE.UsdSkelBlendShapeQuery_ComputeDeformedNormals(swigCPtr, SWIGTYPE_p_TfSpanT_float_const_t.getCPtr(subShapeWeights), SWIGTYPE_p_TfSpanT_unsigned_int_const_t.getCPtr(blendShapeIndices), SWIGTYPE_p_TfSpanT_unsigned_int_const_t.getCPtr(subShapeIndices), SWIGTYPE_p_std__vectorT_VtArrayT_int_t_t.getCPtr(blendShapePointIndices), VtVec3fArrayVector.getCPtr(subShapeNormalOffsets), SWIGTYPE_p_TfSpanT_GfVec3f_t.getCPtr(noramls)); + if (UsdCsPINVOKE.SWIGPendingException.Pending) throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public bool ComputePackedShapeTable(VtVec4fArray offsets, VtVec2iArray ranges) { + bool ret = UsdCsPINVOKE.UsdSkelBlendShapeQuery_ComputePackedShapeTable(swigCPtr, VtVec4fArray.getCPtr(offsets), VtVec2iArray.getCPtr(ranges)); + return ret; + } + + public string GetDescription() { + string ret = UsdCsPINVOKE.UsdSkelBlendShapeQuery_GetDescription(swigCPtr); + return ret; + } + +} + +} diff --git a/src/USD.NET/generated/usdCs/UsdCsPINVOKE.cs b/src/USD.NET/generated/usdCs/UsdCsPINVOKE.cs index fc3e936a8..2b4ecee24 100644 --- a/src/USD.NET/generated/usdCs/UsdCsPINVOKE.cs +++ b/src/USD.NET/generated/usdCs/UsdCsPINVOKE.cs @@ -25902,6 +25902,63 @@ static UsdCsPINVOKE() { [global::System.Runtime.InteropServices.DllImport("UsdCs", EntryPoint="CSharp_pxr_delete_UsdSkelSkinningQuery")] public static extern void delete_UsdSkelSkinningQuery(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("UsdCs", EntryPoint="CSharp_pxr_new_UsdSkelBlendShapeQuery__SWIG_0")] + public static extern global::System.IntPtr new_UsdSkelBlendShapeQuery__SWIG_0(); + + [global::System.Runtime.InteropServices.DllImport("UsdCs", EntryPoint="CSharp_pxr_new_UsdSkelBlendShapeQuery__SWIG_1")] + public static extern global::System.IntPtr new_UsdSkelBlendShapeQuery__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("UsdCs", EntryPoint="CSharp_pxr_UsdSkelBlendShapeQuery_IsValid")] + public static extern bool UsdSkelBlendShapeQuery_IsValid(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("UsdCs", EntryPoint="CSharp_pxr_UsdSkelBlendShapeQuery_GetPrim")] + public static extern global::System.IntPtr UsdSkelBlendShapeQuery_GetPrim(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("UsdCs", EntryPoint="CSharp_pxr_UsdSkelBlendShapeQuery_GetBlendShape")] + public static extern global::System.IntPtr UsdSkelBlendShapeQuery_GetBlendShape(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2); + + [global::System.Runtime.InteropServices.DllImport("UsdCs", EntryPoint="CSharp_pxr_UsdSkelBlendShapeQuery_GetInbetween")] + public static extern global::System.IntPtr UsdSkelBlendShapeQuery_GetInbetween(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2); + + [global::System.Runtime.InteropServices.DllImport("UsdCs", EntryPoint="CSharp_pxr_UsdSkelBlendShapeQuery_GetBlendShapeIndex")] + public static extern uint UsdSkelBlendShapeQuery_GetBlendShapeIndex(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2); + + [global::System.Runtime.InteropServices.DllImport("UsdCs", EntryPoint="CSharp_pxr_UsdSkelBlendShapeQuery_GetNumBlendShapes")] + public static extern uint UsdSkelBlendShapeQuery_GetNumBlendShapes(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("UsdCs", EntryPoint="CSharp_pxr_UsdSkelBlendShapeQuery_GetNumSubShapes")] + public static extern uint UsdSkelBlendShapeQuery_GetNumSubShapes(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("UsdCs", EntryPoint="CSharp_pxr_UsdSkelBlendShapeQuery_ComputeBlendShapePointIndices")] + public static extern global::System.IntPtr UsdSkelBlendShapeQuery_ComputeBlendShapePointIndices(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("UsdCs", EntryPoint="CSharp_pxr_UsdSkelBlendShapeQuery_ComputeSubShapePointOffsets")] + public static extern global::System.IntPtr UsdSkelBlendShapeQuery_ComputeSubShapePointOffsets(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("UsdCs", EntryPoint="CSharp_pxr_UsdSkelBlendShapeQuery_ComputeSubShapeNormalOffsets")] + public static extern global::System.IntPtr UsdSkelBlendShapeQuery_ComputeSubShapeNormalOffsets(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("UsdCs", EntryPoint="CSharp_pxr_UsdSkelBlendShapeQuery_ComputeSubShapeWeights")] + public static extern bool UsdSkelBlendShapeQuery_ComputeSubShapeWeights(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, global::System.Runtime.InteropServices.HandleRef jarg4, global::System.Runtime.InteropServices.HandleRef jarg5); + + [global::System.Runtime.InteropServices.DllImport("UsdCs", EntryPoint="CSharp_pxr_UsdSkelBlendShapeQuery_ComputeFlattenedSubShapeWeights")] + public static extern bool UsdSkelBlendShapeQuery_ComputeFlattenedSubShapeWeights(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); + + [global::System.Runtime.InteropServices.DllImport("UsdCs", EntryPoint="CSharp_pxr_UsdSkelBlendShapeQuery_ComputeDeformedPoints")] + public static extern bool UsdSkelBlendShapeQuery_ComputeDeformedPoints(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, global::System.Runtime.InteropServices.HandleRef jarg4, global::System.Runtime.InteropServices.HandleRef jarg5, global::System.Runtime.InteropServices.HandleRef jarg6, global::System.Runtime.InteropServices.HandleRef jarg7); + + [global::System.Runtime.InteropServices.DllImport("UsdCs", EntryPoint="CSharp_pxr_UsdSkelBlendShapeQuery_ComputeDeformedNormals")] + public static extern bool UsdSkelBlendShapeQuery_ComputeDeformedNormals(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, global::System.Runtime.InteropServices.HandleRef jarg4, global::System.Runtime.InteropServices.HandleRef jarg5, global::System.Runtime.InteropServices.HandleRef jarg6, global::System.Runtime.InteropServices.HandleRef jarg7); + + [global::System.Runtime.InteropServices.DllImport("UsdCs", EntryPoint="CSharp_pxr_UsdSkelBlendShapeQuery_ComputePackedShapeTable")] + public static extern bool UsdSkelBlendShapeQuery_ComputePackedShapeTable(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); + + [global::System.Runtime.InteropServices.DllImport("UsdCs", EntryPoint="CSharp_pxr_UsdSkelBlendShapeQuery_GetDescription")] + public static extern string UsdSkelBlendShapeQuery_GetDescription(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("UsdCs", EntryPoint="CSharp_pxr_delete_UsdSkelBlendShapeQuery")] + public static extern void delete_UsdSkelBlendShapeQuery(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("UsdCs", EntryPoint="CSharp_pxr_new_UsdSkelTopology__SWIG_0")] public static extern global::System.IntPtr new_UsdSkelTopology__SWIG_0(); diff --git a/src/UsdCs/usdCs_wrap.cpp b/src/UsdCs/usdCs_wrap.cpp index c35e9d2bc..271d70aa3 100644 --- a/src/UsdCs/usdCs_wrap.cpp +++ b/src/UsdCs/usdCs_wrap.cpp @@ -9359,6 +9359,10 @@ SWIGINTERN void std_vector_Sl_UsdSkelInbetweenShape_Sg__SetRange(std::vector< Us #include "pxr/base/vt/array.h" +#include "pxr/usd/usdSkel/blendShapeQuery.h" +#include "pxr/base/vt/array.h" + + #include "pxr/usd/usdSkel/topology.h" SWIGINTERN UsdSkelTopology *new_UsdSkelTopology__SWIG_4(VtTokenArray topology){ @@ -144004,6 +144008,350 @@ SWIGEXPORT void SWIGSTDCALL CSharp_pxr_delete_UsdSkelSkinningQuery(void * jarg1) } +SWIGEXPORT void * SWIGSTDCALL CSharp_pxr_new_UsdSkelBlendShapeQuery__SWIG_0() { + void * jresult ; + UsdSkelBlendShapeQuery *result = 0 ; + + result = (UsdSkelBlendShapeQuery *)new UsdSkelBlendShapeQuery(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_pxr_new_UsdSkelBlendShapeQuery__SWIG_1(void * jarg1) { + void * jresult ; + UsdSkelBindingAPI *arg1 = 0 ; + UsdSkelBlendShapeQuery *result = 0 ; + + arg1 = (UsdSkelBindingAPI *)jarg1; + if (!arg1) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "UsdSkelBindingAPI const & type is null", 0); + return 0; + } + result = (UsdSkelBlendShapeQuery *)new UsdSkelBlendShapeQuery((UsdSkelBindingAPI const &)*arg1); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_pxr_UsdSkelBlendShapeQuery_IsValid(void * jarg1) { + unsigned int jresult ; + UsdSkelBlendShapeQuery *arg1 = (UsdSkelBlendShapeQuery *) 0 ; + bool result; + + arg1 = (UsdSkelBlendShapeQuery *)jarg1; + result = (bool)((UsdSkelBlendShapeQuery const *)arg1)->IsValid(); + jresult = result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_pxr_UsdSkelBlendShapeQuery_GetPrim(void * jarg1) { + void * jresult ; + UsdSkelBlendShapeQuery *arg1 = (UsdSkelBlendShapeQuery *) 0 ; + UsdPrim *result = 0 ; + + arg1 = (UsdSkelBlendShapeQuery *)jarg1; + result = (UsdPrim *) &((UsdSkelBlendShapeQuery const *)arg1)->GetPrim(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_pxr_UsdSkelBlendShapeQuery_GetBlendShape(void * jarg1, unsigned long jarg2) { + void * jresult ; + UsdSkelBlendShapeQuery *arg1 = (UsdSkelBlendShapeQuery *) 0 ; + size_t arg2 ; + UsdSkelBlendShape result; + + arg1 = (UsdSkelBlendShapeQuery *)jarg1; + arg2 = (size_t)jarg2; + result = ((UsdSkelBlendShapeQuery const *)arg1)->GetBlendShape(arg2); + jresult = new UsdSkelBlendShape((const UsdSkelBlendShape &)result); + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_pxr_UsdSkelBlendShapeQuery_GetInbetween(void * jarg1, unsigned long jarg2) { + void * jresult ; + UsdSkelBlendShapeQuery *arg1 = (UsdSkelBlendShapeQuery *) 0 ; + size_t arg2 ; + UsdSkelInbetweenShape result; + + arg1 = (UsdSkelBlendShapeQuery *)jarg1; + arg2 = (size_t)jarg2; + result = ((UsdSkelBlendShapeQuery const *)arg1)->GetInbetween(arg2); + jresult = new UsdSkelInbetweenShape((const UsdSkelInbetweenShape &)result); + return jresult; +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_pxr_UsdSkelBlendShapeQuery_GetBlendShapeIndex(void * jarg1, unsigned long jarg2) { + unsigned long jresult ; + UsdSkelBlendShapeQuery *arg1 = (UsdSkelBlendShapeQuery *) 0 ; + size_t arg2 ; + size_t result; + + arg1 = (UsdSkelBlendShapeQuery *)jarg1; + arg2 = (size_t)jarg2; + result = ((UsdSkelBlendShapeQuery const *)arg1)->GetBlendShapeIndex(arg2); + jresult = (unsigned long)result; + return jresult; +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_pxr_UsdSkelBlendShapeQuery_GetNumBlendShapes(void * jarg1) { + unsigned long jresult ; + UsdSkelBlendShapeQuery *arg1 = (UsdSkelBlendShapeQuery *) 0 ; + size_t result; + + arg1 = (UsdSkelBlendShapeQuery *)jarg1; + result = ((UsdSkelBlendShapeQuery const *)arg1)->GetNumBlendShapes(); + jresult = (unsigned long)result; + return jresult; +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_pxr_UsdSkelBlendShapeQuery_GetNumSubShapes(void * jarg1) { + unsigned long jresult ; + UsdSkelBlendShapeQuery *arg1 = (UsdSkelBlendShapeQuery *) 0 ; + size_t result; + + arg1 = (UsdSkelBlendShapeQuery *)jarg1; + result = ((UsdSkelBlendShapeQuery const *)arg1)->GetNumSubShapes(); + jresult = (unsigned long)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_pxr_UsdSkelBlendShapeQuery_ComputeBlendShapePointIndices(void * jarg1) { + void * jresult ; + UsdSkelBlendShapeQuery *arg1 = (UsdSkelBlendShapeQuery *) 0 ; + SwigValueWrapper< std::vector< VtArray< int > > > result; + + arg1 = (UsdSkelBlendShapeQuery *)jarg1; + result = ((UsdSkelBlendShapeQuery const *)arg1)->ComputeBlendShapePointIndices(); + jresult = new std::vector< VtIntArray >((const std::vector< VtIntArray > &)result); + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_pxr_UsdSkelBlendShapeQuery_ComputeSubShapePointOffsets(void * jarg1) { + void * jresult ; + UsdSkelBlendShapeQuery *arg1 = (UsdSkelBlendShapeQuery *) 0 ; + std::vector< VtVec3fArray > result; + + arg1 = (UsdSkelBlendShapeQuery *)jarg1; + result = ((UsdSkelBlendShapeQuery const *)arg1)->ComputeSubShapePointOffsets(); + jresult = new std::vector< VtVec3fArray >((const std::vector< VtVec3fArray > &)result); + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_pxr_UsdSkelBlendShapeQuery_ComputeSubShapeNormalOffsets(void * jarg1) { + void * jresult ; + UsdSkelBlendShapeQuery *arg1 = (UsdSkelBlendShapeQuery *) 0 ; + std::vector< VtVec3fArray > result; + + arg1 = (UsdSkelBlendShapeQuery *)jarg1; + result = ((UsdSkelBlendShapeQuery const *)arg1)->ComputeSubShapeNormalOffsets(); + jresult = new std::vector< VtVec3fArray >((const std::vector< VtVec3fArray > &)result); + return jresult; +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_pxr_UsdSkelBlendShapeQuery_ComputeSubShapeWeights(void * jarg1, void * jarg2, void * jarg3, void * jarg4, void * jarg5) { + unsigned int jresult ; + UsdSkelBlendShapeQuery *arg1 = (UsdSkelBlendShapeQuery *) 0 ; + TfSpan< float const > *arg2 = 0 ; + VtFloatArray *arg3 = (VtFloatArray *) 0 ; + VtUIntArray *arg4 = (VtUIntArray *) 0 ; + VtUIntArray *arg5 = (VtUIntArray *) 0 ; + bool result; + + arg1 = (UsdSkelBlendShapeQuery *)jarg1; + arg2 = (TfSpan< float const > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "TfSpan< float const > const & type is null", 0); + return 0; + } + arg3 = (VtFloatArray *)jarg3; + arg4 = (VtUIntArray *)jarg4; + arg5 = (VtUIntArray *)jarg5; + result = (bool)((UsdSkelBlendShapeQuery const *)arg1)->ComputeSubShapeWeights((TfSpan< float const > const &)*arg2,arg3,arg4,arg5); + jresult = result; + return jresult; +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_pxr_UsdSkelBlendShapeQuery_ComputeFlattenedSubShapeWeights(void * jarg1, void * jarg2, void * jarg3) { + unsigned int jresult ; + UsdSkelBlendShapeQuery *arg1 = (UsdSkelBlendShapeQuery *) 0 ; + TfSpan< float const > *arg2 = 0 ; + VtFloatArray *arg3 = (VtFloatArray *) 0 ; + bool result; + + arg1 = (UsdSkelBlendShapeQuery *)jarg1; + arg2 = (TfSpan< float const > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "TfSpan< float const > const & type is null", 0); + return 0; + } + arg3 = (VtFloatArray *)jarg3; + result = (bool)((UsdSkelBlendShapeQuery const *)arg1)->ComputeFlattenedSubShapeWeights((TfSpan< float const > const &)*arg2,arg3); + jresult = result; + return jresult; +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_pxr_UsdSkelBlendShapeQuery_ComputeDeformedPoints(void * jarg1, void * jarg2, void * jarg3, void * jarg4, void * jarg5, void * jarg6, void * jarg7) { + unsigned int jresult ; + UsdSkelBlendShapeQuery *arg1 = (UsdSkelBlendShapeQuery *) 0 ; + TfSpan< float const > arg2 ; + TfSpan< unsigned int const > arg3 ; + TfSpan< unsigned int const > arg4 ; + std::vector< VtIntArray > *arg5 = 0 ; + std::vector< VtVec3fArray > *arg6 = 0 ; + SwigValueWrapper< TfSpan< GfVec3f > > arg7 ; + TfSpan< float const > const *argp2 ; + TfSpan< unsigned int const > const *argp3 ; + TfSpan< unsigned int const > const *argp4 ; + TfSpan< GfVec3f > *argp7 ; + bool result; + + arg1 = (UsdSkelBlendShapeQuery *)jarg1; + argp2 = (TfSpan< float const > *)jarg2; + if (!argp2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null TfSpan< float const > const", 0); + return 0; + } + arg2 = *argp2; + argp3 = (TfSpan< unsigned int const > *)jarg3; + if (!argp3) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null TfSpan< unsigned int const > const", 0); + return 0; + } + arg3 = *argp3; + argp4 = (TfSpan< unsigned int const > *)jarg4; + if (!argp4) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null TfSpan< unsigned int const > const", 0); + return 0; + } + arg4 = *argp4; + arg5 = (std::vector< VtIntArray > *)jarg5; + if (!arg5) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< VtIntArray > const & type is null", 0); + return 0; + } + arg6 = (std::vector< VtVec3fArray > *)jarg6; + if (!arg6) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< VtVec3fArray > const & type is null", 0); + return 0; + } + argp7 = (TfSpan< GfVec3f > *)jarg7; + if (!argp7) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null TfSpan< GfVec3f >", 0); + return 0; + } + arg7 = *argp7; + result = (bool)((UsdSkelBlendShapeQuery const *)arg1)->ComputeDeformedPoints(arg2,arg3,arg4,(std::vector< VtIntArray > const &)*arg5,(std::vector< VtVec3fArray > const &)*arg6,arg7); + jresult = result; + return jresult; +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_pxr_UsdSkelBlendShapeQuery_ComputeDeformedNormals(void * jarg1, void * jarg2, void * jarg3, void * jarg4, void * jarg5, void * jarg6, void * jarg7) { + unsigned int jresult ; + UsdSkelBlendShapeQuery *arg1 = (UsdSkelBlendShapeQuery *) 0 ; + TfSpan< float const > arg2 ; + TfSpan< unsigned int const > arg3 ; + TfSpan< unsigned int const > arg4 ; + std::vector< VtIntArray > *arg5 = 0 ; + std::vector< VtVec3fArray > *arg6 = 0 ; + SwigValueWrapper< TfSpan< GfVec3f > > arg7 ; + TfSpan< float const > const *argp2 ; + TfSpan< unsigned int const > const *argp3 ; + TfSpan< unsigned int const > const *argp4 ; + TfSpan< GfVec3f > *argp7 ; + bool result; + + arg1 = (UsdSkelBlendShapeQuery *)jarg1; + argp2 = (TfSpan< float const > *)jarg2; + if (!argp2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null TfSpan< float const > const", 0); + return 0; + } + arg2 = *argp2; + argp3 = (TfSpan< unsigned int const > *)jarg3; + if (!argp3) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null TfSpan< unsigned int const > const", 0); + return 0; + } + arg3 = *argp3; + argp4 = (TfSpan< unsigned int const > *)jarg4; + if (!argp4) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null TfSpan< unsigned int const > const", 0); + return 0; + } + arg4 = *argp4; + arg5 = (std::vector< VtIntArray > *)jarg5; + if (!arg5) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< VtIntArray > const & type is null", 0); + return 0; + } + arg6 = (std::vector< VtVec3fArray > *)jarg6; + if (!arg6) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< VtVec3fArray > const & type is null", 0); + return 0; + } + argp7 = (TfSpan< GfVec3f > *)jarg7; + if (!argp7) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null TfSpan< GfVec3f >", 0); + return 0; + } + arg7 = *argp7; + result = (bool)((UsdSkelBlendShapeQuery const *)arg1)->ComputeDeformedNormals(arg2,arg3,arg4,(std::vector< VtIntArray > const &)*arg5,(std::vector< VtVec3fArray > const &)*arg6,arg7); + jresult = result; + return jresult; +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_pxr_UsdSkelBlendShapeQuery_ComputePackedShapeTable(void * jarg1, void * jarg2, void * jarg3) { + unsigned int jresult ; + UsdSkelBlendShapeQuery *arg1 = (UsdSkelBlendShapeQuery *) 0 ; + VtVec4fArray *arg2 = (VtVec4fArray *) 0 ; + VtVec2iArray *arg3 = (VtVec2iArray *) 0 ; + bool result; + + arg1 = (UsdSkelBlendShapeQuery *)jarg1; + arg2 = (VtVec4fArray *)jarg2; + arg3 = (VtVec2iArray *)jarg3; + result = (bool)((UsdSkelBlendShapeQuery const *)arg1)->ComputePackedShapeTable(arg2,arg3); + jresult = result; + return jresult; +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_pxr_UsdSkelBlendShapeQuery_GetDescription(void * jarg1) { + char * jresult ; + UsdSkelBlendShapeQuery *arg1 = (UsdSkelBlendShapeQuery *) 0 ; + std::string result; + + arg1 = (UsdSkelBlendShapeQuery *)jarg1; + result = ((UsdSkelBlendShapeQuery const *)arg1)->GetDescription(); + jresult = SWIG_csharp_string_callback((&result)->c_str()); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_pxr_delete_UsdSkelBlendShapeQuery(void * jarg1) { + UsdSkelBlendShapeQuery *arg1 = (UsdSkelBlendShapeQuery *) 0 ; + + arg1 = (UsdSkelBlendShapeQuery *)jarg1; + delete arg1; +} + + SWIGEXPORT void * SWIGSTDCALL CSharp_pxr_new_UsdSkelTopology__SWIG_0() { void * jresult ; UsdSkelTopology *result = 0 ;