Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

USD for Unity Updates

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

  1. ellka

    ellka

    Unity Technologies

    Joined:
    Jun 17, 2019
    Posts:
    11
    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:
    11
    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:
    559
    @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:
    11
    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:
    11
    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:
    559
    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:
    1
    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. mr-satru

    mr-satru

    Joined:
    Aug 7, 2014
    Posts:
    24
    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:
      197
  9. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,414
    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:
    11
    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:
    11
    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,414
    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:
    921
    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:
    33
    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:
    212
    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:
    2
    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:
    11
    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:
    11
    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:
    11
    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
  28. ellka

    ellka

    Unity Technologies

    Joined:
    Jun 17, 2019
    Posts:
    11
    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:
    32
    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:
    3
    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:
    32
  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:
    559
  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. robirobi

    robirobi

    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.
     
unityunity