Code Monkey home page Code Monkey logo

exportscenetoobj's Introduction

ExportSceneToObj

一款用于导出场景(包括GameObjectTerrian)或到.fbx模型.obj文件的Unity插件。

功能

  • 支持导出物件和地形
  • 支持自定义裁剪区域
  • 支持自动裁剪功能
  • 支持单个选择导出
  • 支持导出.fbx模型

截图

用法

  • 通过下载源码或unitypackage包导入到你的项目中(放在Assets目录下)。如果你是2018.3及以上版本,强烈建议通过Package ManagerGit来导入包(也可以下载后本地安装包):

    1. 打开Packages目录下的manifest.json文件,在dependencies下加入:
       "com.monitor1394.exportscenetoobj": "https://github.com/monitor1394/ExportSceneToObj.git",
    1. 回到Unity,可能会花1分钟左右进行下载和编译,成功后就可以开始使用了。
    2. 如果要删除ExportSceneToObj,删除掉1步骤所加的内容即可。
    3. 如果要更新ExportSceneToObj,删除manifest.json文件的lock下的com.monitor1394.exportscenetoobj相关内容即会从新下载编译。
  • 如果要自定义裁剪区域的话,场景中增加空GameObject用于表示裁剪区域(需要左下角和右上角两个空GameObject),并修改代码中CUT_LB_OBJ_PATHCUT_RT_OBJ_PATH为对应的路径

  • Unity的菜单栏上有ExportScene菜单即可

  • 怎么单独导出.fbx模型?

    1. .fbx拖到场景中
    2. Hierarchy试图中选中fbxGameObject,右键执行ExportScene --> ExportSelectedObj单独导出即可

其他

  1. 目前判断物件是否在裁剪区域只是判断物件的坐标是否在区域内,还没有实现物件边界裁剪。
  2. 只有包含MeshFilterSkinnedMeshRendererTerrian的物件才会被导出。

问题

  1. 为什么将脚本放入项目中后菜单栏还是看不到ExportScene菜单项?
    答:脚本文件放到正确的目录,同时要检查是否有其他脚本有报错没有编译通过,有报错时先要处理报错。

  2. 为什么导出的obj文件在Maya3D软件中显示正常,但在3d Max显示异常?
    答:3d Max导入设置中勾选Import as single mesh选项。

觉得有用的朋友帮忙点个star吧

参考

  1. ExportOBJ
  2. TerrainObjExporter

exportscenetoobj's People

Contributors

fananchong avatar hengle avatar monitor1394 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.