Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Alembic for Unity

Discussion in 'Editor Workflows' started by ans_unity, Mar 13, 2018.

  1. vladala

    vladala

    Unity Technologies

    Joined:
    Mar 3, 2017
    Posts:
    59
    Hey,
    Thanks for the reply. The vertex color should be streamed, but you'd need a custom shader to get access to this information. An example:
    Code (CSharp):
    1. Shader "Debug/Vertex color"
    2. {
    3.    SubShader
    4.    {  
    5.       Pass
    6.       {      
    7.          CGPROGRAM      
    8.          #pragma vertex vert      
    9.          #pragma fragment frag      
    10.          #include "UnityCG.cginc"      
    11.          // vertex input: position, color      
    12.          struct appdata {          
    13.             float4 vertex : POSITION;          
    14.             fixed4 color : COLOR;      
    15.             };      
    16.          struct v2f {          
    17.          float4 pos : SV_POSITION;          
    18.          fixed4 color : COLOR;      
    19.          };      
    20.  
    21.          v2f vert (appdata v)
    22.          {          
    23.              v2f o;          
    24.              o.pos = UnityObjectToClipPos(v.vertex );          
    25.              o.color = v.color;          
    26.              return o;      
    27.          }      
    28.  
    29.          fixed4 frag (v2f i) : SV_Target
    30.          {
    31.             return i.color;
    32.            
    33.          }      
    34.          ENDCG    }}}
    35.  
    The other texcoords have special semantics inside the unity materials (eg: texcoord4 is for velocity of motion vectors, etc). The current implementation sends only the minimum set of info.
     
    SKoptev likes this.
  2. Noors84

    Noors84

    Joined:
    Jul 12, 2016
    Posts:
    8
    Hello there. I'm trying to export a default shuriken particle system from Unity to Alembic without luck.
    Using 1.0.5, I do not see the checkbox "Capture Components / Particle System ".
    Using github version,i see the checkbox, but it doesnt work either..
    Changing billboards to mesh doesnt change anything.
    If it should work, please what is the procedure?
    Thanks

    Works within Unity with "Entire scene" instead of "Target branch", but i can't import correctlyin 3d Max as i guess the particle mesh is not exported.
     
    Last edited: Aug 19, 2019
  3. vladala

    vladala

    Unity Technologies

    Joined:
    Mar 3, 2017
    Posts:
    59
    Hey,

    Thanks for the message.
    The GitHub version was not working as you noticed and when we moved to the package system it got removed.
    I will add it to road map, and see if it can get scheduled at some point (no promises :) )
     
  4. WI_Spas

    WI_Spas

    Joined:
    May 11, 2018
    Posts:
    5
    Any news regarding console support for those who haven't managed to build the plugin on their own?
     
  5. hellobard

    hellobard

    Joined:
    Sep 26, 2012
    Posts:
    128
    I an using Unity 2019.1.14f1 and alembic version 1.0.5 via the package manager. My alembic animations via the animation stream work fine in the editor, but don't show up in standalone builds on Windows. The abc files should be copied into the StreamingAssets folder of the build, but aren't. Manually copying them in does not seem to work.

    Do I need to do something to make this work or might this be a bug?

    Edit: turns out i has exported from Maya with default settings. Re-exporting with the advised settings from the documentation made it work.
     
    Last edited: Sep 5, 2019
  6. vladala

    vladala

    Unity Technologies

    Joined:
    Mar 3, 2017
    Posts:
    59
    Hey,

    I am not sure there are any plans to provide Alembic for other platforms then the editor ones. The only work in progress is for Linux.

    Vlad
     
  7. WI_Spas

    WI_Spas

    Joined:
    May 11, 2018
    Posts:
    5
    Thank you for the reply!

    That's unfortunate, we were looking forward to potentially using Alembic but since we're releasing on PS4/Xbox we'll be avoiding until there's hopefully support for it at a later date!
     
  8. Reverend-Speed

    Reverend-Speed

    Joined:
    Mar 28, 2011
    Posts:
    180
    Hi there,

    Currently having issues with Alembic files in Unity. Occasionally they seem to be losing their connection to their 'stream descriptor'. See below -
    upload_2019-10-8_16-38-6.png
    I can fix this temporarily by dragging in a new copy of the prefab and copying the Stream Player from the new copy to the gameObject with problems, moving the copied component up to the top of the Inspector stack and the removing the old, broken Alembic Stream Player... but then I get the following error while attempting (and failing) to build my project:

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityEngine.Formats.Alembic.Importer.AlembicStream.UpdateAbcTree (UnityEngine.Formats.Alembic.Sdk.aiContext ctx, UnityEngine.Formats.Alembic.Importer.AlembicTreeNode node, System.Double time, System.Boolean createMissingNodes, System.Boolean initialImport) (at Library/PackageCache/com.unity.formats.alembic@1.0.5/Runtime/Scripts/Importer/AlembicStream.cs:194)
    3. UnityEngine.Formats.Alembic.Importer.AlembicStream.AbcLoad (System.Boolean createMissingNodes, System.Boolean initialImport) (at Library/PackageCache/com.unity.formats.alembic@1.0.5/Runtime/Scripts/Importer/AlembicStream.cs:144)
    4. UnityEngine.Formats.Alembic.Importer.AlembicStreamPlayer.LoadStream (System.Boolean createMissingNodes) (at Library/PackageCache/com.unity.formats.alembic@1.0.5/Runtime/Scripts/Importer/AlembicStreamPlayer.cs:75)
    5. UnityEngine.Formats.Alembic.Importer.AlembicStreamPlayer.OnEnable () (at Library/PackageCache/com.unity.formats.alembic@1.0.5/Runtime/Scripts/Importer/AlembicStreamPlayer.cs:137)
    6. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    Can anybody help me out with this? It's a serious show-stopper, and we're scheduled to ship shortly.

    Thanks in advance,

    --Rev
     
  9. vladala

    vladala

    Unity Technologies

    Joined:
    Mar 3, 2017
    Posts:
    59
    Hey,

    Sorry to hear about your issues. What unity/package versions are you using ?

    I have not seen this issue in a very long time. When I did see it before it was due to one of 2 things:
    Package infrastructure failure or dll import issues of alembic package code: In this case reimporting the alembic package or deleting the Library did the job.
    There used to be some bugs that caused prefab instances to become broken when renaming the imported alembic file inside the project. One bug was fixed in version 1.0.5 and another was fixed in 1.0.6 (released this morning).

    If you can provide more info with some repro steps I would be glad to look at them.
     
  10. vladala

    vladala

    Unity Technologies

    Joined:
    Mar 3, 2017
    Posts:
    59
    Hey guys,

    Alembic 1.0.6 has been published on production.
    A short list of fixed:
    * Added support for Linux (does not support HDF5)
    * Fixed incorrect normal calculation when the UVs were split
    * Fixed lost references to the scene GameObject when renaming the alembic asset
    * Fixed the LitAlembic material compatibility with HDRP 4.10 (latest 2018.4 version). For 2019.2+ HDRP standard materials support vertex motion vectors
    * Fixed Vertex colour import from Houdini.
    * Fixed a case where Alembic files were not copied in player builds if they were initially disabled