docs.unity3d.com
    Show / Hide Table of Contents

    Class UsdIo

    The USD serialization run-time. This class leverages the ArrayAllocator, TypeBinder, TokenCache, ReflectionCache and SampleBase to perform efficient reflection based serialization of arbitrary C# data types to and from USD.

    Inheritance
    Object
    UsdIo
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: USD.NET
    Syntax
    public class UsdIo

    Constructors

    UsdIo(Object)

    Declaration
    public UsdIo(object stageLock)
    Parameters
    Type Name Description
    Object stageLock

    Fields

    ArrayAllocator

    Declaration
    public static ArrayPool ArrayAllocator
    Field Value
    Type Description
    ArrayPool

    Properties

    Bindings

    Provides access to the system TypeBinder. Only one binder may be active and the binder can be used to add support for new custom data types.

    Declaration
    public static TypeBinder Bindings { get; }
    Property Value
    Type Description
    TypeBinder

    Methods

    Deserialize(ref Object, UsdPrim, UsdTimeCode, FieldInfo, HashSet<MemberInfo>, ref Nullable<Boolean>, String)

    Deserialize a single field to a single value.

    Declaration
    public void Deserialize(ref object fieldValue, UsdPrim prim, UsdTimeCode usdTime, FieldInfo field, HashSet<MemberInfo> accessMap, ref bool? mayVary, string usdNamespace = null)
    Parameters
    Type Name Description
    Object fieldValue

    The referenced value of the field to populate.

    UsdPrim prim

    The USD prim from which to read the value.

    UsdTimeCode usdTime

    The time at which to sample key frames.

    FieldInfo field

    The field to deserialize.

    HashSet<MemberInfo> accessMap

    A list of members to include when reading.

    Nullable<Boolean> mayVary

    Indicates if any of the members read from this prim were time-varying.

    String usdNamespace

    The USD namespace, if any.

    Deserialize(ref Object, UsdPrim, UsdTimeCode, PropertyInfo, HashSet<MemberInfo>, ref Nullable<Boolean>, String)

    Deserialize a single property to a single value.

    Declaration
    public void Deserialize(ref object propValue, UsdPrim prim, UsdTimeCode usdTime, PropertyInfo field, HashSet<MemberInfo> accessMap, ref bool? mayVary, string usdNamespace = null)
    Parameters
    Type Name Description
    Object propValue

    The referenced value of the property to populate.

    UsdPrim prim

    The USD prim from which to read the value.

    UsdTimeCode usdTime

    The time at which to sample key frames.

    PropertyInfo field

    The field to deserialize.

    HashSet<MemberInfo> accessMap

    A list of members to includ when reading.

    Nullable<Boolean> mayVary

    If non-null, is populated to indicate if the value varies over time.

    String usdNamespace

    The USD namespace, if any.

    Deserialize<T>(T, UsdPrim, UsdTimeCode, HashSet<MemberInfo>, ref Nullable<Boolean>, String)

    Deserializes an arbitrary object descending from SampleBase from USD to C#.

    Declaration
    public void Deserialize<T>(T t, UsdPrim prim, UsdTimeCode usdTime, HashSet<MemberInfo> accessMap, ref bool? mayVary, string usdNamespace = null)
        where T : SampleBase
    Parameters
    Type Name Description
    T t

    The object to to populate.

    UsdPrim prim

    The USD prim from which to read data.

    UsdTimeCode usdTime

    The time at which to read key frames.

    HashSet<MemberInfo> accessMap

    A list of memebers to include when reading.

    Nullable<Boolean> mayVary

    Indicates if this prim had any time-varying members.

    String usdNamespace

    The object namespace, if any.

    Type Parameters
    Name Description
    T

    The type to serialize, descending from SampleBase

    Serialize<T>(T, UsdPrim, UsdTimeCode, String)

    Serializes an arbitrary object descending from SampleBase from C# to USD.

    Declaration
    public void Serialize<T>(T t, UsdPrim prim, UsdTimeCode usdTime, string usdNamespace = null)
    Parameters
    Type Name Description
    T t

    The object/data to be serialized.

    UsdPrim prim

    The UsdPrim to which the object should be written.

    UsdTimeCode usdTime

    The tiem at which key frames should be created.

    String usdNamespace

    The USD namespace (if any) of the object.

    Type Parameters
    Name Description
    T

    Any type which inherits from SampleBase

    Back to top
    Copyright © 2023 Unity Technologies
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on Thursday, October 19, 2023