GithubHelp home page GithubHelp logo

moana-to-usd's Introduction

Converting Disney's Moana Island Scene to USD

Motivation

As of early 2020, accessing large, production-level USD content can be a challenge outside of studios. Attempting to stress-test DCC tools and studying USD workflows for large scenes can thus be a challenge: the tools that work well for the proverbial Kitchen Set might not work as well for content structured in a different hierarchy.

Disney's Moana Island Scene being a close relative to the Kitchen Set, using it as a source of high-quality content.

Screenshots

Hibiscus asset, with Ptex textures: Textured hibiscus

View from the beach scene, without Ptex textures: Beach camera

Limitations

Given the narrow use case, only some content is currently translated to USD. Some of the limitations include:

  • No animations
  • No curves
  • Not a 1:1 mapping of the original scene hierarchy
  • Limited shader graph setup (especially with regards to displacement maps)
  • Textures are not copied from the source directory to the destination directory. This is only due to storage and time constraints.
  • Requires a build of usdview with Ptex enabled to view textures.
  • Python scripts use Sdf APIs instead of the much friendlier Usd APIs in order to efficiently batch-create Prims.

Feel free to contribute a Pull Request if you see a bug or an improvement opportunity!

Running the script

Except for the USD Python bindings, the script only relies on tqdm to print progress bars to the console during the conversion. Some assets can take a while to process.

From a terminal:

pip install -r requirements.txt
python -m moana2usd --source-dir SOURCE_DIR --dest-dir DEST_DIR

where:

  • SOURCE_DIR is the location where the Moana Island Scene can be found.
  • DEST_DIR is the location where the converted USD files will be written.

For the full usage options:

user@machine:~$ python -m moana2usd --help
usage: __main__.py [-h] [--source-dir SOURCE_DIR] [--dest-dir DEST_DIR]
                   [--format {sdf,usd,usda,usdc,usdz}] [--load-textures]
                   [--omit-small-instances]

Convert the Moana Island scene to USD.

optional arguments:
  -h, --help            show this help message and exit
  --source-dir SOURCE_DIR
                        Directory where the Moana Island scene is located.
  --dest-dir DEST_DIR   Output directory where the USD data will be written.
  --format {sdf,usd,usda,usdc,usdz}
                        File format to output data to.
  --load-textures       Create USD assets with Ptex textures.
  --omit-small-instances
                        Omit instantiation of small (or numerous) instances.

Running the tests

A (limited) set of tests are included in the project. To execute them, run the following command from a terminal:

python -m unittest discover

moana-to-usd's People

Contributors

philsawicki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

moana-to-usd's Issues

Error with prim path on non-windows?

elementName = os.path.relpath(assetOBJPath, self.SourceDirectoryPath).split('\\')[1]

I get this stack trace here:
Traceback (most recent call last): File "/usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 174, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/Users/bsavery/Documents/GitHub/moana-to-usd/moana2usd/__main__.py", line 60, in <module> moanaIslandConverter.convert() File "moana2usd/converters/scene_converter.py", line 70, in convert self._assetConverter.convert() File "moana2usd/converters/asset_converter.py", line 38, in convert self._createAssets() File "moana2usd/converters/asset_converter.py", line 647, in _createAssets self._translateOBJFileIntoUSD(assetOBJPath) File "moana2usd/converters/asset_converter.py", line 312, in _translateOBJFileIntoUSD self._convertOBJToUSD(assetOBJPath, objStream) File "moana2usd/converters/asset_converter.py", line 92, in _convertOBJToUSD elementName = os.path.relpath(assetOBJPath, self.SourceDirectoryPath).split('\\')[1]

I THINK you are trying to get the obj file name and use that for a prim path in USD? Not sure about the \ so assuming that is to deal with windows file paths maybe? Anyway so for this example the error comes up with relpath of 'obj/isBayCedarA1/isBayCedarA1.obj' that of course cannot be split by \. The path then for the usd prim wants to be /obj/isBayCedarA1/isBayCedarA1.obj ?

Stuck at 65%

Hi,

The script stuck at 65% after running about few days. It's been tested on both windows and linux not sure if this is anticipated. The process also killed itself sometime during the 65% on the linux machine though.

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.