Using VTK with unity for reading .VTU files but not Visualizing. Mac OS

Working on a project in Unity and looking to be able to read and visualize VTU files that are compressed with “vtkZLibDataCompressor” and use a binary format for the byte information.

Currently I can read and visualize VTU uncompressed files with raw formatting.

There are a couple of things I’m stuck on.

  1. Installing VTK and using its libraries with Unity and C#. I went through the steps here:
    Built the libraries within my unity project, but now trying to use them and I cant seem to use like how the examples for C# do. Basically trying to import like this using Kitware.VTK. The folder I built in to in the unity project is called Kitware. Could be something super simple I’m missing but if there is another way to follow the install process or video of some sort that would be great.

  2. From what I can tell ActiViz is the main way VTK is used with unity. However its libraries are built for windows and there does not seem to be Mac OS support. My understanding is though this is purely the code for rendering and visualization. I do not need that code I only need the code to read through this compressed type of VTU file. So basically I want to read and store the data from the file and use that to build gameobjects to visualize myself. Is that possible or do I have to use ActiViz to access the VTK libraries in unity? This also goes back to installing as I’m sure Im probably installing everything wrong in the first place. lol

For compression sake, here is the current format of VTUi can read and visualize vs the format I want to be able to read and visualize.
What i can read:

<VTKFile type="UnstructuredGrid" byte_order="LittleEndian">
    <Piece NumberOfPoints="#### NumberOfCells="####">
      <CellData Scalars="Pressure" Vectors="Velocity">
        <DataArray Name="Pressure" type="Float32" format="appended" offset="#" /> 
        <DataArray Name="WSS" type="Float32" format="appended" offset="#" /> 
  <AppendedData encoding="raw">
"Bytes here"

What I want to read:

<VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian" compressor="vtkZLibDataCompressor">
<Piece NumberOfPoints="#" NumberOfCells="#">
<DataArray type="Float64" Name="Points" NumberOfComponents="3" format="binary">
"byte information here"

Any help would be great! Cheers!


Unity/VTK is only through Activiz afaik, but maybe @LucasGandel can elaborate

Unity/VTK is only through Activiz afaik, but maybe @LucasGandel can elaborate

That’s super unfortunate. Would it be possible to develop with ActiViz on windows but then build the actual application to Mac OS or would that still cause issues with the library? What I’m thinking is that since applications like Paraview and pyVista are compatible Mac OS and I’m pretty sure they use these same libraries that would be possible.

I confirm the VTK-Unity plugin is only available through Activiz. In its current state, it can only run on Windows.
However, we are about to release a cross-platform version of Activiz in a week or so. Windows and Linux are supported in our CD pipeline, and we can generate versions for MacOS on-demand.
This work could then be extended to the VTK-Unity plugin with small effort I think.

1 Like

Great, I’ll be following this progress in the meantime then.
Thanks for the help guys.