Select to view content in your preferred language

Datasmith - Unreal Engine

2623
3
03-29-2020 04:28 PM
SherifSalama
Emerging Contributor

Hello,

I have CityEngine 2019.1 - and I still struggling with exporting using Datasmith.
I am only exporting one street for testing purposes, I made it using the complete streets cga rule.

What I want is for every element to be exported individually as an instance to be replaced later in Unreal. I tried all possible combinations for Merge and Instancing.


If I am using plantations its the only element that works fine, every plant is either an instance or instanced static mesh actor which are both fine and I can replace them easily.


however for elements like benches, lamp posts... they are either merged as one element each e.g (all lamp posts one static mesh not instanced) which in this case there are also very noticeable inaccuracies in the models themselves, not about placement but the actual geometry of the models.


Or in other case the entire street is merged e.g (right sidewallk one static mesh with all the benches and lamp posts... or median and lanes one static mesh with all the lamp posts and other elements as well as one static mesh....)
seems like there is no way to export instanced elements to replace them later in unreal?? or am I mistaken.

thank you,

0 Kudos
3 Replies
BenjaminNeukom
Esri Contributor

Hi!

Currently all the geometry which is generated by CGA (not an inserted object with the insert operation ) are merged (as specified by the export options, for example "per initial shape" or "by material"). Typically objects like benches or lamp post are actually inserted (with CGA insert command) objects so they should be instanced as well?

So the only way to achieve what you want is to use CGA insert operation for all the objects you later want to replace in Unreal (we actually do this as well for some of our demo content).

We do not export all leaf shapes (CGA essentials—Help | Documentation ) as Actors. Our thinking is that exporting all objects individually would lead to a lot of Actors/instances in Unreal which in turn will lead to bad performance for larger scenes.

Let me know if you need more information or this was unclear

Best,

Benjamin

0 Kudos
SherifSalama
Emerging Contributor

Hi Benjamin,

Thanm you for your answer. Correct me if I am wrong, But I dont think "All" geometry generated by the cga rule are merged. As I mentioned earlier, plantation like trees works perfectly and are instanced and easily changeable in unreal? 

So, I think there must be something in the cga rule that generates plantation in a different way than other elements?

Regards,

0 Kudos
BenjaminNeukom
Esri Contributor

Hi!

Sorry, yes you are right. I might not have been clear.

But I dont think "All" geometry generated by the cga rule are merged.

By "generated by CGA" I mean for example geometry which is generated using the extrude or split operations in CGA.

So, I think there must be something in the cga rule that generates plantation in a different way than other elements?

If you insert an external asset (for example a "plant.fbx" or "lamp.obj") using the insert operation (for example by calling i("myPlant.obj") in CGA) it will be in a separate Actor in Unreal (or an instanced static mesh component). Those can then be replaced.

There is also some information in this blog post on how we are doing "asset replacements" in Unreal.

Let me know if that helps or you need more information  

Best,

Benjamin

0 Kudos