Infraworks JAVA Script to EXPORT Tiled areas of Terrain [ #IMPORTANT ]

Infraworks JAVA Script to EXPORT Tiled areas of Terrain [ #IMPORTANT ]

NÖRGRU™
Contributor Contributor
2,259 Views
9 Replies
Message 1 of 10

Infraworks JAVA Script to EXPORT Tiled areas of Terrain [ #IMPORTANT ]

NÖRGRU™
Contributor
Contributor

Hello Everyone ! I'm Camelo da Silva Poloni, Manuel. A 23 years old Northern-Eastern Italian Inventor & 3d/CAD Designer.

Today I'm here to ask you Guys for you Luminous and Kind Support ( I Love Autodesk and its Community ). It have been years up to this day, that I've seen the Potential of Autodesk Infraworks in the "Gaming/Simulation" Industry. In Infraworks we can literally import real world DEM/Raster Images data and the program basically autogenerates all the hard work for us. It creates a realistic 3d landscape of a 1:1 real-world scale of terrain. The more detailed the Topographic data is, the more realistic Infraworks generates the 3d model of the terrain. Nowdays the average levels of details you can get here from the Internet are about 30m (#new - the 90m is the old one) of altitude SRTM "satellite/orbital" scannings of Earth.

It's not that Impressive, but it's good enough. I've even managed to get a 10m terrain data, and those are actually very good, but it's rare to find them.

https://www.eorc.jaxa.jp/ALOS/en/aw3d30/index.htm

https://dwtkns.com/srtm30m/

http://tinitaly.pi.ingv.it/download.html   <-- the LIDAR scanning / Italian 10m thing.. Which is very Good but must be combined with "sub-dem data" and behave as an overlay because at the "edges" of the national boundaries of italy, this LIDAR data it's harshly CUT.. some people will understand what I'm talking about.


So, let's get back on track.. I've seen the outstanding potential of Infraworks. And I have the need to export the tiles of the terrain generated in it, to several softwares. Like: Zbrush, 3ds Max -> these two for fixes*
And at the end of the day the objective is to export the whole thing to Unreal Engine 4.

This.. is the "texture and detailing" workflow. But there's the other face of the medal that is the "engineering workflow" call it as you better desire, but there's the need to export tiles of the terrain into CIVIL3d first, and then after that I can export the thing to the previous mentioned "texture and detailing workflow".

I know it's complicated stuff, it really is.. I've spent years just to figure out the whole process behind this.

But, now I've find out that a script like the one I have always imagined, actually exists:

https://knowledge.autodesk.com/support/infraworks/learn-explore/caas/sfdcarticles/sfdcarticles/Infra...

I've downloaded it, and tested it.
But it doesn't work.. It gives me an error message saying:

"

[ERROR] line: 141 : Error: Export3DModel(): Can't create parent folder for C:UsersmanueDesktopA-Infraworks_JS - [ EXPO-TILES ]/tile_0_0.dae.

 

[ERROR] Error: Export3DModel(): Can't create parent folder for C:UsersmanueDesktopA-Infraworks_JS - [ EXPO-TILES ]/tile_0_0.dae.

Valutazione script: 0.412 secondi
"

I have already tried to run  Autodesk Infraworks with Admin Privileges. But nope.. the script still gives this issue.
I truly need HELP to sort this out. And there's another Request I have !

I'm in need to be able to EXPORT the tiles of the FULL landscape, in different formats of extensions. (not just .dae)

The .IMX one (for Civil3d) and the (.dae or .FBX) are required as well. I know the script already exports in .dae , but if the .fbx option is achievable it would be great !

I Still have to learn JAVA Script. I know how to modify it a bit, but I still have a lot to learn about it.. I've tried to figure out a solution for this issue on the web, but there's nothing too much specific in order to actually help to resolve the issue.

stackoverflow.com/questions/31876640/cant-create-file-because-file-doesnt-exist

*it's not helpful...


Thanks in Advance to All and here's some screenshots ! 🙂

**It's Important to understand, that a LARGE-SCALE (example: 100Km^2 or more) terrain generated in Autodesk Infraworks. It's WAY way too big to be exported at once. You need to have a "NASA Supercomputer" to do that (We're talking about tens of millions of polygons for the full-area // tiles are preferable in order to be optimized first before full "composition").. So.. the only valid solution it's to export the WHOLE Terrain by dividing it into smaller TILES. It's fully possible to do that in Infraworks in a "MANUAL" manner. But.. yeah it takes truly too much time and effort. I need an automated way in order to get the job done easily and quickly. So the Script it's the only way.

TRULY THANKS TO ALL in advance ! :')) :,))

Inv. C.Manuel.
0355AMutc+2CET - 23OCT2019.

Screenshot (11121).pngScreenshot (11122).pngScreenshot (11123).pngScreenshot (11125).pngScreenshot (11126).pngScreenshot (11127).pngScreenshot (11128).png**EXAMPLE of manual tile EXPORT**EXAMPLE of manual tile EXPORT
**EXAMPLE of manual tile EXPORT
**EXAMPLE of manual tile EXPORT**EXAMPLE of manual tile EXPORT
**EXAMPLE of manual tile EXPORT

##NOR MAIN BANNER (NEW)_blk.png

 

Accepted solutions (1)
2,260 Views
9 Replies
Replies (9)
Message 2 of 10

morgan.smith
Autodesk Support
Autodesk Support
Accepted solution

Hi @NÖRGRU™,

 

Welcome to the InfraWorks Forums.

Looking at the screenshots provided, you have used forward slashes in var targetfolder. Change to backslashes and that should start working. For Example:  var targetFolder = "C:/Data/ExportedModels/Example";

 

I recall you can change the file extension in line 134/135 to generate either FBX or OBJ files if you prefer a different file format. For example: 

 

// combine save filename
var tileFile = targetFolder + "/tile_" + x + "_" + y + ".fbx";

 

 



Morgan Smith
Implementation Consultant

Message 3 of 10

NÖRGRU™
Contributor
Contributor

Hello @morgan.smith !
Your Reply Instantly Fixed my Issue !!! Truly Thanks a Lot for your Help ! 😄

I Believe what just happened to me, shall serve as a lesson to us all. I thought the PROBLEM was so Overcomplicated that I didn't noticed how simply the solution for it really was. I have made the silly mistake to copy the Folder Address from the Win10 Folder Window. And pasted it on the directory code of the Java Script.
I was blinded by overthinking of the issue, that I couldn't see that I have used backslashes instead of forward slashes.

maxresdefault.jpg

Everything Works Perfectly NOW ! I have tested the .FBX Export only. So I still have to see about the .dae & .imx formats. However for what I've seen about the .FBX file format, the 3d Model of the terrain comes with a prefixed type of mesh resolution. I still don't know if the .dae format allows to decide wheter the imported mesh must have a HIGHLY Detailed level of subdivision of the mesh, or instead a LowRes one.

Screenshot (11749).png   Very LOWres AS you can see. / However it's possible to fix it in Zbrush.Very LOWres AS you can see. / However it's possible to fix it in Zbrush.   Screenshot (11751).pngScreenshot (11752).png   Screenshot (11753).png

Like for example it's possible to do with .STEP / .SAT / .IGES file formats.
If the TILES script allows for "subdivision customisation" Please if possible let us know.

It's the only thing that remains to be fixed, and after this. It's ALL Done for Years to come ! =D


Thanks once Again Mr. Smith and Have a Great Day !
Here's a .GIF let's see if it works, if not I'll share it on Google Drive.

*NOPE.. I managed to compress the .GIF to 7mb, but the max upload limit of this Forum for images is 5mb.
So here's the Google Drive link:
https://drive.google.com/open?id=1AwFjNS4f9irCSdb0fyFWCNyB2gm__m1S

Bye and Thanks to All !
Inv. C.Manuel.

P.S. This Forum Discussion surely will help a lot of People !

Message 4 of 10

ksullivanQR62D
Participant
Participant

Hello,  I am very curious about this workflow also.  I work on visualization for very large urban design, transportation design, and land planning sites and am trying develop a workflow for InfraWorks to Unreal 5.  As you mentioned bringing in large single FBX models to Unreal has a limit, and for very large /detailed sites is not possible.  I am looking for automated export of fbx tiles of the ground model, (or even better the ability to chose selected feature types for a tiled export (usually everything but IW trees (would rather handle those with Unreal assets))

 

Being able to process/convert those tiles to nanite meshes would allow for massive optimized accurate models for large scale simulation and visualization.  The link to the script thread in your original post is broken, would you be able to share the script and workflow??

 

-Kevin

 

 

 

 

0 Likes
Message 5 of 10

a.wilsonLXFSP
Community Visitor
Community Visitor

@ksullivanQR62D

 

I'm doing almost exactly what you're describing - exporting content from Infraworks to Unreal 5.

One thing to note is that I believe you can force Infraworks to tile your FBX exports by ensuring each 'tile' you want uses a different texture.

Essentially, you want to fan out the tiles inside each export into separate files. This can be done outside Infraworks if necessary.

 

I've built a few great routines for these purposes, perhaps we should compare notes?

0 Likes
Message 6 of 10

NÖRGRU™
Contributor
Contributor

Hello Kevin, I've just uploaded the script .zip folder down below. I suggest you to use MINE {the CUSTOM one}, I made because it exports in .fbx and in smaller tiles, unlike the original script that exports in .dae I believe.

At the moment I have no access to Autodesk Infraworks, however here's a screenshot that will fully explain you how to get it done.  Glad to Help, have a Great Day and yes back in those days I was focusing precisely in your current intention with the sole difference that in 2019, Nanite or Unreal Engine 5.. were non-existent.

 

Screenshot (42877)_Autodesk Infraworks JS export tiled FBX terrain.png

 

I was trying to break the landscape from Infraworks into tiled chunks of .FBX mesh, exactly because Unreal Engine 4 couldn't handle a massive mesh that had millions of polys in one go.

 

Technology, Progress and Ingenuity will save us all.  🙂

 

Have a Great Day !

And both of you and everyone else, consider joining our future program for Inventors at  ostinata.it


In the upcoming months, it will be ready and functioning.

Bye !

 

NÖRGRU™

northstat.it  | @northstat.it  {Instagram}

Inv. Camelo da Silva Poloni, Manuel.

1455pm utc+1 cet - MAY 22th, 2022.

Trieste - Italy.

0 Likes
Message 7 of 10

ksullivanQR62D
Participant
Participant

Great to find someone also pushing the limits on how the software was envisioned!  I would love to compare notes.  Previously I had been using Lumion, as it can decently handle large models, but I would love to transition to Unreal for a range of advantages. 

 

Another main issue I have struggled with is the texture naming convention the Infraworks FBX exporter uses.... Every material is seeming randomly named material (1) material (2) ... etc.  Also if something new is added to the Infrawroks model, the material names are reshuffled and regenerated, which breaks the association of newly applied materials in the next software.  It would be great if the texture name exported corresponded the material assigned in infraworks to maintain assignments

 

(ortho imagery material naming for tiles being its own challenge, but those material in my situation or generally not redefined.  I would love to experiment with vertex painting on the ortho-projected terrain meshes though, to supplement addition realism in specific locations)

0 Likes
Message 8 of 10

ksullivanQR62D
Participant
Participant

thanks so much for sharing the script!!!! I will be back in touch after I have experimented a bit

 

-Kevin

 

0 Likes
Message 9 of 10

a.wilsonLXFSP
Community Visitor
Community Visitor

You're quite right - the material naming conventions really need improving, as do the mesh naming.

I'm finding that unreal's datasmith format is offering a lot more flexibility for this application.

0 Likes
Message 10 of 10

ksullivanQR62D
Participant
Participant

hmm tried first test , got this error:

 

Export coordinate system:

Saving tile file: C:UsersksullivanDesktop iletest/tile_0_0.fbx

Tile Area: [{3.13824e+06, 1.00399e+07} - {3.14038e+06, 1.00416e+07}]

[ERROR] line: 141 : Error: Export3DModel(): Can't create parent folder for C:UsersksullivanDesktop iletest/tile_0_0.fbx.

 

[ERROR] Error: Export3DModel(): Can't create parent folder for C:UsersksullivanDesktop iletest/tile_0_0.fbx.

Script evaluation: 0.206 seconds

 

 

 

Forgive me I am very green when it comes to scrips etc.  Also I was wondering if there would be a way to specify an export point.  Similar to how you can have a user defined origin in the typical infraworks fbx export.  Generally i need to define a local project zero point as other software's prefer geometry closer to the origin.  My workflow involves combining detailed building assets and landscape architectural elements modeled in Rhino and Revit (exported from a local project zero) with large infraworks context and transportation network models (3000-6000 hectares)

 

 

-kevin

 

 

 

 

0 Likes