Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Official USD for Unity Updates

Discussion in 'Formats & External Tools Previews' started by marief_unity, Mar 18, 2019.

  1. jeremyco

    jeremyco

    Unity Technologies

    Joined:
    Oct 17, 2018
    Posts:
    38
    Other users have reported this, though we've not been able to reproduce the issue :/

    If you are able to reproduce it, can you file a bug and a small repro project?
     
  2. jeremyco

    jeremyco

    Unity Technologies

    Joined:
    Oct 17, 2018
    Posts:
    38
    iOS is not yet supported by the SDK.

    If you can provide the exported USDZ file that is not rendering correctly, we could take a look.
     
  3. jeremyco

    jeremyco

    Unity Technologies

    Joined:
    Oct 17, 2018
    Posts:
    38
    If the camera was exported to the USD file, Unity should be able to import it.
     
  4. jeremyco

    jeremyco

    Unity Technologies

    Joined:
    Oct 17, 2018
    Posts:
    38
    Check the USD Unity SDK text in the package manager, the last line indicates which version of USD libs are being used (the current release is 19.05, IIRC, though we have an update queued up for the next package release).
     
  5. judub

    judub

    Unity Technologies

    Joined:
    Nov 5, 2019
    Posts:
    11
    The version 2.0.0-exp.1 of the USD package has been released today.

    This is a major update for us, bringing support for USD 20.08, a lot of improvements for material import/export, as well as a wide variety of bug fixes.

    Note that this is still an experimental package, and like all experimental packages it should be treated carefully before being used in a production context. Also with the recent changes in package discoverability, the USD package won't be listed in the Package Manager.
    However, if you’ve already installed it, it won’t be removed from your projects – you can continue to use it, and it will still be able to receive the available updates. And you can still add the USD package to your project by editing your project manifest and adding the line:
    "com.unity.formats.usd": "2.0.0-exp.1"
    .

    Please don’t hesitate to send us bug reports or other feedback through the forum or the github repo.

    Here's a summary of the changes (see the Changelog for a full list):

    Features
    • Added support for USD v20.08.
    • On import, material names in Unity now match the material names in the USD file.
    • The material exporter now supports texture wrap modes and offers highly improved PBR material support.
    • Exporting in-memory textures and render textures is now supported.
    • USDZ can now be exported from a usd recorder clip.
    • Scope prims are now imported as Transforms.
    Bug Fixes
    • Refreshing a USD Asset in Unity will read external modifications of all its layers (example: receive animation update from a DCC).
    • Exporting an animated USD file no longer creates timesamples at every frame but only when necessary.
    • Importing a material with emissive color is fixed.
    • Prefabs no longer reset when entering Play mode.
    • The USD Payload component UI is fixed and reflects the correct prims payload status.
    • All USD export menus now offer a choice of usd, usda and usdc.

    Special thanks to @fherbst for his awesome contributions on the materials import/export and USDZ exporters.
     
    fherbst and jeremyco like this.
  6. Bersaelor

    Bersaelor

    Joined:
    Oct 8, 2016
    Posts:
    111
    Thanks again @jeremyco.

    I ended up adding some extra methods to our backend, so that newly uploaded models are always converted to both *.usd and to *.gltf . Then the *.usd is consumed on the apple devices running native iOS/SceneKit apps and the *.gltf is consumed by the unity/android apps using https://github.com/atteneder/glTFast
     
    Bentoon likes this.
  7. JoeGrainger

    JoeGrainger

    Joined:
    Oct 20, 2012
    Posts:
    19
    I've noticed a bug when exporting a mesh without any subMeshes that the default Catmull-Clark subdivision behaviour is applied, checking
    MeshExporter.ExportMesh
    in
    2.0.0-exp.1
    it's clear that
    CreateSubdivisionSchemeAttr
    is only called for meshes containing subMeshes.

    At
    L376
    I've added logic in to include the subdivision scheme if there are no subMeshes within the mesh and it now exports as expected.

    Code (CSharp):
    1.  
    2. // In USD subMeshes are represented as UsdGeomSubsets.
    3. // When there are multiple subMeshes, convert them into UsdGeomSubsets.
    4.     if (mesh.subMeshCount == 0)
    5.     {
    6.         var usdGeom = new pxr.UsdGeomMesh(usdPrim);
    7.         usdGeom.CreateSubdivisionSchemeAttr(new TfToken("none"));
    8.     }
    9.     else
    10.     {
    11.         ...
    12.     }
    13.  
     
  8. JPLee

    JPLee

    Joined:
    Jul 31, 2017
    Posts:
    6
    Is there a tutorial or walkthrough or sample that shows how to use this package to export a skinned animated object that will play on a Mac or an IOs device?
    How do I get "timeSamples" data into the export ?
     
  9. JPLee

    JPLee

    Joined:
    Jul 31, 2017
    Posts:
    6
    To answer my own question - The sample scene "ExportMesh.unity" should have the script "ExportMeshSample.cs" added as a component somewhere (I put it on the "World" object).
    There is a "Record" button on the component. Drop the "Geom" object into "Export Root", put a file name eg "example.usdc" into the "Usd File" field , run, and click record. The usdc file is generated into the project root.
    This only exports a usdc though not a usdz. If a skinned animated object is chosen instead of the "geom" cubes object, it does .export the animation.
     
  10. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
  11. RoughSpaghetti3211

    RoughSpaghetti3211

    Joined:
    Aug 11, 2015
    Posts:
    1,709
    I’m surprised to read it not a priority and will not be finished this year. In my opinion if you want to brand yourself as more than just a game engine you really need a solid USD integration.
     
    MostHated likes this.
  12. judub

    judub

    Unity Technologies

    Joined:
    Nov 5, 2019
    Posts:
    11
    There currently is active in-depth discussion about the future of USD at Unity and the current plugin is not deprecated but for now it is indeed very experimental and in low maintenance mode.
    I'm sorry I can't really comment any further on the subject but wanted to let you know the state of things.
     
    pachermann likes this.
  13. RoughSpaghetti3211

    RoughSpaghetti3211

    Joined:
    Aug 11, 2015
    Posts:
    1,709
    Thanks for the update judub
     
  14. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    In my opinion it´s a question about how you weight the market impact of the fileformats USD and MDL.
    The NVidia Omniverse based upon USD/MDL is a veeeeery smart solution to connect different DCC-products around a centralized database.
    Users can interact in realtime (I mean realtime) when collaborating on the same project.
    Don´t sleep, take this seriously please.
     
  15. bambamyi

    bambamyi

    Joined:
    Nov 26, 2008
    Posts:
    91
    Very typical unity approach these days. What is the point of supporting ARKit in ARFoundation when unity built ARKit project cannot even open USDZ file? In fact, USDZ, GLB, and GLTF should be default 3d file format because fbx is outdated and not suitable for AR applications...
     
    Cazforshort, Bentoon and efge like this.
  16. Bentoon

    Bentoon

    Joined:
    Apr 26, 2013
    Posts:
    98
    That's heartbreaking

     
  17. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    It would be nice to know at least what the discussion is about. What is the possible alternative? What are we supposed to do in the meantime? Is work already underway on something usable?

    Having a goal of being a "content creation platform" for multiple types of media and industries, but then throwing the implementation of one of the most useful inter-application media exchange formats on the back burner while it is already in a mostly unusable state, causing it to be a huge pain to try and get properly formatted and usable assets and content in and out of Unity just seems beyond counter-productive.

    Trying to get even a simple scene out of Unity and into Houdini so I could try and run a simulation with proper placement of things was a nightmare, and in the end, never worked correctly, and that was over a year, maybe a year and a half ago, now.

    Is there a working alternative currently that I just didn't realize had been made available? If not.. what is the end game here?
     
    Cascho01 likes this.
  18. pachermann

    pachermann

    Joined:
    Dec 18, 2013
    Posts:
    133
    Apart from houdini and maya, Modo and Nuke as fas as i know USD is nowhere complete.
    GLB and GLTF should not be default file formats, they are in many situations a good choice, but not more advanced than fbx.
    USDZ is only widely used by apple, plus with very special settings.
    Where we could say typically a extra step away from khronos standards, because apple are like everywhere going to use their own way here.
    USD on the other hand is the new comming standard and the only alternative to FBX as 3D scene File Format but it is still not everywhere implemented. It will be ready in time when Dcc's are ready for it i guess.

    Patience and research makes sense:

    USDZ - Apple: https://www.marxentlabs.com/usdz-files/
    USD - Unity: https://docs.unity3d.com/Manual/com.unity.formats.usd.html

    Very soon there will be a workshop with ben about those formats: https://create.unity3d.com/road-to-realtime
     
    Last edited: May 30, 2021
  19. Alexis-Dev

    Alexis-Dev

    Joined:
    Apr 16, 2019
    Posts:
    121
    I hope USD will be support on Android soon.
     
  20. pachermann

    pachermann

    Joined:
    Dec 18, 2013
    Posts:
    133
    USD is a scene exchange format, useful for files on smartphones and webgl is gltf/glb and usdz on ios.
     
  21. Alexis-Dev

    Alexis-Dev

    Joined:
    Apr 16, 2019
    Posts:
    121
    I know, but I want to use Simplygone on Android and it work with USD...
     
  22. Bersaelor

    Bersaelor

    Joined:
    Oct 8, 2016
    Posts:
    111
    Honestly, after setting up our backend system to convert all 3D files into both *.usdz as well as *.gltf and importing the gltf into Unity using the gltFast maintained by the superior helpful @atteneder , I'm really sorry apple is not on the GLTF train. GLTF with Draco is so much better for the average Internet usage than their *.usdz format.
    Apple is even a promoting member of the Khronos Group I wonder why they didn't use the standard their own group put forward.
     
    tteneder likes this.
  23. pachermann

    pachermann

    Joined:
    Dec 18, 2013
    Posts:
    133
    Apple is opting out of most chroos standard, it is normal, tehy want their own tech.
    We just need to accept that we always must do double work for apple, we try to bill this to our clients if apple is a target plattform.
     
    Bersaelor likes this.
  24. judub

    judub

    Unity Technologies

    Joined:
    Nov 5, 2019
    Posts:
    11
    Version 3.0.0-exp.1 of our experimental USD package has been released!

    Note that this is an experimental package, and like all experimental packages it should be treated carefully before being used in a production setting.

    What's New
    Features
    • New Import/Export API. See the ImportHelpers and ExportHelpers class
    • Added Integration with Recorder (compatible with Recorder 2.2.0 or later)
    Bug Fixes
    • UsdAsset behavior was not always refreshing the asset within the Prefab stage.
    • The hardcoded package name in InitUSD and BuildPostProcessor has been removed.
    • The package doesn't cause build errors anymore with IL2CPP or mobile devices. Note that the USD package is still unsupported on mobile.
    Changes
    • Building the bindings has been made easier by including the USD.NET and USD.NET.Unity assemblies inside the package.
    • The native bindings build is now handled by CMake on Windows and macOS.
    • Linux support has been temporarily disabled.
    You can find the full changelog here.


    Minimum Requirements
    Unity 2019.4

    How to Install
    You can install this package through the Package Manager or via your project’s manifest.
    • In Unity 2021.1 and above, click the [+] button at the top left of the Package Manager, select Add Package by Name... and enter com.unity.formats.usd in the Name field and 3.0.0-exp.1 in the Version field.

      OR

    • In Unity 2020.3, click the [+] button at the top left of the Package Manager, select Add package from git URL... and enter com.unity.formats.usd@3.0.0-exp.1.

      OR

    • In any supported version of Unity, edit the “Packages/manifest.json” file and add the following line to the top of the list of dependencies:

      "com.unity.formats.usd": "3.0.0-exp.1"
    Thanks!


    > How to report bugs <
     
    IMC-Lab and MostHated like this.
  25. Carpet_Head

    Carpet_Head

    Joined:
    Nov 27, 2014
    Posts:
    258
    just want to throw in - we were definitely using the linux version, keeping an eye on when it returns :)
     
  26. artigee

    artigee

    Joined:
    Nov 3, 2016
    Posts:
    1
    USD animation clip can be usable for blendtree like FBX so that it can be controlled by animation controller and use animator component to other USD skel mesh? or Timeline can be only solution to play animation on USD?
     
  27. Carpet_Head

    Carpet_Head

    Joined:
    Nov 27, 2014
    Posts:
    258
    having some trouble with the USDZ exporter - in the editor materials work fine, but in a build, materials simply don't work?
     
  28. Carpet_Head

    Carpet_Head

    Joined:
    Nov 27, 2014
    Posts:
    258
    resolution: using "High" code stripping caused this
     
  29. scottcpeters80

    scottcpeters80

    Joined:
    Aug 15, 2021
    Posts:
    1
    Hey all,

    Just bumping into this thread. I am working with a team that is leveraging SideFx Houdini and Unreal to work with USD assets. I have had much better luck dealing with Unity than unreal. I know that the linux version is temporarily disabled, but I wanted to see if there was any movement on this? We are planning on leveraging whatever realtime system we go with in the cloud to perform scientific rendering.

    More specifically, I am getting the following error when I attempt to use any of the USD samples from the installed package:


    Code (CSharp):
    1. Invalid AssetDatabase path: /Assets/Samples/USD/3.0.0-exp.1/ExportMesh. Use path relative to the project folder.
    2. UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
    Any thoughts?
     
  30. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    AssetDatabase expects the first directory to be something within your main project folder. Gotta get rid of the first forward slash ( / ) before "/Assets/Samples", as that is telling it to try and look at the root of the current filesystem, instead of in the Assets folder.
     
    pachermann likes this.
  31. shibi2017

    shibi2017

    Joined:
    Jan 18, 2018
    Posts:
    153
    I can not find usd package in packages manager in Unity2021? why?
     
  32. judub

    judub

    Unity Technologies

    Joined:
    Nov 5, 2019
    Posts:
    11
  33. Carpet_Head

    Carpet_Head

    Joined:
    Nov 27, 2014
    Posts:
    258
    I get the feeling you guys have left Linux support for dead, but it's super valuable for us. I'm just here to report a bug that in Unity 2021.2.0f1, on 2.0.0-exp.1 on linux with an il2cpp target, the build fails due to the following error:

    Building Library\Bee\artifacts\LinuxPlayerBuildProgram\zbz95\bogn_wrapTokens.o failed with output:
    G:\SourceTree\GravitySketchVR\Library\Bee\artifacts\LinuxPlayerBuildProgram\il2cppOutput\cpp\wrapTokens.cpp:25:10: fatal error: 'boost/python/class.hpp' file not found
    #include <boost/python/class.hpp>
    ^~~~~~~~~~~~~~~~~~~~~~~~
     
  34. judub

    judub

    Unity Technologies

    Joined:
    Nov 5, 2019
    Posts:
    11
    I'm actually working on getting the Linux binaries back in as we speak! Which will probably make the our player build tests fail, so I'll look into the error at that point.
     
  35. Carpet_Head

    Carpet_Head

    Joined:
    Nov 27, 2014
    Posts:
    258
    Awesome! great to hear it, I will keep an eye on this thread
     
  36. shibi2017

    shibi2017

    Joined:
    Jan 18, 2018
    Posts:
    153
  37. EddieChristian

    EddieChristian

    Joined:
    Oct 9, 2012
    Posts:
    725
    Unity 2021.2.2f1 HD Pipeline, Everything in the USD samples is Pink. What is the fix for this??
     
  38. EddieChristian

    EddieChristian

    Joined:
    Oct 9, 2012
    Posts:
    725
    So I just noticed this thread is 3 Years old. Enough is Enough guys. Last time I checked Unity was worth about 6 billion dollars. You need to hire a dozen more coders and get this done and hooked into Nvidia Omniverse. In 3 years I could have written a whole game engine just by myself.
     
  39. IMC-Lab

    IMC-Lab

    Joined:
    Mar 28, 2014
    Posts:
    4
    +1
     
  40. SourceKraut

    SourceKraut

    Joined:
    Jun 27, 2015
    Posts:
    12

    <((((<
    Just build an importer for usd by yourself!
    It’s open source.
    You could also go native iOS or just convert to other 3d format.

    i am curious about your engine, drop a message here when you are ready
     
  41. han65

    han65

    Joined:
    Apr 19, 2019
    Posts:
    3
    Hi Guys,

    Thank you for the release! I am having problem loading transparent materials though.

    And it seems like the plugin can't load transparent material correctly, is there any extra setting or documentation can point me to the right direction?

    I am look at these piece of code in ShaderImporterBase.cs from the package
    Code (CSharp):
    1. protected void ImportColorOrMap(Scene scene,
    2.             Connectable<Vector3> usdParam,
    3.             bool isNormalMap,
    4.             SceneImportOptions options,
    5.             ref Texture2D map,
    6.             ref Color? value,
    7.             out string uvPrimvar)
    8.         {
    9.             uvPrimvar = null;
    10.             if (usdParam.IsConnected())
    11.             {
    12.                 map = MaterialImporter.ImportConnectedTexture(scene, usdParam, isNormalMap, options, out uvPrimvar);
    13.             }
    14.             else
    15.             {
    16.                 var rgb = usdParam.defaultValue;
    17.                 value = new Color(rgb.x, rgb.y, rgb.z).gamma;
    18.             }
    19.         }
    It doesn't return an alpha value at all.
     
  42. EricHFrazer

    EricHFrazer

    Joined:
    Jun 30, 2020
    Posts:
    20
    I'm going to agree with Eddie. Years later, and USD doesn't import right. Has anybody gotten it to correctly import Pixar's kitchen along with the right materials? Why is everything pink when using HDRP?
     
  43. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    Hi folks, I was not able to export any USD with meshes using USD 3.0.0-exp.2 + Unity 2021.2.10f1, I tried a few things, a gameobject from FBX, a Cube from unity built-in resources. Tried both Recorder and One-click export.

    In the export folder, textures are correctly exported, but I wasn't able to make any program load the USD/USDA/USDZ /USDC file, not in Unity, nor Substance, nor Blender. The mesh is missing, result in a hierarchy with a single child object named "material".

    What should I do??
     
  44. pachermann

    pachermann

    Joined:
    Dec 18, 2013
    Posts:
    133
    Did you not get any error or log messages? I guess USD is not able to export yet everything from unity.
    I tried it for meshes and it worked but unity meshed i could also not export via usd nor fbx.
     
  45. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    I checked it again, yeah, my problem was I was trying to export a submesh from a FBX, that doesn't work with USD 3.0.0-exp.2 and it just ignore the mesh silently.

    If I export the whole FBX it does work, but its UV was lost, I wonder if there is a settings in Recorder I need to select to serialize the FBX as it is...
     
  46. pachermann

    pachermann

    Joined:
    Dec 18, 2013
    Posts:
    133
    It should keep the uvs, but i guess when you changed the uvs in unity you need to save them on the mesh.
    or what also could be is that you saved the wrong UV channel there are several UV channels.
     
  47. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    Hmmm, but I didn't change any UV or vertices data.

    What I don't understand:

    - my source FBX in scene has 3 material attached to it,
    - I have selected the Export Materials in Recorder,
    - The textures on the materials are correctly exported.
    - On import only Vertex Color are included, UV is gone.

    I also tried importing the result USD file into Blender and can verify its UV Maps is empty. So I think this is an export issue, where did you select which UV channel to export, I don't see it?
     
    Last edited: Mar 1, 2022
  48. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    So I tried latest USD package with Unity's latest HDRP vegetation demo. Really quite disappointed with how much data is non-exportable, Terrain nope, Tree with mesh asset nope, Submesh nope, SpeedTree shader's texture nope.

    Not sure what the target audience is at the moment, but perhaps importing scene is currently more important than exporting scenes.
     
  49. pachermann

    pachermann

    Joined:
    Dec 18, 2013
    Posts:
    133
    You need to make meshes from things like terrain, ect. Unity is not a DCC? like Cinema4D there most things are Meshes from the scratch.
    And if you wanna export shaders your target software needs to have the same language, however there is fbx who can possibly export materials.
    But generally you can only export an entity or gameobject that is a understandable type like mesh, or camera ect.
    IF SD or FBX does not have it in their dictionary it wont export it.
    there are a few methods to convert thing into exportable supported types, take a bit of work but it works.
     
  50. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    It's about exporting the textures used by the materials, not the shaders. Some of Simplygon's LOD generation methods need the textures to produce valid results (like remeshing and imposters), and it relies on USD to transfer data from/to Unity.