Giter VIP home page Giter VIP logo

usd-unity-sdk's Introduction

USD Unity SDK: USD C# Bindings for Unity

This repository contains a set of libraries designed to support the use of USD in C#/Unity. The goal of this package is to make it maximally easy to integrate and explore Universal Scene Description.

USD header

Getting Started

To get started, install USD via the Unity Package manager, either by using an official repository, or by browsing for a local package while working with source.

Once the USD package is installed, a USD menu will appear, enabling you to easily import and export USD files.

USD menu

The USD importer works with linear color space only. To ensure colors are imported correctly, set the project color space to "linear" in Edit > Project Settings > Player:

USD linear

In Unity 2019, the USD importer supports importing unlimited weights per vertex. However, to see the effect of more than 4 weights per vertex, this must be enabled in the project settings under Edit > Project Settings > Quality:

USD unlimited_weights

Requirements

  • Windows / OSX
  • Unity version: 2019.4 and up
  • API Compatibility Level .NET 4.x is no longer required but still provides better performances than .NET 2
    In Edit > Project Settings > Player :
    USD .NET version

Limitations

  • Versions of USD prior to 19.05 do not handle Alembic playback correctly, resulting significantly slower frame rate than authored in the Alembic cache (24x exactly). This will be fixed with the adoption of the USD 19.05 release and all assets will play back correctly, a priori.

Samples

The USD package also includes samples to help you get started.

Use Package Manager to import the samples into your Assets folder :

USD .NET version

Features

The following is a brief listing of currently supported features:

  • Import as GameObject, Prefab, or Timeline Clip
  • USDZ Export
  • Transform Override Export
  • Timeline Playback (Vertex Streaming & Skeletal Animation)
  • Timeline Recording Track
  • Mesh Import & Export
  • Material Import & Export (USD Preview Surface or DisplayColor)
  • Unity Materials: HDRP, Standard and limited LWRP support
  • Material Export Plugins
  • Variant Selection
  • Payload Load/Unload
  • Automatic Lightmap UV Unwrapping
  • Skeletal Animation via UsdSkel
  • Scene Instancing
  • Point Instancing
  • Integration with C# Job System
  • High and Low Level Access to USD API via C#

Importing Materials

To import materials from USD, import the USD file using the USD menu. Next, click on the root GameObject and select either DisplayColor or Preview Surface from the materials dropdown menu.

Streaming Playback via Timeline

After importing a USD file with either skeletal or point cache animation, open the Timeline window. Select the root of the USD file.

Create a playable director by clicking the "Create" button in the Timeline window. Next, drag the root USD file into the Timeline to create a track for this object. Finally, drag the USD file once more to add a USD clip to the track for plaback. Scrubbing through time will now update the USD scene by streaming dat from USD.

Timeline playback is multi-threaded using the C# Job System.

Variants, Models, & Payloads

Access to variant selection, model details, and payload state are all accessible via the inspector on the game object at which these features were authored.

Exporting USD files

Exporting via Recorder

Prerequisite: You need to install the Recorder package.

To export a USD composition via Recorder, you can either use the Recorder Window :

  • From the Editor main menu, select Window > General > Recorder > Recorder Window,
  • Then click on + Add Recorder,
  • And select USD Clip.

Or add a Recorder track :

  • From the Timeline window, right-click and select UnityEditor.Recorder.Timeline > Recorder Track,
  • Then right-click on the track and add Recorder Clip,
  • And in the selected recorder, choose USD Clip.

Using Recorder is the recommended option when compatibility with runtime is not required.

Exporting via Usd Recorder Track (Legacy)

When compatibility with runtime is required (i.e for a standalone build), the recommended option is to use the USD package Recorder Track :

  • From the Timeline window, right-click and select Unity.Formats.USD > Usd Recorder Track,
  • Then right-click on the track and add USD Recorder Clip.

Note: This feature has no dependency to and is not based on the Recorder package.

Exporting via USD menu (Legacy)

A last option to export a USD Composition is to use the legacy export via the Editor main menu :

  • Select USD > Export Selected.

Note that this option is not recommended as it doesn't offer any export options.

License

The USD Unity SDK is licensed under the terms of the Apache license. See LICENSE for more information.

Contribute

See CONTRIBUTING.md

Build

See BUILDING.md

usd-unity-sdk's People

Contributors

jcowles avatar judubu avatar clusty avatar hybridherbst avatar mfe avatar lucillecaillaud avatar etherelric avatar vkovec avatar jminor avatar samuelschmidt-brinx avatar classicvalues avatar thomas-tu avatar cpredmann avatar barath121 avatar secticide avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.