Currently this is a very bare bones exporter!
This will export static meshes only!
Based on Reativas Blender exporter for Urho3D.
This is NOT well tested. It's a tool I made for my project specifically!
It makes a lot of assumptions as far as set up and exporting.
Tested in Houdini 13 only. Using Python 2.* that is bundled with it.
I've split it into 3 shelf tools.
Put the python scripts in your houdini user folder, usually ~/houdini[version]/scripts/python
- "urho mesh" : export a simple static mesh object
- "urho scene" : save XML prefab
- "urho component" : set up paramaters for components
- Currently only supports:
- Static Mesh
- Collision Shape
- Rigid Body
- "Light"
Each respective shelf tool uses the following python:
import urho
reload(urho)
urho.write_mdl()
import urho_xml
reload(urho_xml)
urho_xml.collect_nodes()
import urho_component
reload(urho_component)
urho_component.make_parms()
Select nodes (from inside a SOP) that you want to export as mdl, and push the shelf tool button.
- Mdls will be names based on the node selected.
- To be safe, Triangulate your mesh.
- All attributes are read at the point context.
- You MUST have normals at the point context.
- Supports Cd, for vertex color.
- Vertex color is a vector 4, the 4th element being alpha.
- The export will use a float placed on the "Alpha" attribute. Otherwise, alpha is set to 1 [255].
- Supports uv, and uv2.
- You can put a detail attribute called "path" to bypass the folder selection for export.
- It should be a string attribute that is the directory you want to write the mdl to.
- *example:
- */tmp/Models/ (MUST have a trailing "/")
Node should be either a "null" or a "merge", namedd COMP_*, where * is the component type. Select the node and use the shelf tool "urho component" to add the relevant parameters.
Here the same Static Mesh component is being used in 4 differen Nodes. Nodes can be either a null or merge but must be named "Node_*" where * will be the name of the node. Followed by a transform, that will be the transform information of the Node in urho.
This is some moss generated from the 4 rocks, that later is all merged into another node.
And finally the last node
Select the final node (not the transform), and use the shelf tool "urho scene" to save out the prefab. It will prompt you to select a folder you want to save into. It will use the name of the node, sans the "NODE_" prefix.
This can be loaded into Urho3D.
To do:
Bones, and Animation. LODs. Vertex Morphs.