Search Unity

ProBuilder: Exporting Gameobject to OBJ Runtime

Discussion in 'World Building' started by Prakash1206, Jan 27, 2020.

  1. Prakash1206

    Prakash1206

    Joined:
    Jun 21, 2019
    Posts:
    6
    Hello
    is it possible to export probuilder mesh as obj from script?

    exporting the model is supported in unity editor but was wondering if there is probuilder API support.

    Thanks
     
  2. kaarrrllll

    kaarrrllll

    Unity Technologies

    Joined:
    Aug 24, 2017
    Posts:
    552
  3. Prakash1206

    Prakash1206

    Joined:
    Jun 21, 2019
    Posts:
    6
    @kaarrrllll, Thanks for your reply.
    Spent days together to make it work but no luck yet.

    i called ExportWithFileDialog method from ExportObj.cs file [by commenting UnityEditor.EditorUtility.SaveFilePanel and passing hard coded path]

    It works well but only if we run from unity editor. we cannot build desktop app as internally it is dependent on UnityEditor at many places.
    any fix for this?

    Thanks & Regards,
    Prakash
     
  4. kaarrrllll

    kaarrrllll

    Unity Technologies

    Joined:
    Aug 24, 2017
    Posts:
    552
    Yes, you will need to move the ExportObj code into a runtime class, removing the dependencies on UnityEditor as you do so.