Hello,
A simple version of what I would like to do is have a some 3m tall blocks in blender, and some 10m tall blocks. Import them into Unreal engine, and then replace the blocks with some nice megascans trees that I’ve scaled to be 3m and 10m.
I’m using Send to Unreal from inside Blender. Unfortunately it doesn’t import into the scene but just into the content drawer. Fortunately it sets all the pivot points to 0,0,0 so when I drag everything into the level and then set x y z to 0 0 0 in the details panel - everything moves to where it should be.
At the moment I’m using a starter content chair instead of a tree. So I select the chair in the content drawer, then pick all the 3m tall blocks in the scene - and right click and replace with chair.
However, the chair pivot point is zero - and so it just stacks a bunch of chairs at 0,0,0.
I know there are some manual ways around moving an objects pivot point. However, I’ll be dealing with hundreds of trees. I’ll have their location and heights in blender - but want to replace with Unreal assets once in Unreal.
Does anyone have any ideas?!
Thank you.
Adam
My blocks:
10 chairs on top of each other:
Is there a reason you want to do the placement in Blender instead of in unreal with the foliage tool or some sort of procedural placement?
If you are going to have hundreds of trees I would probably advice you to look into the foliage tools
Many thanks for reply. I will be using real world tree locations and heights so it’s important to retain that data. Else I totally agree!
I’m happy to answer my own question.
I exported from Blender in GLB format. And in Unreal File-import into scene. I didn’t change any settings on export or import and the objects are in the correct place and retain their own pivot point. Step one complete…
You need the trees to be part of the foliage or an hism.
Export the locations in CSV from blender with a pyton script.
Make a bluetility blueprint in engine to place instances at the locations you export.
You should script transforms so you can manilulate rotation location and scale of each item, else theyll just look copy/pasted.
Hi,
Many thanks for this. I’m going to have to do some serious googling now but I can see it could be worth it.
Thanks again.
@MostHost_LA
Hi,
Do you know of any guides or tutorials on how to do this. I’ve read and watched some things but struggling to put together the approach required. I’ve not done anything with Blueprints before. I’m ok with getting my data in an X Y Z table.
Many thanks,
Adam
Not really, but if you start with tutorials on making a plugin youll be shown where to type python code to execute.
I suggest you select the objects in blender, then run a script looping the selection and exporting the values in csv/text format (just a print will do, you can then copy and paste them to csv).
Hi Adam_Farmer,
I have some tools on the market that could really help you here.
The first is called “rdMeshTools” - it can change those Placeholder actors pivots in your level while retaining their position - ready for you to replace as trees.
The other tool is called rdBPtools - which helps you to easily convert static meshes into blueprints, into foliage or LevelInstances.
Check out:
and
Thanks both.
I’m ok with exporting the data from Blender, that part is done. I’m unclear on the next step but have found this:
It’s giving me a headache but seems like a solution.
Thanks rD. I will go have a look at them now.
Adam
1 Like
To import:
Look into blutility scripts.
Create a variable as the HSIM destination.
Drag the bp in editor and use the eyedropper or the selection option to select the instance.
Then in the BP code just start adding instances.
The process is a bit complex.
First you need to add/register the mesh to use, then you can start placing instances by adding them and setting their transform.
Your loop should probably only do about 100 instances at a time if using blueprint, otherwise the systen will likely trigger the silly endless loop message even though it really isnt endless.
To resolve that you can probably add and update an internal value that keeps track of the current instance/row record entry you reached.
The absolute nastiest part of importing things is that after years and years the data import is still 100% broken, so you have to manually select the file to import from every time you restart the editor and you are otherwise unable to use variables for it.
I dont think plugins would be able to fix that portion, but if they are (probably by coding up their own c++ data reader system), then they would definitely be a worthwile investment.
Many thanks for your help again. It’s very kind. I used the guide I linked. Your comment about data importing was really useful thank you - I didn’t know.
I’m 99% of the way there now. In play mode it works fine. If I move the graph to construction sequence and compile - it works but often all the trees disappear. The blueprint actor is visible - sometimes if I move it a few cm the trees reappear. Then disappear if I change a setting.
It’s driving me mad as I’m so close to having this working. I have 8 blueprints for 8 different tree sizes and randomly some are showing and others not.
Any ideas very welcome!
If I run Build Geometery when some blueprints aren’t showing I get a warning about a Null Static Actor. Then I can randomly move it and they reappear, re-build and the warning doesn’t appear.
The on construction event is Editor Only?
(Shouldnt be, but it could be?)
Change it to begin play or a custom call to test.