KML import export tutorial

Exchanging KML files between Google Earth and 3ds Max is pretty easy with my recently released KMLparser for 3ds Max. You can do a KML import and export in just a few mousclicks. Transferring shapes between GE and max isn’t just about the shapes themselves, but also about the geo-locations. The script should take care of that, as long as you respect the UTMzone you’re in.

Get the sample data hereGet the script here

Here’s a short workflow description.

  1. Pick a location in Google Earth you want to enhance. In my case the Edo Castle in Tokyo.
  2. Draw a shape you can use as a reference in 3ds Max. In my case the outline of the castle. You can use paths or polygons in Google Earth
  3. Save the shapes as a KML-file
  4. Import the KML file in 3ds Max. Make sure you use the correct UTMzone. For Tokyo that’s zone 54.
  5. Draw your design in 3ds Max. Collapse everything to one or more editable splines.
  6. Make the shapes of the new design a child of the KML parent. This makes it easier to export the shapes to the correct location. the KML parent dummy has a custom attribute which stores the transform and UTM zone.
  7. Export the shapes. Select the KML parent and pick an output location.
  8. Open the new KML in Google Earth: voila! The new design is visible!

 

2: draw a shape as a reference

 

4: import the kml in 3ds Max

 

5: draw a new design

 

6: setup the hierarchy

 

7: export the shapes to kml

 

8: open the new design in Google Earth

 


15 comments

Lars

Hi, thanks for the script, it’s very helpful!
One thing that I could really use:
Would it be possible to export altitudes for particular vertices set in 3ds max to a kml
file?
It’s a big problem in Google Earth that it’s not possible to edit altitudes directly.
One has to edit the kml file manually – very painfull with high vertex count.

Hello Lars,
thanks for stopping by!
Adding altitudes is possible. I didn’t have the need for them, so I didn’t include them.
I saw that there are several modes to handle altitudes, relative to the ground, the sea-floor or an absolute altitude. Which type of altitude would you prefer, or do you decide case by case? Could you maybe talk a bit about the ideal way you’d like to handle altitudes?
If you have any other suggestions I’d be happy to hear them.
Klaas

Lars

Hi Klaas,
thanks for your reply!
The options to change polygon altitudes provided by google earth only work for the whole polygon, not for single vertices.
For example: I want to create a sloped street, first of all I draw the outline on a flat earth in GE, export this using your script and import it in 3ds Max. At this point it would be great to move the vertices vertically and export this back to GE while your script keeps the different vertex altitudes relative to sea level (0m).
At the moment, your script recognizes vertex coordinates in x- and y-direction, what I’m asking for is the third dimension z 🙂
I don’t know why this feature isn’t implemented in GE yet because the kml format already
supports this:

JMK_MH_Heliport
Airport_Backgrounds_Flatten_MaskClassMap
#msn_ylw-pushpin0

1
1
absolute

25.32648030906273,37.41844778958260,8.00
25.32681959970795,37.41852193994347,8.00
25.32694855424922,37.41840250980783,8.00
25.32690917810097,37.41856165217160,8.00
25.32690667047319,37.41872928729023,8.00
25.32693810934391,37.41889358112615,8.00
25.32698120879205,37.41903769366516,8.00
25.32701501419966,37.41930044876090,7.00
25.32703672444602,37.41992817027321,4.00
25.32704751493386,37.42047037020218,1.00
25.32697436980411,37.42047120195544,1.00
25.32694734965615,37.41990328447912,4.00
25.32683465522890,37.41930474632611,7.00
25.32668456355543,37.41907271563482,8.00
25.32654074258226,37.41895701120050,8.00
25.32634136222661,37.41892159072122,8.00
25.32606011430974,37.41889043567129,8.00
25.32595629884116,37.41886521847555,8.00
25.32588250131805,37.41882071257870,8.00
25.32575229430104,37.41866982959044,8.00
25.32570239609613,37.41855113934331,8.00
25.32573235385676,37.41837273504273,8.00

Thanks a lot for your efforts and this handy script!
Regards,
Lars

Lars

The tags seem to be gone above but it’s a simple kml polygon definition

jose fernado

hi . where i could find de Kml extension for 3d max 2013

jose fernado

hi . where i could find de Kml extension for 3d max 2013???

Nic

Hi Klaas!
Very useful script like all the other, many many thanks.
Just wandering if you have an intention of including also models soon.
Thanks again
Nic

Hi Nic, I’m sorry, not in the near future!

Derek

Hi Klaas

I think this script might be very useful for me as I currently go back and forth between various GIS packages and MAX to get what I need. My methods work but are a bit clumsy.

The fact that this KML parser loses the original UTM XY coordinates is a major drawback for me. I understand the reasoning behind why you have done this but what kind of losses or problems does it produce? Can you make an option to keep the original coordinates?

An additional problem with the current script is that it if I am going back and forth between GE and MAX, sometimes deciding to trace new objects in GE for importing, then every new spline/polygon brought into MAX is recentered – they are not positioned relative to each other. Can you think of a way to solve this?

Hi Derek, thanks for the feedback.
If I understand it correctly you’d like to not have the script center the imported KML to the origin of the maxfile. I’ve done this for ease of use and because having large numbers in the coordinates might get inaccurate. However you could try to use the “custom offset” or “specify transform” as it’s called in the latest version and set it to 0. This “should” place your imported shapes at the original UTM xy coordinates.
This also should answer your second question. Using the “specify transform” option places the imported KML at the location you specify consistently.

Feel free to drop me a line through the contact form at the bottom of the site for more info. I’m also working on an update which supports unit-conversion.

Nicat

Hello Where can I download KMLparser for 3DS Max 2010 64-bit?

Klaas Nienhuis

Hi Nicat, try the link at the top of the article. It’s a script so it shouldn’t be affected by the 3ds Max version you’re using.

muruganandam

what is the process to export models from 3d max

Klaas Nienhuis

If you mean export them embedded in a kml file, then I must admit I’m not sure anymore. I’ve written this script a long time ago.
However, it’s pretty easy to embed a 3D model yourself in a kml file. It requires the collada format (opencollada words best). Then just drag the collada into google earth, put it in the correct location and then save that model within google earth. GE then creates the kmz file for you.

Leave a Reply

* Will not be published