Search Unity

Get rotation for Alembic Points

Discussion in 'External Tools' started by grit, Sep 13, 2019.

  1. grit

    grit

    Joined:
    Nov 12, 2013
    Posts:
    13
    Hello there,

    I am importing an alembic cache (exported from Houdini) with "Import Points" checked in the Alembic import settings, so I can attach a custom mesh at the points using the Alembic Points Renderer Component, which works fine. However, the points don't seem to have the rotation information from the cache available, only the positions.
    Is the information getting imported at all, and if so, can I access it somehow? Did I miss something via import? (I checked "Import Normals".)
    Maybe we failed to include the information in the export from Houdini. Does anyone have a clue?

    I use Alembic Package V. 1.0.5 in Unity 2019.2.1f1.
    Attached to the Alembic Points Renderer is the Default Points Material with the Alembic Points Standard Shader.

    I am thankful for any hints.
     
  2. vladala

    vladala

    Unity Technologies

    Joined:
    Mar 3, 2017
    Posts:
    62
    Hey,

    I am looking through the code and the alembic standard does not contain a rotation channel for points. The supported data from the standard is: position, velocity, id, width.
    I can imagine that Houdini could export the rotation part into a Transform parented on top of the point cloud (caveat: if you have 100 point rotating around themselves, you would get 100 transforms with 1 point cloud under each containing one point). This is the only way I this could be supported (to be tested if works in Unity :) )
     
  3. grit

    grit

    Joined:
    Nov 12, 2013
    Posts:
    13
    Thank you for the fast reply. :)
    The abc file we exported from Houdini includes an orientation attribute ("orient") for each point already. (We verified by importing back to Houdini and this information is attached to the points, because the rotations show there.)
    I wonder if I can adjust / expand the Alembic importer in Unity in a way so it can read this orientation attribute ("orient") and use it for applying to the rotation of the points. This would also be great in general, because, how I understand it, the Alembic file format supports including custom attributes.
    Would it be possible to expand the importer in such a way and if so, can you point me to the right direction, how I would go for it?
    Thank you in advance.
     
  4. vladala

    vladala

    Unity Technologies

    Joined:
    Mar 3, 2017
    Posts:
    62
    Unfortunately it's very hard to support custom attributes for the unity alembic plugin. The relevant code is in the C++ part. You'd have to fork the code and implement your own custom attributes.
    If you wanna go this route:
    AlembicForUnity/Source/abci/Importer/aiPoints.cpp:146 is where the point data is being read. You need to fill in:
    aiPointsSample and move it all the way through C# and into the AlembicPointCloud attribute.

    Hope this helps. I can provide more pointers if needed.
     
  5. grit

    grit

    Joined:
    Nov 12, 2013
    Posts:
    13
    Thank you so much for the hints! I briefly looked into it, but moved to other tasks for now. I might come back to your offer later. :)
     
unityunity