Install USD on macOS Mojave

Homebrew install:

  • /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

USD install:

Links:



USD Ressources

  1. Pixar’s open source github project on USD files
  2. Universal Scene Description Project
  3. USDZ File Format Specification

USD Format

Install Pixar USD on macOS X

  • Use Python 2.7
  • Install bundle - vfxpro99/usd-build-club on GitHub
  • Edit build_usd.py for correct dylib linking, according to: https://github.com/PixarAnimationStudios/USD/issues/19#issuecomment-399918369

  • ############################################################
    # USD
    
    def InstallUSD(context, force, buildArgs):
        with CurrentWorkingDirectory(context.usdSrcDir):
            extraArgs = []
    
            if context.buildPython:
                extraArgs.append('-DPXR_ENABLE_PYTHON_SUPPORT=ON')
                if MacOS():
                  import distutils.sysconfig
                  pyLibPath = distutils.sysconfig.get_config_var('LIBDIR')
                  pyIncPath = distutils.sysconfig.get_config_var('INCLUDEPY')
                  extraArgs.append('-DPYTHON_LIBRARY=' + pyLibPath + '/libpython2.7.dylib')
                  extraArgs.append('-DPYTHON_INCLUDE_DIR=' + pyIncPath)
            else:
                extraArgs.append('-DPXR_ENABLE_PYTHON_SUPPORT=OFF')
    


    Converting between .usda and .usdc Files

    We'll start with a simple .usda file, Sphere.usda in the USD/extras/usd/tutorials/convertingLayerFormats folder. This is a text format file, so it can be examined in any text editor or via usdcat.
    $ usdcat Sphere.usda
    
    #usda 1.0
    def Sphere "sphere"
    {
    }
    
    To convert this file to a binary format file, we can simply specify an output filename with the .usdc extension:
    $ usdcat -o NewSphere.usdc Sphere.usda
    
    This will produce a binary format file named Sphere.usdc in your current directory that contains the same contents as Sphere.usd, which we can verify using the usddiff tool:
    $ usddiff Sphere.usda NewSphere.usdc
    
    Converting from a binary format file to a text format file and verifying the contents match can be done in the same way:
    $ usdcat -o NewSphere.usda NewSphere.usdc
    $ usddiff NewSphere.usdc NewSphere.usda
    

    Automator - Finder context menu entry - usdcat

    #! /bin/bash
    
    #Load Environment
    source ~/.bash_profile
    
    # Enter the first file's directory
    current_path=$(dirname "$1")
    cd "$current_path"
    
    # For every file, unrar it to the current directory
    for a in "${@##*/}"
    do
    	extension="${a##*.}"
    	filename="${a%.*}"
    	if [ "$extension" = "usda" ]
    	then
    		usdcat -o "$filename.usdc" $a
    	else
    		usdcat -o "$filename.usda" $a
    	fi
    done
    
    # Exit 0 so annoying errors don't popup 
    exit 0
    


    USD Service Tools / Workflows for macOS X

    Here are some Services / workflows for macOS Finder which allow direct access to USD from within Finder
  • macOS X Service extension for Finder v0.2
  • macOS X Service extension for Finder v0.1
  • Workflows for Finder v0.1
  • Important: Visit covidfeedback.ch