Search Unity

Prototype of an edit mesh for my navigation mesh pathfinder

Discussion in 'Scripting' started by mgrenier, May 30, 2011.

  1. mgrenier

    mgrenier

    Joined:
    Apr 26, 2011
    Posts:
    57
    Yesterday I began toying with the Editor API to create a simple edit mesh plugin for my navigation mesh pathfinder.

    I've been struggling with mouse event and all, but I managed to build a prototype.



    I plan only to implement the following features:
    • Moving vertices
    • Removing vertices
    • Create triangle from 3 vertices
    • Create vertex along border edges (outside edges)
    • Name link edges (inside edges) to be accessible with code to open/close connection between triangle (for the pathfind algo)
    • Remove triangle
    • Remove edges

    If there is an interest, I'll release the 2 classes some where for others to extends.


    Does Unity expose an API to save/export a meshes? For the moment, the plugin seems to affect the original prefab: subsequent GameObject based on the same prefab preserve the deformation till I Reimport my mesh, even though I Losed prefab.
     
  2. callahan.44

    callahan.44

    Joined:
    Jan 9, 2010
    Posts:
    694
    Unity doesn't have a native file type, that I'm aware of.

    There is the ObjExporter script, but I'd suggest writing a Collada exporter (XML based file)
     
  3. mgrenier

    mgrenier

    Joined:
    Apr 26, 2011
    Posts:
    57
    Thanks, I'll go with Collada then !
     
  4. mgrenier

    mgrenier

    Joined:
    Apr 26, 2011
    Posts:
    57