While my question involves Houdini and the Unreal Engine, I don't believe it is a software specific issue so feel free to offer any suggestions if you have done a similar task from another package.
I'm sure many of you have or are artists that design full levels and environments for game content outside of your game engine and in proprietary tools, Maya, Max, etc. Because I'm using Houdini, a lot of the content within my level designs are procedural in which I'm using surface operators (likely to be scripts to do this in Maya or Max) for placing geometry in random (but controlled) locations throughout terrain. All is well in good on the Houdini side of things but the concern is for transferring this content into the Unreal Editor.
Now, the geometry can obviously be separated or a large combined mesh, and I have different levels of detail for those meshes. The problem I'm foreseeing is maintaining world position information from the 3D package to the game editor, particularly if all of the meshes are separate and not imported as one huge combined object. I haven't worked with level streaming too much just yet and I'm assuming this would be a bad solution.
*So in the end, I suppose my question is: 1. Is there a method of storing world position information in an object so it is placed in the correct spot once inside the Unreal Engine?
or 2. Is there a way to import a large object of say, all of my foliage and then separate it once it has been placed in the engine (assuming that because it is combined, the objects will know their position information at least relative to each other).
Any thoughts, comments, solutions, or other forseeable issues are greatly appreciated!
If this is for production I’d encourage you to break the random object out and place them by hand in Unreal (or you can hack a T3D file and import that).
If you’re just playing around you can just bring the whole thing in as a solid geometry.
But you should be able to bring in multiple object from a collada file but I don’t know if that’s true with stock unreal.
The reason for breaking it up is that you’ll have the same static mesh component and just multiple actors placed, which should save you a ton of memory
If you can access item data and write that to file in Houdini then you can
transfer it to Unreal no problem.
Several functions in UnrealEd are text based. For example when you copy a
staticmesh in UEd it will place a chunk of text on the clipboard, which can be
modified, pasted back, stored for later use.
Here is a code snippet showing the basic structure of the data unreal
expects:
MeshIndex = 0 -- Index of a mesh in the scene.
fileOut:write("Begin Map
")
fileOut:write(" Begin Level
")
for name,meshdata in pairs(SceneData) do
fileOut:write(" Begin Actor Class=StaticMeshActor Name=StaticMeshActor_"..MeshIndex.." Archetype=StaticMeshActor'Engine.Default__StaticMeshActor'
")
fileOut:write(" Begin Object Class=StaticMeshComponent Name=StaticMeshComponent0 ObjName=StaticMeshComponent_1 Archetype=StaticMeshComponent'Engine.Default__StaticMeshActor:StaticMeshComponent0'
")
fileOut:write(" StaticMesh=StaticMesh'"..meshdata.path.."'
")
fileOut:write(" bOverrideLightMapResolution=False
")
fileOut:write(" LightingChannels=(Static=True)
")
fileOut:write(" Name=\"StaticMeshComponent_"..MeshIndex.."\"
")
fileOut:write(" ObjectArchetype=StaticMeshComponent'Engine.Default__StaticMeshActor:StaticMeshComponent0'
")
fileOut:write(" End Object
")
fileOut:write(" StaticMeshComponent=StaticMeshComponent'StaticMeshComponent_"..MeshIndex.."'
")
fileOut:write(" Components(0)=StaticMeshComponent'StaticMeshComponent_"..MeshIndex.."'
")
fileOut:write(" Location=(X="..meshdata.x..",Y="..meshdata.y..",Z="..meshdata.z..")
")
fileOut:write(" Rotation=(Pitch="..meshdata.pitch..",Yaw="..meshdata.yaw..",Roll="..meshdata.roll..")
")
fileOut:write(" Tag=\"StaticMeshActor\"
")
fileOut:write(" Group=\"Baked KActors\"
")
fileOut:write(" CollisionComponent=StaticMeshComponent'StaticMeshComponent_1'
")
fileOut:write(" Name=\"StaticMeshActor_"..MeshIndex.."\"
")
fileOut:write(" ObjectArchetype=StaticMeshActor'Engine.Default__StaticMeshActor'
")
fileOut:write(" End Actor
")
end
fileOut:write(" End Level
")
fileOut:write("Begin Surface
")
fileOut:write("End Surface
")
fileOut:write("End Map
")
fileOut:close()
fileIn:close()
You might need to do some pre processing on the incoming data to
compensate for differences in unit scale and world axis.
Before you paste the generated text back to UEd, make sure you imported all
referenced objects and all related packages are fully loaded.
It is a good idea to keep the asset directory and package structures in sync,
so you don’t have to jump through hoops to get the final URL.
Thanks for these detailed responses. I'm looking into it a bit further, --seems like there will be quite a bit of parsing before I can comment on the issue again. Thanks all!