/// <summary> /// Returns the C# value from USD or null if there was no value or the value could not be converted. /// </summary> object GetCSharpValue(UsdAttribute attr, UsdTimeCode time) { UsdTypeBinding binding; if (!UsdIo.Bindings.GetReverseBinding(attr.GetTypeName(), out binding)) { // No binding for this type. return(null); } return(binding.toCsObject(attr.Get(time))); }
private void ReadInternal <T>(SdfPath path, T sample, UsdTimeCode timeCode) where T : SampleBase { var prim = GetUsdPrim(path); if (!prim) { return; } var accessMap = AccessMask; bool?mayVary = false; HashSet <System.Reflection.MemberInfo> dynamicMembers = null; if (accessMap != null) { lock (m_stageLock) { if (!accessMap.Included.TryGetValue(path, out dynamicMembers) && IsPopulatingAccessMask) { dynamicMembers = new HashSet <System.Reflection.MemberInfo>(); accessMap.Included.Add(path, dynamicMembers); } } if (!IsPopulatingAccessMask) { mayVary = null; dynamicMembers = dynamicMembers ?? m_empty; } } m_usdIo.Deserialize(sample, prim, timeCode, dynamicMembers, ref mayVary); lock (m_stageLock) { if (accessMap != null && mayVary != null) { if (!mayVary.Value) { if (accessMap.Included.ContainsKey(path)) { accessMap.Included.Remove(path); } } } } }
private void WriteInternal <T>(SdfPath path, T sample, UsdTimeCode timeCode) where T : SampleBase { pxr.UsdPrim prim; lock (m_stageLock) { // TODO(jcowles): there is a potential issue here if the cache gets out of sync with the // underlying USD scene. The correct fix is to listen for change processing events and // clear the cache accordingly. if (!m_primMap.TryGetValue(path, out prim)) { prim = m_stage.DefinePrim(path, new TfToken(Reflect.GetSchema(typeof(T)))); if (!prim) { return; } m_primMap.Add(path, prim); } } m_usdIo.Serialize(sample, prim, timeCode); }
public static UsdTimeCode Default() { UsdTimeCode ret = new UsdTimeCode(UsdCsPINVOKE.UsdTimeCode_Default(), true); return(ret); }
public SWIGTYPE_p_SdfPropertySpecHandleVector GetPropertyStack(UsdTimeCode time) { SWIGTYPE_p_SdfPropertySpecHandleVector ret = new SWIGTYPE_p_SdfPropertySpecHandleVector(UsdCsPINVOKE.UsdProperty_GetPropertyStack__SWIG_0(swigCPtr, UsdTimeCode.getCPtr(time)), true); if (UsdCsPINVOKE.SWIGPendingException.Pending) { throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public static bool ComputePointsAtTime(VtVec3fArray points, UsdStageWeakPtr stage, UsdTimeCode time, VtVec3fArray positions, VtVec3fArray velocities, UsdTimeCode velocitiesSampleTime, VtVec3fArray accelerations, float velocityScale) { bool ret = UsdCsPINVOKE.UsdGeomPointBased_ComputePointsAtTime__SWIG_1(VtVec3fArray.getCPtr(points), UsdStageWeakPtr.getCPtr(stage), UsdTimeCode.getCPtr(time), VtVec3fArray.getCPtr(positions), VtVec3fArray.getCPtr(velocities), UsdTimeCode.getCPtr(velocitiesSampleTime), VtVec3fArray.getCPtr(accelerations), velocityScale); if (UsdCsPINVOKE.SWIGPendingException.Pending) { throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public uint ComputeVertexDataSize(UsdTimeCode timeCode) { uint ret = UsdCsPINVOKE.UsdGeomBasisCurves_ComputeVertexDataSize(swigCPtr, UsdTimeCode.getCPtr(timeCode)); if (UsdCsPINVOKE.SWIGPendingException.Pending) { throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public bool GetIndices(VtIntArray indices, UsdTimeCode time) { bool ret = UsdCsPINVOKE.UsdGeomPrimvar_GetIndices__SWIG_0(swigCPtr, VtIntArray.getCPtr(indices), UsdTimeCode.getCPtr(time)); if (UsdCsPINVOKE.SWIGPendingException.Pending) { throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public bool ComputePointsAtTime(VtVec3fArray points, UsdTimeCode time, UsdTimeCode baseTime) { bool ret = UsdCsPINVOKE.UsdGeomPointBased_ComputePointsAtTime__SWIG_0(swigCPtr, VtVec3fArray.getCPtr(points), UsdTimeCode.getCPtr(time), UsdTimeCode.getCPtr(baseTime)); if (UsdCsPINVOKE.SWIGPendingException.Pending) { throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public bool ComputeVaryingJointInfluences(uint numPoints, VtIntArray indices, VtFloatArray weights, UsdTimeCode time) { bool ret = UsdCsPINVOKE.UsdSkelSkinningQuery_ComputeVaryingJointInfluences__SWIG_0(swigCPtr, numPoints, VtIntArray.getCPtr(indices), VtFloatArray.getCPtr(weights), UsdTimeCode.getCPtr(time)); if (UsdCsPINVOKE.SWIGPendingException.Pending) { throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public bool ComputeBlendShapeWeights(VtFloatArray weights, UsdTimeCode time) { bool ret = UsdCsPINVOKE.UsdSkelAnimQuery_ComputeBlendShapeWeights__SWIG_0(swigCPtr, VtFloatArray.getCPtr(weights), UsdTimeCode.getCPtr(time)); if (UsdCsPINVOKE.SWIGPendingException.Pending) { throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public UsdGeomBBoxCache(UsdTimeCode time, TfTokenVector includedPurposes, bool useExtentsHint, bool ignoreVisibility) : this(UsdCsPINVOKE.new_UsdGeomBBoxCache__SWIG_0(UsdTimeCode.getCPtr(time), TfTokenVector.getCPtr(includedPurposes), useExtentsHint, ignoreVisibility), true) { if (UsdCsPINVOKE.SWIGPendingException.Pending) { throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); } }
public UsdGeomBBoxCache(UsdTimeCode time, TfTokenVector includedPurposes) : this(UsdCsPINVOKE.new_UsdGeomBBoxCache__SWIG_2(UsdTimeCode.getCPtr(time), TfTokenVector.getCPtr(includedPurposes)), true) { if (UsdCsPINVOKE.SWIGPendingException.Pending) { throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); } }
public UsdTimeCode GetBaseTime() { UsdTimeCode ret = new UsdTimeCode(UsdCsPINVOKE.UsdGeomBBoxCache_GetBaseTime(swigCPtr), true); return(ret); }
void ReadInternal <T>(SdfPath path, T sample, UsdTimeCode timeCode) where T : SampleBase { var prim = GetUsdPrim(path); if (!prim) { return; } var accessMap = AccessMask; HashSet <System.Reflection.MemberInfo> dynamicMembers = null; // mayVary is nullable and has an accumulation semantic: // null = members have already been checked for animation // false = no dynamic members found // true = at least one member has been found dynamic bool?mayVary = false; // When reading animation data, the access map optimizes which prim members need to be read if (accessMap != null) { var populatingAccessMask = IsPopulatingAccessMask; lock (m_stageLock) { // Check which attributes of the prim are dynamic var primFound = accessMap.Included.TryGetValue(path, out dynamicMembers); // Populating the access map happens when reading the first frame of animation // so if the prim is not already in the map add it and everything will be deserialized if (!primFound && populatingAccessMask) { dynamicMembers = new HashSet <System.Reflection.MemberInfo>(); accessMap.Included.Add(path, dynamicMembers); } } // If we are not populating the access map it means it's been done already so only dynamic members should be deserialized if (!populatingAccessMask) { // If there are no dynamic members, then no need to call deserialize if (dynamicMembers == null) { return; } // Notify the deserialization service that only dynamic members should be read mayVary = null; } } m_usdIo.Deserialize(sample, prim, timeCode, dynamicMembers, ref mayVary); // If no members are varying, remove the prim from the access map. lock (m_stageLock) { if (accessMap != null && mayVary != null) { if (!mayVary.Value) { if (accessMap.Included.ContainsKey(path)) { accessMap.Included.Remove(path); } } } } }
public bool SetExtentsHint(VtVec3fArray extents, UsdTimeCode time) { bool ret = UsdCsPINVOKE.UsdGeomModelAPI_SetExtentsHint__SWIG_0(swigCPtr, VtVec3fArray.getCPtr(extents), UsdTimeCode.getCPtr(time)); if (UsdCsPINVOKE.SWIGPendingException.Pending) { throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public bool GetAttributeValue(TfToken attrName, VtValue valueOut, UsdTimeCode time) { bool ret = UsdCsPINVOKE.UsdPrim_GetAttributeValue(swigCPtr, TfToken.getCPtr(attrName), VtValue.getCPtr(valueOut), UsdTimeCode.getCPtr(time)); if (UsdCsPINVOKE.SWIGPendingException.Pending) { throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public GfMatrix4d GetGeomBindTransform(UsdTimeCode time) { GfMatrix4d ret = new GfMatrix4d(UsdCsPINVOKE.UsdSkelSkinningQuery_GetGeomBindTransform__SWIG_0(swigCPtr, UsdTimeCode.getCPtr(time)), true); if (UsdCsPINVOKE.SWIGPendingException.Pending) { throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public bool ComputeJointLocalTransformComponents(VtVec3fArray translations, VtQuatfArray rotations, VtVec3hArray scales, UsdTimeCode time) { bool ret = UsdCsPINVOKE.UsdSkelAnimQuery_ComputeJointLocalTransformComponents__SWIG_0(swigCPtr, VtVec3fArray.getCPtr(translations), VtQuatfArray.getCPtr(rotations), VtVec3hArray.getCPtr(scales), UsdTimeCode.getCPtr(time)); if (UsdCsPINVOKE.SWIGPendingException.Pending) { throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public bool Set(VtValue value, UsdTimeCode time) { bool ret = UsdCsPINVOKE.UsdShadeInput_Set__SWIG_0(swigCPtr, VtValue.getCPtr(value), UsdTimeCode.getCPtr(time)); if (UsdCsPINVOKE.SWIGPendingException.Pending) { throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public bool ComputeJointLocalTransforms(VtMatrix4dArray xforms, UsdTimeCode time) { bool ret = UsdCsPINVOKE.UsdSkelSkeletonQuery_ComputeJointLocalTransforms__SWIG_3(swigCPtr, VtMatrix4dArray.getCPtr(xforms), UsdTimeCode.getCPtr(time)); if (UsdCsPINVOKE.SWIGPendingException.Pending) { throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public bool AppendFaceGroup(VtIntArray faceIndices, SdfPath bindingTarget, UsdTimeCode time) { bool ret = UsdCsPINVOKE.UsdGeomFaceSetAPI_AppendFaceGroup__SWIG_0(swigCPtr, VtIntArray.getCPtr(faceIndices), SdfPath.getCPtr(bindingTarget), UsdTimeCode.getCPtr(time)); if (UsdCsPINVOKE.SWIGPendingException.Pending) { throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public bool ComputeFlattened(VtValue value, UsdTimeCode time) { bool ret = UsdCsPINVOKE.UsdGeomPrimvar_ComputeFlattened__SWIG_2(swigCPtr, VtValue.getCPtr(value), UsdTimeCode.getCPtr(time)); if (UsdCsPINVOKE.SWIGPendingException.Pending) { throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public bool SetFaceCounts(VtIntArray faceCounts, UsdTimeCode time) { bool ret = UsdCsPINVOKE.UsdGeomFaceSetAPI_SetFaceCounts__SWIG_0(swigCPtr, VtIntArray.getCPtr(faceCounts), UsdTimeCode.getCPtr(time)); if (UsdCsPINVOKE.SWIGPendingException.Pending) { throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public bool ComputePointsAtTimes(VtVec3fArrayVector pointsArray, UsdTimeCodeVector times, UsdTimeCode baseTime) { bool ret = UsdCsPINVOKE.UsdGeomPointBased_ComputePointsAtTimes(swigCPtr, VtVec3fArrayVector.getCPtr(pointsArray), UsdTimeCodeVector.getCPtr(times), UsdTimeCode.getCPtr(baseTime)); if (UsdCsPINVOKE.SWIGPendingException.Pending) { throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
override public bool Equals(object rhs) { return(UsdTimeCode.Equals(this, rhs as UsdTimeCode)); }
public TfToken ComputeInterpolationForSize(uint n, UsdTimeCode timeCode) { TfToken ret = new TfToken(UsdCsPINVOKE.UsdGeomBasisCurves_ComputeInterpolationForSize__SWIG_1(swigCPtr, n, UsdTimeCode.getCPtr(timeCode)), true); if (UsdCsPINVOKE.SWIGPendingException.Pending) { throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public void SetFromCamera(GfCamera camera, UsdTimeCode time) { UsdCsPINVOKE.UsdGeomCamera_SetFromCamera(swigCPtr, GfCamera.getCPtr(camera), UsdTimeCode.getCPtr(time)); if (UsdCsPINVOKE.SWIGPendingException.Pending) { throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); } }
public GfCamera GetCamera(UsdTimeCode time) { GfCamera ret = new GfCamera(UsdCsPINVOKE.UsdGeomCamera_GetCamera(swigCPtr, UsdTimeCode.getCPtr(time)), true); if (UsdCsPINVOKE.SWIGPendingException.Pending) { throw UsdCsPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public static UsdTimeCode EarliestTime() { UsdTimeCode ret = new UsdTimeCode(UsdCsPINVOKE.UsdTimeCode_EarliestTime(), true); return(ret); }