OBJ Exporter not working!!!!

Hi All,

I am newbie to this forum and this is my first thread, sorry if am wrong,
i have created a terrain using terrain tools and placed some of the vegetation on that now i want to export it to .OBJ format so that i can use it in some other application, i know there are some scripts to do this but i don’t know exactly how these script to be used and however after searching i found this exporter
http://wiki.unity3d.com/index.php?title=ExportOBJ and another package from this link OBJ mesh export help - Questions & Answers - Unity Discussions and placed these scripts in “Project/assets/editor” folder, still these are not working.
Can anyone pls suggest which is the correct one. and how to use it in proper way.:face_with_spiral_eyes:

Thanks in advance,:slight_smile:
Jung Lee.

I’m afraid neither of those two scripts work with the terrain, they only work with regular meshes.
You could try this terrain exporter instead : http://wiki.unity3d.com/index.php?title=TerrainObjExporter

Hi ThermalFusion,

Thanks for the reply, i tried this too, problem was i wasn’t added any mesh filters, now i added and tried to export but i am getting error as attached, 1) steps to export terrain. 2) error saying that renderer not attached to Terrain and this is redirecting to image2.

Pls advice what can be done,

Thanks In advance,
Jung Lee.

I tried the C# version from the link ThermalFusion provided and it worked without problems.

Here it is:
1493156–83497–$TerrainToObjExporter.unitypackage (3.23 KB)

It doesnt save the textures and the exported obj can be large.

Hi Softwizz,

Thanks for ur reply, let me try that, i want textures too without textures how it is possible to use???
How can it be done???

Thanks in advance,
Jung Lee.

You have exported the mesh. Not the splatting shader from the terrain. You cannot use the textures that way.

You can export the splatmaps, and reuse them for your terrain in case you have a working splatting shader for it. Just map your terrain mesh planar from the top. There is a splatmap managing plugin in the asset store. For a splatting shader, i think one of the demo projects came with a primitive splatting shader. But i doubt that this one is compatible with the one that is in use by the Unity terrain. You can also export the splatmans manually. But i have forgotten where they reside.

I would say your best bet to use a terrain mesh in Unity is the T4M Plugin at the moment. Costs 50 bucks. It can convert Unity terrains to a mesh, directly in Unity. The textures are kept. And you get an equal functionality for painting grass and trees.

Hi Tile,

Thanks for your reply, sorry to say this i don’t know much and i didn’t understood what you have explained, before to this i have worked with 3ds max, now i just want to exporta terrain created in unity to .OBJ and want to use it in OSG Engine.
Can you pls explain in simpler way to do this.

Hi Softwizz,

i have tried that c# exporter but facing the same prob. i hope there’s something i am missing from my side, let me explain what i m doing.
explain me the steps to export pls.

  1. created terrain using terrain tools which comes with unity 4.1.
  2. applied mesh filter to that terrain.
    3)this is where i m struct, whenever i export it as a single .OBJ file it showing error saying that Renderer not attached.

Pls advice on this , i am running out of time…:face_with_spiral_eyes::rage:

Thanks in advance,
Jung Lee.

Here is how I did it.

Here is the terrain:

These are the terrain details in the inspector, you dont need the script thats attached to this terrain:

Then just the export from the menu:
1495539--83823--$menu_item.png

Select the resolution (I chose half because the files can be big) and export it:
1495539--83824--$export_window.png

Its saved, here it is imported into blender:

Without seeing how your terrain is setup I cant see what the problem can be.
Try deleting all other obj exporters and have just the one I posted earlier.

Hey Softwizz,

i am succeeded to export terrain see the below screen shots, now my question is , i am not getting textures, and i have placed some of trees and painted the Terrain as i want but i am not getting anything other than flat grayish terrain.
Is there any way to export terrain with trees and other objects with textures???

Here, i have used this attached script to export terrain. we’ll get export option in Terrain->Export to Obj. script should be placed in editor folder in project assets folder.

Pls advice if there’s any way to do this.

Thanks,
Jung Lee.

1495567–83832–$ExportTerrain.cs (7.6 KB)

Hey,

Thats amazing terrain Softwizz well done.

This just exports the mesh and nothing else. I do not of anything to export the textures.

That therrain is not mine it is from the Unity3d ‘Island Demo’

There is a link to the demo in the comments of this Article (not my article or website)

Yes put your script in a folder called Editor to get it on the menu.

Thanks softwizz, that helped me alot.

Anyone knows how to export textures with obj object and other objects too or the complete scene to .obj file.

Hoping for the replies…

Thanks in advance,
Jung Lee.