Example #1
0
 public UsdSkelBinding(UsdSkelSkeleton skel, SWIGTYPE_p_VtArrayT_UsdSkelSkinningQuery_t skinningQueries) : this(UsdCsPINVOKE.new_UsdSkelBinding__SWIG_1(UsdSkelSkeleton.getCPtr(skel), SWIGTYPE_p_VtArrayT_UsdSkelSkinningQuery_t.getCPtr(skinningQueries)), true)
 {
     if (UsdCsPINVOKE.SWIGPendingException.Pending)
     {
         throw UsdCsPINVOKE.SWIGPendingException.Retrieve();
     }
 }
        public static UsdSkelSkeleton Define(UsdStageWeakPtr stage, SdfPath path)
        {
            UsdSkelSkeleton ret = new UsdSkelSkeleton(UsdCsPINVOKE.UsdSkelSkeleton_Define(UsdStageWeakPtr.getCPtr(stage), SdfPath.getCPtr(path)), true);

            if (UsdCsPINVOKE.SWIGPendingException.Pending)
            {
                throw UsdCsPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Example #3
0
        public UsdSkelSkeletonQuery GetSkelQuery(UsdSkelSkeleton skel)
        {
            UsdSkelSkeletonQuery ret = new UsdSkelSkeletonQuery(UsdCsPINVOKE.UsdSkelCache_GetSkelQuery(swigCPtr, UsdSkelSkeleton.getCPtr(skel)), true);

            if (UsdCsPINVOKE.SWIGPendingException.Pending)
            {
                throw UsdCsPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Example #4
0
        public bool ComputeSkelBinding(UsdSkelRoot skelRoot, UsdSkelSkeleton skel, UsdSkelBinding binding)
        {
            bool ret = UsdCsPINVOKE.UsdSkelCache_ComputeSkelBinding(swigCPtr, UsdSkelRoot.getCPtr(skelRoot), UsdSkelSkeleton.getCPtr(skel), UsdSkelBinding.getCPtr(binding));

            if (UsdCsPINVOKE.SWIGPendingException.Pending)
            {
                throw UsdCsPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
        public UsdSkelSkeleton GetInheritedSkeleton()
        {
            UsdSkelSkeleton ret = new UsdSkelSkeleton(UsdCsPINVOKE.UsdSkelBindingAPI_GetInheritedSkeleton(swigCPtr), true);

            return(ret);
        }
        public bool GetSkeleton(UsdSkelSkeleton skel)
        {
            bool ret = UsdCsPINVOKE.UsdSkelBindingAPI_GetSkeleton(swigCPtr, UsdSkelSkeleton.getCPtr(skel));

            return(ret);
        }
Example #7
0
        public UsdSkelSkeleton GetSkeleton()
        {
            UsdSkelSkeleton ret = new UsdSkelSkeleton(UsdCsPINVOKE.UsdSkelBinding_GetSkeleton(swigCPtr), false);

            return(ret);
        }
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(UsdSkelSkeleton obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Example #9
0
        static void ReadSkeleton(ref HierInfo info)
        {
            if (info.prim == null)
            {
                return;
            }

            var skelRoot = new UsdSkelRoot(info.prim);

            if (!skelRoot)
            {
                return;
            }

            var skelRel = info.prim.GetRelationship(UsdSkelTokens.skelSkeleton);

            if (!skelRel)
            {
                return;
            }

            SdfPathVector targets = skelRel.GetForwardedTargets();

            if (targets == null || targets.Count == 0)
            {
                return;
            }

            var skelPrim = info.prim.GetStage().GetPrimAtPath(targets[0]);

            if (!skelPrim)
            {
                return;
            }

            var skel = new UsdSkelSkeleton(skelPrim);

            if (!skel)
            {
                return;
            }

            var jointsAttr = skel.GetJointsAttr();

            if (!jointsAttr)
            {
                return;
            }

            var vtJoints = jointsAttr.Get();

            if (vtJoints.IsEmpty())
            {
                return;
            }
            var vtStrings = UsdCs.VtValueToVtTokenArray(vtJoints);
            var joints    = UnityTypeConverter.FromVtArray(vtStrings);

            var skelPath = skelPrim.GetPath();

            info.skelJoints = new SdfPath[joints.Length];

            for (int i = 0; i < joints.Length; i++)
            {
                var jointPath = new SdfPath(joints[i]);
                if (joints[i] == "/")
                {
                    info.skelJoints[i] = skelPath;
                    continue;
                }
                else if (jointPath.IsAbsolutePath())
                {
                    Debug.LogException(new Exception("Unexpected absolute joint path: " + jointPath));
                    jointPath = new SdfPath(joints[i].TrimStart('/'));
                }
                info.skelJoints[i] = skelPath.AppendPath(jointPath);
            }
        }