Custom Input Scripts

   3486   5   1
User Avatar
Member
15 posts
Joined: July 2013
Offline
Hi,

I saw that you added Custom Input Scripts in the API.
I was wondering if we are only limited to sending meshs to Houdini, and if we are only limited to P,Cd and Uvs ?

I'm asking that, cause I doing a map editor in Unity and I would like to send to Houdini pretty much a point cloud but with more attributes on each points like eg: TileType, IsObstacle, …

Is it possible to send custom attributes ?

Thanks
User Avatar
Member
571 posts
Joined: May 2017
Offline
Yes, you can send just about any data that Houdini supports, therefore not just limited to Unity meshes. Similarly, all attribute types (vertex, point, primitive, detail) that the Houdini Engine API supports can be uploaded. In fact, the mesh input script (HEU_InputInterfaceMesh.cs) sends custom string attribute data for Unity material assignments.

So for your map editor, you would create a custom script that derives from HEU_InputInterface.cs, and return true for any gameobjects that contain your MonoBehaviour-derived custom component that contains the point cloud data in HEU_InputInterface::IsThisInputObjectSupported.

Then in HEU_InputInterface::CreateInputNodeWithDataUpload of your custom input script class, you'd do similar things as HEU_InputInterfaceMesh::CreateInputNodeWithDataUpload. You'll see the session.AddAttribute and HEU_GeneralUtility.SetAttributeArray in HEU_InputInterfaceMesh.cs showing how to add custom attributes. Simply use HAPI_ATTROWNER_POINT type for points.
User Avatar
Member
15 posts
Joined: July 2013
Offline
Hi,

Thanks for the quick response !

So my map editor is just editing a ScriptableObject where the data is stored.
Can I fire up the process without creating a Monobehaviour or a Houdini Assets in the scene ?

The workflow I really would like is:
- From the map editor click a button “Build Map”
- Send data to houdini
- Houdini will process the data and save results (meshs, and a json for scattering objects) in a predefined folder in the Unity Project.

Thanks !
User Avatar
Member
571 posts
Joined: May 2017
Offline
Yes you can do so without requiring any scene object. Check out Plugins/HoudiniEngineUnity/Scripts/Examples/HEU_ScriptMeshInputUVLayoutExample.cs
This is a script that uploads selected mesh data into Houdini, without having to load an HDA or even use the custom input script. It creates Houdini nodes dynamically and uploads the data into an input node.
User Avatar
Member
15 posts
Joined: July 2013
Offline
Awesome thanks !
I'm asking all of that cause I'm just using apprentice right now and want to know the limitation of HE.

Last question:
with this process, is there a way to debug what's happening in houdini ?

Cause I'm pretty sure I'm going to have to see what's houdini receive as input to make sure everything is fine.

Can I fire the process but have houdini open in GUI with the scene setuped ?

Thanks !
Edited by Ziboo - Dec. 7, 2018 12:41:30
User Avatar
Member
571 posts
Joined: May 2017
Offline
You won't be able to use the plugin with Apprentice. You'll need at least Houdini Engine Indie.

Yes if you have a commercial license, you can save the HIP file and open it in Houdini to see the state of the HDAs in the current session. There is code in HEU_SessionManager::OpenSessionInHoudini that does this.
  • Quick Links