提交 dae63a1c 编写于 作者: M Mr.doob

Merge remote-tracking branch 'alteredq/dev' into dev

------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------
-- ThreeJSExporter.ms -- ThreeJSExporter.ms
-- Exports geometry from 3ds max to Three.js models in ASCII JSON format v2 -- Exports geometry from 3ds max to Three.js models in ASCII JSON format v3
-- By alteredq / http://alteredqualia.com -- By alteredq / http://alteredqualia.com
------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------
...@@ -10,17 +10,17 @@ rollout ThreeJSExporter "ThreeJSExporter" ...@@ -10,17 +10,17 @@ rollout ThreeJSExporter "ThreeJSExporter"
local ostream, local ostream,
headerFormat = "// Converted from: % headerFormat = "\"metadata\":
// vertices: % {
// normals: % \"sourceFile\": \"%\",
// colors: % \"generatedBy\": \"3ds max ThreeJSExporter\",
// uvs: % \"vertices\": %,
// triangles: % \"normals\": %,
// materials: % \"colors\": %,
// \"uvs\": %,
// Generated with 3ds max ThreeJSExporter \"triangles\": %,
// http://github.com/alteredq/three.js/blob/master/utils/exporters/max/ThreeJSExporter.ms \"materials\": %
},
", ",
...@@ -34,13 +34,13 @@ rollout ThreeJSExporter "ThreeJSExporter" ...@@ -34,13 +34,13 @@ rollout ThreeJSExporter "ThreeJSExporter"
triNFormat = "%,%,%,%,%,%,%", triNFormat = "%,%,%,%,%,%,%",
triUVNFormat = "%,%,%,%,%,%,%,%,%,%", triUVNFormat = "%,%,%,%,%,%,%,%,%,%",
footerFormat = "}\n\npostMessage( model );\nclose();" footerFormat = "}"
------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------
-- User interface -- User interface
group "ThreeJSExporter v0.7" group "ThreeJSExporter v0.8"
( (
label msg "Exports selected meshes in Three.js ascii JSON format" align:#left label msg "Exports selected meshes in Three.js ascii JSON format" align:#left
...@@ -983,29 +983,28 @@ rollout ThreeJSExporter "ThreeJSExporter" ...@@ -983,29 +983,28 @@ rollout ThreeJSExporter "ThreeJSExporter"
) )
-- Dump header
Format headerFormat maxFileName totalVertices totalNormals totalColors totalUvs totalFaces totalMaterials to:ostream
-- Dump objects (debug) -- Dump objects (debug)
Format "// Source objects:\n\n" to:ostream -- Format "// Source objects:\n\n" to:ostream
i = 0 -- i = 0
for obj in meshObjects do -- for obj in meshObjects do
( -- (
meshName = obj[2] -- meshName = obj[2]
Format "// %: %\n" i meshName to:ostream -- Format "// %: %\n" i meshName to:ostream
i += 1 -- i += 1
) -- )
-- Dump model -- Dump model
Format "\n\nvar model = {\n\n" to:ostream Format "{\n\n" to:ostream
Format "\"version\" :2,\n\n" to:ostream
-- Dump header
Format headerFormat maxFileName totalVertices totalNormals totalColors totalUvs totalFaces totalMaterials to:ostream
-- Dump all materials in the scene -- Dump all materials in the scene
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册