What is the right way to create a new HEU_InputInterface?

   1666   2   0
User Avatar
Member
122 posts
Joined: June 2019
Offline
So, I've created a custom interface to marshalling data to the hda.

Is there a way to make it appear in the list of possible inputs without messing much with the editor code?
I'm speaking about this list:


Currently I'm just using UNITY_MESH with high priority on my own interface (I'm checking for custom component in IsThisInputObjectSupported so I get an interface even if game object doesn't have mesh component).
It's working but I have a feeling that I'm missing something.

Attachments:
unity_input_types.png (27.8 KB)

User Avatar
Member
100 posts
Joined: Dec. 2020
Offline
Hi, I don't think it's possible to easily add it to the UI without messing with the editor code. If you make your own interface, UNITY_MESH should always work as the input type. (untested but I think even if it is default priority?) I discussed it a tiny bit in the documentation: https://www.sidefx.com/docs/unity/_inputs.html [www.sidefx.com] : "All other Input Objects are treated as a special case of the UNITY_MESH option. In other words, if you set the input type to UNITY_MESH, we will marshall Terrain data with default options if it is identified as a Terrain object."

If you really want to add your input interface to the dropdown list UI (Which I don't recommend because it requires modifying the plugin code), the Tilemap is the simplest example right now. If you manage to write an extension to do this more easily, please let me know and I can consider for an RFE.
User Avatar
Member
122 posts
Joined: June 2019
Offline
Thanks! Totally missed that part from the docs.
Actually using UNITY_MESH is totally fine I just wanted to confirm thats ok to use it for custom interface.

As for interfaces I think one way is provide an option like CUSTOM_INTERFACE and the let user to choose an instance derived from something like HoudiniDataInterface. Basically just expose HoudiniDataInterface in an asset, Unity then let user to choose what type exactly to create. That class could take care of checking gameobject type, marshalling etc. With this you won't need to create any registration mechanism on assemblies reload I can just create classes and choose them in an asset, Unity automatically pick them up when I would try to choose interface from UI.
  • Quick Links