Search Unity

export trees to max for baking shadows

Discussion in 'Editor & General Support' started by Arno1975, Sep 30, 2014.

  1. Arno1975

    Arno1975

    Joined:
    Aug 14, 2013
    Posts:
    43
    I want to export my terrain and trees to max.
    So i can bake to texture in max with shadows from the trees that fall on my building(s). Then bring those buildings in unity. Bake the lightmap of the terrain in unity.
    I'am using the indie version and i want to have global illumination so i want to bake in max.

    i found:
    this forum tread (can't reply on it)
    http://forum.unity3d.com/threads/exporting-tree-meshes.61166/
    But it isn't solved

    this script
    http://wiki.unity3d.com/index.php?title=TerrainObjExporter
    does only export the terrain and not the trees.

    http://wiki.unity3d.com/index.php?title=ExportOBJ - doesn't work
    ArgumentException: Path is empty
    System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/FileStream.cs:209)
    System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share)
    (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
    System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding, Int32 bufferSize) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/StreamWriter.cs:124)
    System.IO.StreamWriter..ctor (System.String path)
    (wrapper remoting-invoke-with-check) System.IO.StreamWriter:.ctor (string)
    ObjExporter.WriteToFile (System.String s, System.String filename) (at Assets/Editor/ObjExporterScript.cs:157)
    ObjExporter.DoExport (Boolean makeSubmeshes) (at Assets/Editor/ObjExporterScript.cs:120)
    ObjExporter.DoExportWSubmeshes () (at Assets/Editor/ObjExporterScript.cs:78)
     
  2. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    I do it vice versa:

    1. Place trees in Max
    2. render shadows to texture in Max
    3. Export trees, import trees to Unity
    4. Run a custom script that instances unity-trees onto the unityterrain based on position and scale of maxtrees

    That way I have full control of exact position and scale of all trees.