Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Loading Havok Serialization files into Unity (hkx, hkt, etc)

Discussion in 'Physics for ECS' started by Maeslezo, Jun 22, 2020.

  1. Maeslezo

    Maeslezo

    Joined:
    Jun 16, 2015
    Posts:
    304
    I am trying to load a Havok Serialized file into Unity.

    Havok has its own serialization format and I would need to import it into Unity.

    I have been checking Havok for Unity Package (https://docs.unity3d.com/Packages/com.havok.physics@0.2/manual/index.html) but I haven't seen anything about files.

    But I reckon somehow they are using Havok Serialization, because they are sharing information between Unity and Havok Debug Visualization, and they are probably using Havok Serialization for sharing information.

    For example, in the Hello World sample, we have this:
    hello world Unity.png hello world Visual Debugger.png

    I saved the information with the Havok Visual Debugger and I got the scene serialized in Havok format, in xml and hkt (they are equivalents). See the attachment havok.Serialization.zip

    So, how could I load these files back to Unity?

    Thank you
     

    Attached Files:

    Last edited: Jun 22, 2020
  2. Rory_Havok

    Rory_Havok

    Joined:
    Jun 25, 2018
    Posts:
    70
    This is not possible, because Unity doesn't know anything about the Havok file format. Also the files likely don't contain anything particularly useful - for example they are not yet able to save the actual colliders etc coming from from Unity. The best you can get currently is the graphics geometry that the VDB uses to render them.
    But again even if they were able to store everything you would not be able to load them into Unity. That would have to be something the Havok plugin would provide, and there are no plans for that.
     
    Maeslezo likes this.
  3. Maeslezo

    Maeslezo

    Joined:
    Jun 16, 2015
    Posts:
    304
    Thank you for your answer. So it is not possible to load a Havok format nativetly.

    So, as a workaround, could it be possible, as you said, get the graphics geometry. Maybe saving the info as fbx

    You mentioned:
    How could I do that?

    Thank you
     
  4. Rory_Havok

    Rory_Havok

    Joined:
    Jun 25, 2018
    Posts:
    70
    The files you attached above have the graphics geometry in them, that is what I meant. But that data is still in a Havok format and there are no public tools to convert that to FBX etc. You could likely figure out and parse the XML yourself, but I would not recommended it since those geometries are really just a derivation of the collider geometries that came from Unity in the first place, so you have all the data you need there in Unity already. See for example the C# for the Debug Display physics component, that draws the colliders in Unity.