Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

unity export fbx or obj

Discussion in 'Wish List' started by stan3dfx, Nov 2, 2009.

  1. stan3dfx

    stan3dfx

    Joined:
    Aug 15, 2009
    Posts:
    5
    it would be awesome to be able to export meshes out of unity so you can work on the items in maya ie to create new light maps.
    Thanks
     
  2. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Posts:
    6,183
  3. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Also, this exports a Unity terrain to .obj.

    --Eric
     
  4. inkBot

    inkBot

    Joined:
    Oct 29, 2009
    Posts:
    4
    Just wanted to pop in and say that this is perfect. Just what I need for my project.

    The EditorObjExporter script should probably be updated though. When I tried to test it out Unity gave me an error and said I should change Line 71

    Code (csharp):
    1. objMaterial.textureName = EditorUtility.GetAssetPath(mats[material].mainTexture);
    to

    Code (csharp):
    1. objMaterial.textureName = AssetDatabase.GetAssetPath(mats[material].mainTexture);
    Changed it and it worked nicely.
     
  5. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    just replicate the script with the update line and put it below on the wiki potentially putting the Unity Version in for the two (2.1 and 2.5+) :)
    Anyone can contribute to it :)
     
  6. April

    April

    Joined:
    Dec 14, 2009
    Posts:
    62
    Hi, sorry for interrupting the thread. But I have no idea how to call the ObjExporter.MeshToFile() function.

    Thanks a lot for your help.
     
  7. bradjensen68

    bradjensen68

    Joined:
    Feb 2, 2009
    Posts:
    274
    You just stick it in the "editor" folder. From the Wiki:

    You must place the script in a folder named Editor in your project's Assets folder for it to work properly. Also it must be called "ExportTerrain" or it won't run.

    After it has comiled, click on "terrain" and "export to obj"
     
  8. DaveA

    DaveA

    Joined:
    Apr 15, 2009
    Posts:
    310
  9. Cenda

    Cenda

    Joined:
    Jun 3, 2010
    Posts:
    66
    Hi, Im 3d animator and Im using Softimage. New Beast Lightmap system looks GREAT !! It would be great if I can export whole scene from unity to fbx with assigned baked texture back to Softimage. Is it possible? I know that texture are created in Project so I can assign it in Softimage manualy, but some automatic method can be better...

    So .. Is it possible: 3d software > bake light in unity > back to 3d software??
     
  10. DaveA

    DaveA

    Joined:
    Apr 15, 2009
    Posts:
    310
    I am still eagerly awaiting my 3.0, but if the light textures are created as assets and/or in any way available to scripts, then I don't see why this would not be possible.

    In fact, I'll probably write such an exporter, but for X3D, maybe Collada.
     
  11. warby

    warby

    Joined:
    Mar 23, 2009
    Posts:
    162
    it seams like vertex positions are being output in full values (integers ?!) would it be possible to modify this script to get more precisions out of the verts ?
    (not a coder)
     
  12. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    potentially you missinterpret the vertex index gotten from a triangle with a vertex?
     
  13. DaveA

    DaveA

    Joined:
    Apr 15, 2009
    Posts:
    310
    I find that just 'using' the variable results in less precision, but using ToString() gives more. Thus NOT

    Code (csharp):
    1.  
    2. outstream += v.x;
    3.  
    but
    Code (csharp):
    1.  
    2. outstream += v.x.ToString();
    3.  
     
  14. NODO-GT

    NODO-GT

    Joined:
    Nov 8, 2010
    Posts:
    24
    Hi,

    I have problem using this script.

    I was building game from mobile platform and then i found out that i terrain data is not supported for mobiles :(

    I would like to convent my terrain to object and import it back as a mesh, i guess this is possible with TerrainObjExporter.

    when i try to export i get error on line 29.


    thanks in advance
     
  15. dongle

    dongle

    Joined:
    Jan 12, 2011
    Posts:
    2
    Sorry to necro an old thread. I had a similar problem to NODO-GT. If you're getting that error, your filename is probably incorrect. I accidentally named my script 'ExportTerrain.js.js' and had errors. Renaming the script fixed the issues that I was having.
     
  16. Ted D

    Ted D

    Joined:
    Dec 25, 2012
    Posts:
    1
    I want to export a terrain to maya, but expericenced the same disappointing results as others. I am not a developer and have no experience writing script. Will the script on wiki work and does it require a special script program to insert it into the proper place?
    I read the instructions for getting the obj export to work, but had no success, because I do not know how to handle the script and its proper placement in the editor folder. I will appreciate any help anyone can give.____Thanks

    Ted D