Represents the point at which a UsdStage has been imported into the Unity scene.
The goal is to make it easy to re-import the data and to export sparse overrides.
public class UsdAsset : MonoBehaviour
Fields
Declaration
public BasisTransformation LastHandedness
Field Value
Declaration
Field Value
Declaration
public ImportMode m_boundingBox
Field Value
Declaration
public BasisTransformation m_changeHandedness
Field Value
Declaration
public ImportMode m_color
Field Value
Declaration
public bool m_debugPrintVariabilityCache
Field Value
Declaration
public bool m_debugShowSkeletonBindPose
Field Value
Declaration
public bool m_debugShowSkeletonRestPose
Field Value
Declaration
public Material m_displayColorMaterial
Field Value
Type |
Description |
Material |
|
Declaration
public bool m_enableGpuInstancing
Field Value
Declaration
public bool m_generateLightmapUVs
Field Value
Declaration
public bool m_importCameras
Field Value
Declaration
public bool m_importHierarchy
Field Value
Declaration
public bool m_importMeshes
Field Value
Declaration
public bool m_importMonoBehaviors
Field Value
Declaration
public bool m_importPointInstances
Field Value
Declaration
public bool m_importSceneInstances
Field Value
Declaration
public bool m_importSkinning
Field Value
Declaration
public bool m_importTransforms
Field Value
Declaration
public Scene.InterpolationMode m_interpolation
Field Value
Type |
Description |
Scene.InterpolationMode |
|
Declaration
public MaterialImportMode m_materialImportMode
Field Value
Declaration
public Material m_metallicWorkflowMaterial
Field Value
Type |
Description |
Material |
|
Declaration
public ImportMode m_normals
Field Value
Declaration
public PayloadPolicy m_payloadPolicy
Field Value
Declaration
public ImportMode m_points
Field Value
Declaration
public string m_projectAssetPath
Field Value
Declaration
Field Value
Declaration
public Material m_specularWorkflowMaterial
Field Value
Type |
Description |
Material |
|
Declaration
Field Value
Declaration
public ImportMode m_tangents
Field Value
Declaration
public ImportMode m_texcoord1
Field Value
Declaration
public ImportMode m_texcoord2
Field Value
Declaration
public ImportMode m_texcoord3
Field Value
Declaration
public ImportMode m_topology
Field Value
Declaration
public float m_unwrapAngleError
Field Value
Declaration
public float m_unwrapAreaError
Field Value
Declaration
public float m_unwrapHardAngle
Field Value
Declaration
public int m_unwrapPackMargin
Field Value
Declaration
public string m_usdRootPath
Field Value
Declaration
public float m_usdTimeOffset
Field Value
Declaration
public bool m_usdVariabilityCache
Field Value
Declaration
public bool m_useOriginalShaderIfAvailable
Field Value
Properties
The length of the USD playback time in seconds.
Declaration
public double Length { get; }
Property Value
The absolute file path to the USD file from which this asset was created. This path may
point to a location outside of the Unity project and may be any file type supported by
USD (e.g. usd, usda, usdc, abc, ...). Setting this path will not trigger the asset to be
reimported, Reload must be called explicitly.
Declaration
public string usdFullPath { get; set; }
Property Value
Methods
Finds and destroys all GameObjects that were imported from USD.
Declaration
public void DestroyAllImportedObjects()
Writes overrides over the given scene. The given scene is referenced into the override
scene being exported.
Declaration
public void ExportOverrides(Scene sceneInWhichToStoreTransforms)
Parameters
Type |
Name |
Description |
Scene |
sceneInWhichToStoreTransforms |
|
Returns the USD.NET.Scene object for this USD file.
The caller is NOT expected to close the scene.
Declaration
Returns
Imports the USD scene incrementally, setting a fixed time budget per frame for import
operations. Uses StartCoroutine.
Declaration
public void ImportUsdAsCoroutine(GameObject goRoot, string usdFilePath, double time, SceneImportOptions importOptions, float targetFrameMilliseconds)
Parameters
Convert the SceneImportOptions to a serializable form.
Declaration
public void OptionsToState(SceneImportOptions options)
Parameters
Optimizes the given import options for fast playback. This assumes that the asset was
previously imported, therefore it disables import of the material and scene hierarchy.
Declaration
public static void PrepOptionsForTimeChange(ref SceneImportOptions options)
Parameters
Reimports the USD scene, either fully rebuilding every object or updating them in-place.
Declaration
public void Reload(bool forceRebuild)
Parameters
Type |
Name |
Description |
Boolean |
forceRebuild |
Destroys each GameObject before reimporting.
|
Finds all USD behaviors and destroys them, ignores the GameObject and other components.
Declaration
public void RemoveAllUsdComponents()
Loads or unloads the given payload object. Throws an exception if game object deos not have
a UsdPrimSource behaviour.
Declaration
public void SetPayloadState(GameObject go, bool isLoaded)
Parameters
Type |
Name |
Description |
GameObject |
go |
|
Boolean |
isLoaded |
|
Applies the contents of this USD file to a foreign root object.
Declaration
public void SetTime(double time, UsdAsset foreignRoot, bool saveMeshUpdates)
Parameters
Sets the variant selections in USD at the given prim path based on the selections parameter.
Declaration
public void SetVariantSelection(GameObject go, string usdPrimPath, Dictionary<string, string> selections)
Parameters
Type |
Name |
Description |
GameObject |
go |
The gameObject at the root of the variant set.
|
String |
usdPrimPath |
The USD prim at which to set the variant selection.
|
Dictionary<String, String> |
selections |
A collection of (variant set, selection) pairs.
|
If two sets with selections are modelingVariant=CupWithHandle and shadingVariant=BrightBlue,
resulting in a bright blue cup with a handle. In this example, the selections dictionary
would contain:
{ "modelingVariant" = "CupWithHandle",
"shadingVariant" = "BrightBlue" }
Converts the current component state into import options.
Declaration
public void StateToOptions(ref SceneImportOptions options)
Parameters