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
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Official USD for Unity Updates

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

  1. ellka

    ellka

    Unity Technologies

    Joined:
    Jun 17, 2019
    Posts:
    71
    If I'm not mistaken, animation export are not supported as Usdz. At least we have a known issue about that in our backlog. Unfortunately, I can't really provide any ETA about a fix for that for now.
     
    Last edited: Nov 12, 2019
  2. ellka

    ellka

    Unity Technologies

    Joined:
    Jun 17, 2019
    Posts:
    71
    Hey fherbst, could you provide more info to allow us reproduce that on our side? I remember having this issue in the past... but I don't remember the exact circumstance and I don't have it anymore. Thank you!
     
  3. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    @Lucille it seems it doesn't happen with the released package but it happens immediately when cloning the GitHub repo and referencing it as a local package (as I do for development). What does that error message even mean?
     
  4. ellka

    ellka

    Unity Technologies

    Joined:
    Jun 17, 2019
    Posts:
    71
    My guess would be that somehow Usd is not yet initialized or something like that and Unity doesn't recognize it. But it's really a wild guess as I didn't have this error since a long time (and I clone and point to the local package all the time).

    Do you setup the preference of Unity like it is indicated in the README on the github repo? Could be another source of weird errors if Unity is not setup correctly.

    We'll manage to find some time to test that out.
     
  5. ellka

    ellka

    Unity Technologies

    Joined:
    Jun 17, 2019
    Posts:
    71
    Hey, we can't reproduce your problem. But we realized that we may miss some steps. If you can provide exactly what your doing? Every steps until the error happen and every "parameters" (HDRP or not, Usd package version, Unity version, if it's when you import a Usd file? As prefab or GO? etc...)

    For now we tried on 2019.2.10f1, we created a new Unity project. The usd package repo was pulled as is and we point to it in Unity. Then import any Usd file in Unity... no error, everything works fine.

    Also, is it the first time you see this error?
     
  6. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    Oh, instead of importing, please try exporting (e.g. use the ExportMesh sample). I mostly use USD for exporting, haven't actually tried importing on that project.
    I'll try to get you a repro project as direct message.
     
  7. Buteur2007

    Buteur2007

    Joined:
    Oct 3, 2018
    Posts:
    4
    Dear Unity Team, just to say thank you for this USDZ export tool, i also noticed some improvement with the last release.
    Just waiting now for the animation.
     
  8. Luchunpen_0

    Luchunpen_0

    Joined:
    Aug 7, 2014
    Posts:
    58
    Hello team.
    I have a problem with USD plugin.
    In realtime importing script, completely based on example ImportingMeshExample script I have next error

    ArgumentNullException: Value cannot be null.
    Parameter name: shader

    I try to using some different materials, but has same result.
    There are no errors in editor mode.
     

    Attached Files:

    • Log.txt
      File size:
      6.1 KB
      Views:
      553
  9. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    Houdini and Unity user. With USD built in to the latest version of Houdini wonder if any other Houdini users have tested use export from Houdini into Unity. Really excited by the possibilities here!

    Does the USD plugin support .usdlc format exported from Houdini Indie?
     
    Last edited: Dec 11, 2019
  10. xuhan17

    xuhan17

    Joined:
    Aug 30, 2018
    Posts:
    4
    Hi! Thank you for the great work!

    Recently I'm experimenting with USD package and I met an issue with usd recorder function.

    I was trying to export usd file via using usd recorder track. When viewing the file with usdview, the file playback at normal speed. However, after importing the file in Maya, the animation was shortened. I noticed that in usdview, "Frame" at the bottom right was incrementing as time not as frames. So after some research on USD, I modified the UsdRecorderBehaviour.cs script so the increment is by frame instead.



    Then it comes the problem, the package updates itself so my change couldn't be saved. Then I tried to move the usd package directly in Assets folder. When I tried again to use the usd recorder track, it gave error message "USD ERROR: Failed verification: 'fileFormat'".


    Is there any workaround to modify the USD package? I saw in the usd-unity-sdk git repo, there are instructions about building USD from source, is that something I should try?
     
  11. xuhan17

    xuhan17

    Joined:
    Aug 30, 2018
    Posts:
    4
    Image repost for previous post :p

    UsdView.PNG ErrorMessages.PNG
     
  12. ellka

    ellka

    Unity Technologies

    Joined:
    Jun 17, 2019
    Posts:
    71
    Hey, I'm not 100% sure to get what you need but I'll try to give my best answer.

    In your Unity project, in Packages/manifest.json you could point to a local copy of the Usd package repository. In other word:
    1. Clone the usd-unity-sdk repo
    2. Do the changes you need, on UsdRecorderBehaviour.cs for example
    3. In the manifest.json, do something like:
      "com.unity.formats.usd": "file:<path-to-your-local-package>/usd-unity-sdk/package/com.unity.formats.usd"
      instead of the regular
      "com.unity.formats.usd": "1.0.2-preview.1"
      OR in the Package Manager windows, hit the "+" on top left corner, "Add package from disk".
    I'm not sure to understand the "Then it comes the problem, the package updates itself so my change couldn't be saved.", I didn't know that it was possible but I'm not a Unity expert.

    Let me know if having a local package worked for you.
     
    xuhan17 likes this.
  13. ellka

    ellka

    Unity Technologies

    Joined:
    Jun 17, 2019
    Posts:
    71
    Hey!
    So, the short answer is "no".
    I did a quick search of what was the "usdlc" format, cause I didn't know it. Apparently it's not meant to be used outside Houdini: https://www.sidefx.com/forum/topic/70662/#post-299939, it seams that you wouldn't be able to use it even in usdview and tools like that.
     
  14. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    Thanks. Good news. Sidefx has lifted this restriction and now Indie exports .usd
    Now just waiting for the community to recognize how huge this is!
     
  15. sl0throp

    sl0throp

    Joined:
    Oct 21, 2015
    Posts:
    1
    Houdini USD and Point Instancing. I am importing a USD generated from Houdini specifically using USD point instancing. The object imports fine but add and enormous amounts of draw calls and vertex counts and does not appear to really be using point instancing. If I output a USD as an ASCII file (usda) and look at the output I can see lines such as:

    def Xform "Instance198" (
    instanceable = true
    add references = </Flattened_Master_1>
    )
    {
    matrix4d xformOp:transform:copytopoints1 = ( (0.25776649545514374, -0.042463339370442554, -0.03894890961237252, 0), (-0.042463339370442554, -0.019345484906807542, -0.26000331714749336, 0), (0.03894890521769412, 0.26000328781083226, -0.025709340478442755, 0), (3.9377551078796387, 1.281689167022705, 5.206596851348877, 1) )
    uniform token[] xformOpOrder = ["xformOp:transform:copytopoints1"]
    }

    I am curious if this is as expected, or do I have to do something more specific to get Unity to recognize USD Point Instancing.
     
  16. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    Hello, I am having an issue with the USD recorder and export.

    Here is the clip section I am trying to export, which I setup in Timeline. : https://i.imgur.com/HQSu1oj.mp4
    It imports, I set the timescale to 10 in Houdini, I can scrub the timeline and one animation seems to be working somewhat ok, as well as the cameras movement, but the undead character is not working even close to how it should.

    The blood seems to be in the right place and I am not worried about that working, as it is what I was going to remake in Houdini in the first place, but to do so I wanted the undead character to be in his proper place so I can simulate the fluid particles against the mesh: https://i.imgur.com/51X3XJx.mp4

    The first issue is he is super far away, the second is his actual animation seems like it is playing, but the X or Z position seems to go all over the place : https://i.imgur.com/D2ZuAPV.mp4

    The selected tracks are the undead character, I tried to start the recording after the animation transition just in case that was the issue, but it didn't seem to make a difference if it started before or after the transition.



    Any ideas or suggestions?
     
  17. RuanKK

    RuanKK

    Joined:
    Dec 25, 2019
    Posts:
    1
    Hello,Unity 2019.2.17f1
    I use "Export selected as USDZ" error

    擷取_2019_12_31_13_56_38_611.png
    Any ideas or suggestions?
     
  18. tushar1985

    tushar1985

    Joined:
    May 7, 2013
    Posts:
    5
    We have exported only material data of Katana in form of USD and we are trying to map this data onto same unity materials that we have created. Problem is that I am only able to get the top most data:

    def Material "metalPainted_mat" (
    customData = {
    dictionary material = {
    dictionary parameters = {
    int Conductor1_Diffuse_Albedo_Override_COL = 1
    double Conductor1_Diffuse_Albedo_defaultColor = 0.009999999776482582
    int Dielectric1_ISO_ISOType = 0
    string Dielectric1_ISO_ISO_Dielectric1 = "textures/<texturePkg>/ISOpaint/<udim>.tex"
    int Globals_Layers_Conductor1_Active = 1
    int Globals_Layers_Dielectric1_Active = 1
    double Globals_Maps_Diffuse_defaultColor = 0.18000000715255737
    }
    }
    }
    )

    now i am getting all the scene path from m_Scene.AllPaths() and it gives me the outermost path like "metalPainted_mat" but i can't access the custom data and parameters.

    How to access these parameters?​
     
    Last edited: Jan 2, 2020
  19. nyonge

    nyonge

    Joined:
    Jul 11, 2013
    Posts:
    49
    It's been a bit since an update so I'm just checking on functionality. I'm about to start an iOS project where I hope to export .USDZ format 3d model at runtime, to share via text, email, whatever.

    edit: I'm just exporting a plain 3D model, no animation, default material and custom texture.

    Is this feasible? Is there a timeline for this functionality, or an iOS-specific beta to test with?

    Thanks!
     
    maherdaaloul, mikerz1985 and Blarp like this.
  20. griffinbholt

    griffinbholt

    Joined:
    Jan 21, 2020
    Posts:
    1
    Hi. I'm having trouble with the Unity USD Preview Package. The materials will not load, so the model just appears to be completely black, and I can't figure out how to fix it. I can't even assign it other materials/colors. It just stays black.

    Here is the link to the model: https://developer.apple.com/documentation/arkit/capturing_body_motion_in_3d

    It's a usdz model provided by Apple for a demonstration of ARKit 3. After clicking "Download", you can find it in the "character" folder, titled "robot.usdz".

    Also, I've attached screenshots so that you can see what I am referencing. I have tried using both "Display Color" & "Preview Surface", but neither of them worked.

    Screen Shot 2020-02-13 at 2.14.01 PM.png Screen Shot 2020-02-13 at 2.15.05 PM.png
     
  21. CSDSAdmin

    CSDSAdmin

    Joined:
    Apr 26, 2018
    Posts:
    9
    Animation support How to get USD to play in WebGL ? is USD like Alembic format and does not work with iOs, Andriod etc ?
     
  22. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    568
    I am reading this in the old blog post:

    Each frame of animation is streamed from disk on demand, enabling efficient playback of massive animation caches.

    How is this compared to FBX files? And do you think there is a benefit for smaller files?
     
  23. JiveAye

    JiveAye

    Joined:
    Mar 8, 2019
    Posts:
    3
    Hi There,

    I am exploring the possibility of using USD to store and transfer assets between DCC software and unity, preferably Maya. Does anyone have a quick recommendation for a way to prepare and export a model with multiple materials as a usd file for import in to Unity?

    From what I have researched this is not that straightforward? UsdPreview surfaces need to be set up correctly and there are some limitations? Also currently for example in Maya you need to compile the USD plugin your self and potentially set the pipeline up yourself?

    Does anybody have a particular usd pipeline/method to Unity that they would recommend?

    Thanks for your time

    James
     
  24. StudioV

    StudioV

    Joined:
    Aug 29, 2017
    Posts:
    3
    Hi, We are exporting animation from Maya to Unity via USD and it is baked into alembic (in other words no skeleton gets exported). Something that I have noticed is that when I have 60 fps in Maya the clip in timeline becomes double the size. Almost as if the clip is represented in 24 fps but with the length of a 60 fps. and the animation runs in 24 fps. (in slow motion). After researching a bit I found that someone on the Pxr github said that alembic is hard coded to 24 fps.
    When I export in 24 fps I get the correct length in seconds.
    Is this also the case in Unity or is it something that needs to change when I export from Maya to get the correct frame count?
     
  25. ellka

    ellka

    Unity Technologies

    Joined:
    Jun 17, 2019
    Posts:
    71
    Hey sl0throp,

    I'm not aware of any equivalent of PointInstancer in Unity. So, we only instantiate GameObject for each point. And, indeed, this operation can cost a lot for a large number of instance.

    It is expected as I can't see any support of the export part of PointInstancer. Also, because of how the import part is done, it wouldn't be straight forward to have a symetrical import/export on this one.

    I can't provide any workaround on those problems. It's just missing feature of the current package. But I'll take note of this problem for sure.
     
    Last edited: Mar 3, 2020
  26. ellka

    ellka

    Unity Technologies

    Joined:
    Jun 17, 2019
    Posts:
    71
    If I'm not wrong you opened a ticket on the USD github about that, I'm linking the issue here just in case other people are having the same problem and want to know the solution to it: https://github.com/Unity-Technologies/usd-unity-sdk/issues/147
     
  27. ellka

    ellka

    Unity Technologies

    Joined:
    Jun 17, 2019
    Posts:
    71
    Hey,

    The team that own the USD package got new priorities recently that are more "film oriented" and so the effort on USD are toward this direction. And so there is no update on any IOS/USDz stuff planed for the following months :/

    That's said, I'm not entirely sure of what the current state of the package can do regarding your questions, but I'll ask and come back to you for that!
     
    Last edited: Mar 3, 2020
    nyonge likes this.
  28. ellka

    ellka

    Unity Technologies

    Joined:
    Jun 17, 2019
    Posts:
    71
    You may need to unzip the Usdz before importing it. The Usd package doesn't support import of Usdz as is for now.
    But you can unzip .usdz file, like if it was regular .zip archive (which they actually are). Then, importing the extracted .usd may provide better result (at least, I remember trying it with an Apple model as well, and it worked this way).

    Let me know if you still have problems.
     
    Last edited: Mar 3, 2020
  29. Mephesto_Khaan

    Mephesto_Khaan

    Joined:
    Jun 2, 2013
    Posts:
    47
    Thanks for your effort! A bit dissapointed about the iOS support, this is where the package will really shine for most of us (AR usecases).
    IF there are no plans on your side to support it, maybe you could opensource it?
     
    maherdaaloul and mikerz1985 like this.
  30. R2-RT

    R2-RT

    Joined:
    May 8, 2019
    Posts:
    38
    Isn't it already opensourced, given that ellka has shared this few posts back: https://github.com/Unity-Technologies/usd-unity-sdk ?
     
    ellka likes this.
  31. Mephesto_Khaan

    Mephesto_Khaan

    Joined:
    Jun 2, 2013
    Posts:
    47
  32. yssd2000

    yssd2000

    Joined:
    May 27, 2017
    Posts:
    1
    Can't Open by Reality Converter,that's say : Inputs:diffuseColor type float3 is not color3f
     
  33. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
  34. tufeixp

    tufeixp

    Joined:
    Sep 6, 2015
    Posts:
    22
    Are you sure it can run in runtime on PC?

    Why it just does not work on my pc with x64 build, I tried with preview 1.0.1 - 1.0.3 with unity 2019 & 2020, none works for runtime build:

    The referenced script (Unity.Formats.USD.Examples.HelloUsdExample) on this Behaviour is missing!
    (Filename: E:\unity\Runtime/Scripting/ManagedReference/SerializableManagedRef.cpp Line: 199)
    -----------------------
    I have to delete the asmdef file to make it work.
     
    Last edited: May 20, 2020
  35. alelordelo1

    alelordelo1

    Joined:
    Feb 6, 2020
    Posts:
    2
    Does USD export support Morph Targets (Blend Shapes)?

    I tried exporting a model with Morph Targets, everything worked perfectly but no morphs...
     
  36. alelordelo1

    alelordelo1

    Joined:
    Feb 6, 2020
    Posts:
    2

    What is the current USDZconverter version from Pixar used for the exported? 0.64? 0.62?

    I need 0.64 as it supports bend shapes
     
  37. tufeixp

    tufeixp

    Joined:
    Sep 6, 2015
    Posts:
    22
    Why not implement the DefaultTextureResolver or delegate OnResolveTexture for runtime texture loader under namespace Unity.Formats.USD?

    ----------------------
    I have to add these code to DefaultTextureResolver() to make it work, at least for jpg & png textures:
    #else
    string sourcePath = textureAssetPath.GetResolvedPath();
    if (!File.Exists(sourcePath))
    {
    return null;
    }
    var data = LoadFileData(sourcePath);
    if (data.Length == 0)
    {
    return null;
    }
    var texture = new Texture2D(0, 0);
    if (texture.LoadImage(data))
    return texture;
    else
    return null;
    #endif
     
    Last edited: May 20, 2020
  38. dot-NET

    dot-NET

    Joined:
    Jul 16, 2019
    Posts:
    1
    Can you import an animated camera from Houdini 18? I didn't have much luck with a LOP export.
     
  39. Jelmer123

    Jelmer123

    Joined:
    Feb 11, 2019
    Posts:
    243
    Two things:
    - When exporting a simple scene with USDz and importing it into Apple RealityComposer, nothing shows up. (could be a realitycomposer issue)
    - When trying to upload an iOS app to the AppStore (using Xcode), I got a signing error when I had USDz package in my project ("Code signing "UsdCs.bundle" failed").
    When I removed the package, the new build could be signed and uploaded to the AppStore.
     
  40. BaltasarSousa

    BaltasarSousa

    Joined:
    Sep 5, 2019
    Posts:
    2
    Hello,
    i'm having a lot of issues trying to export a .usdz like:
    - export text(TMP or 3D text);
    - export sprites;
    - export 3D with animations;
    - export usdz in runtime;
    do you know some tutorial that could help me solve this problems?

    Best Regards
     
  41. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    - text: not supported, you'll have to turn it into a texture
    - sprites: same as above
    - 3D with animations: works but you have to be a bit careful. Best is you use the Timeline USD Recorder Track.
    - USDZ export at runtime: works, but you'll probably have to adjust some parts specific for your usecase, especially in terms of animations and textures.
     
  42. BaltasarSousa

    BaltasarSousa

    Joined:
    Sep 5, 2019
    Posts:
    2
    What i'm trying to do is export a USDz from a prefab and send it to a cloud every 20min, so I need to do this automatically.
    Do you know any tutorial that could help me in this? I can't find the documentation.
     
  43. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    There isn't much: https://docs.unity3d.com/Packages/com.unity.formats.usd@1.0/manual/index.html

    What you want to do really depends on the type of model, textures, etc. and will be a custom workflow for your case.
    You'll want to explore baking your texts into render textures, compressing them as JPGs etc, and you can look at the code for the USDZ Timeline Recorder Clip for how it works. You should also be able to run a recording timeline at runtime to generate a file.
     
  44. malvakian

    malvakian

    Joined:
    Nov 8, 2012
    Posts:
    1
    Hi,

    Package example ImportMesh don't work after build it, in fact others examples works fine at builds but ImportMesh example throw this error in console.

    A scripted object (probably Unity.Formats.USD.Examples.ImportMeshExample?) has a different serialization layout when loading. (Read 32 bytes but expected 136 bytes)
    Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
    (Filename: C:\buildslave\unity\build\Runtime/Serialize/SerializedFile.cpp Line: 2269)

    Tested in version 1.0.3-preview.2 and in branch dev.

    Any ideas ?
     
  45. nyonge

    nyonge

    Joined:
    Jul 11, 2013
    Posts:
    49
    Hey folks! Just wanted to post the solution I found to this problem, in case it's helpful for anyone else.

    Since I was unable to generate the USDZ files at runtime (thank you for the insight nonetheless, @ellka !) what I did was create my USDZ models beforehand using Vectary (paid subscription), and embed them in my app in the StreamingAssets folder. I used NativeShare to access them. This even allowed me to share them with iMessage, it's pretty cool getting a text with a 3D model in it. I imagine this would work for glTF format on Android too, but I'm less familiar with it.

    Unfortunately this means I couldn't generate USDZ models at runtime, which eliminates things like UGC. Vectary doesn't have any APIs to generate at runtime as of now, but they might in the future, or there might be some competitor I'm unaware of. But still, using ARFoundation to view AR models in Obj/Fbx/etc in-app, and then pre-baking USDZ files for external use, worked great for me :) good luck!
     
    Blarp likes this.
  46. RoughSpaghetti3211

    RoughSpaghetti3211

    Joined:
    Aug 11, 2015
    Posts:
    1,697
    Just a quick question, where can I find the api doc.

    Thank you
     
  47. Bersaelor

    Bersaelor

    Joined:
    Oct 8, 2016
    Posts:
    110
    @ellka

    Thank you for providing the USD package.

    We already have a native ARKit client app for iOS, and a server with a large catalogue of USDZ files (the only format native SceneKit/ARKit allows for adding models at runtime).|

    Now, I was looking at building the Android Client in Unity. Does importing USD files at runtime work on Android?

    if it doesn't work, we are in control of the original 3D files, and could convert our catalogue to Collada (*.dae) or *.gltf for Android. But if I can help it I would prefer to not have to double our server storage to two formats per asset.
    Is it feasible to use the USD Unity package for this use case?
     
  48. Bella789

    Bella789

    Joined:
    Dec 10, 2020
    Posts:
    1
    ....so once the package "USD" is installed you get the "USD" menu on the top - then go to finder/explorer and rename the .usdz file to .zip | Go back to Unity and go to USD>ImportAsPrefab and select the file in the last folder of the unzipped file.

    There you go. Hope that helps. :rolleyes:
     
  49. jeremyco

    jeremyco

    Unity Technologies

    Joined:
    Oct 17, 2018
    Posts:
    38
    USD Unity SDK support is currently limited to Windows, Linux and macOS -- there currently is no Android or iOS build of the native libs, which is the limiting factor.
     
  50. jeremyco

    jeremyco

    Unity Technologies

    Joined:
    Oct 17, 2018
    Posts:
    38
    For USD APIs, openusd.org is the best source. Everything in the pxr namespace closely matches the original APIs provided by Pixar.