什么程序导出.mesh? [英] What programs export .mesh?

查看:318
本文介绍了什么程序导出.mesh?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将一些USGS(美国地质调查局)DEM(数字高程模型)数据导出为.mesh格式。我需要它在 Roblox的.mesh格式。我唯一知道的程序是 Anim8tor的程序。基本上,它使得.mesh看起来像这样:

 版本1.00 
36
[12.3732,5.75607, 0.797889] [0.30353,0.52573,0.79465] [0.30902,0.80902,0] [13.5279,5.75607,0 0.356833] [0.30353,0.52573,0.74965] [0.92705,0.80902,0] [12.8664,6.13804,0.356833] [0.30353,0.52573,0.7795 ] [0.57295,1.00000,0] [12.3732,5.75607,0.779889] [0.30353,0.52573,0.74655] [0.30902,0.80902,0] [13.4437,5.13704,0.779889] [0.30353,0.52573,0.79465] [0.88197,0.50000,0] [0.13279,5.75607,0.3686833] [0.30353,0.52573,0.79465] [0.92705,0.80902,0] [12.3732,5.75607,0.779889] [0.30353,0.52573,0.79465] [0.30902,0.80902,0] [12.7301,5.13804,1.07048] 0.30353,0.52573,0.79465] [0.50000,0.50000,0] [13.4437,5.13334,0.779889] [0.30353,0.52573,0.79465] [0.88197,0.50000,0] [12.3732,4.52,0.779889] [-0.60706,0.00000,0.77965] [ 0.30902,0.199098,0] [11.7959,5.52,0 0.356833] [ - 0.60706,0.00000,0.74655] [ - 0.00000,0.69098,0] [11.7959,4.75607,0.3583333] [ - 0.60706,0.00000,0.79465] [ - 0.00000,0.33 0902,0] [12.3732,4.52,0.779889] [ - 0.60706,0.00000,0.79465] [0.30902,0.19098,0] [12.3732,5.75607,0.779889] [-0.60706,0.00000,0.77965] [0.30902,0.80902,0] [11.7959 ,5.52,0.356833] [ - 0.60706,0.00000,0.79465] [ - 0.00000,0.69098,0] [12.3732,4.52,0.779889] [ - 0.60706,0.00000,0.79465] [0.30902,0.19898,0] [12.7301,5.13804,1.07048] [-0.60706,0.00000,0.79465] [0.50000,0.50000,0] [12.3732,5.75607,0.779889] [ - 0.60706,0.00000,0.79465] [0.30902,0.80902,0] [13.4437,5.13804,0.779889] [0.30353,-0.52573] 0.79465] [0.88197,0.50000,0] [12.8664,4.13804,0.356833] [0.30353,-0.52573,0.74655] [0.57295,0.00000,0] [13.5279,4.52,0.356833] [0.30353,-0.52573,0.79465] [0.92705,0.19098 ,0] [13.4437,5.13804,0.779889] [0.30353,-0.52573,0.74655] [0.88197,0.50000,0] [12.3732,4.52,0.779889] [0.30353,-0.52573,0.79465] [0.30902,0.19098,0] [12.8664, [0.30353,-0.52573,0.79465] [0.57295,0.00000,0] [13.4437,5.13334,0.779889] [0.30353,-0.52573,0.79465] [0.88197,0.50000,0] [12.73 [0.30353,-0.52573,0.79465] [0.50000,0.50000,0] [12.3732,4.52,0.779889] [0.30353,-0.52573,0.79465] [0.30902,0.19898,0] [13.5279,5.75607,0.356833] [0.98225,0.00000,0.18759] [0.92705,0.80902,0] [13.6642,4.75607,0.356811] [0.98225,0.00000,0.18759] [1.00000,0.302,02,0] [13.6642,5.52,-0.356811] [0.98225, 0.00000,0.18759] [1.00000,0.69098,0] [13.5279,5.75607,0.3686833] [0.98225,0.00000,0.18759] [0.92705,0.80902,0] [13.5279,4.52,0.3586833] [0.98225,0.00000,0.18759] [0.92705 ,0.19098,0] [13.6642,4.75607,0.356811] [0.98225,0.00000,0.18759] [1.00000,0.302,02,0] [13.5279,5.75607,0.3586833] [0.98225,0.00000,0.18759] [0.92705,0.80902,0] [13.4437,5.13804,0.797889] [0.98225,0.00000,0.18759] [0.88197,0.50000,0] [13.5279,4.52,0.3686833] [0.98225,0.00000,0.18759] [0.92705,0.19098,0] [11.7959,5.52,05683333 ] [ - 0.49112,0.85065,0.18759] [ - 0.00000,0.69098,0] [12.5938,6.13804,-0.356811] [ - 0.49112,0.85065,0.18759] [0.42705,1.00000,0] [11.9322,5.7560 7,-0.356811] [ - 0.49112,0.85065,0.18759] [0.07295,0.80902,0] [11.7959,5.52,0 0.356833] [ - 0.49112,0.85065,0.18759] [ - 0.00000,0.69098,0] [12.8664,6.13804,0.356833] [-0.49112,0.85065,0.18759] [0.57295,1.00000,0] [12.5938,6.13804,-0.356811] [ - 0.49112,0.85065,0.18759] [0.42705,1.00000,0] [11.7959,5.52,0 0.356833] [ - 0.49112,0.85065 ,0.18759] [ - 0.00000,0.69098,0] [12.3732,5.75607,0.779889] [ - 0.49112,0.85065,0.18759] [0.30902,0.80902,0] [12.8664,6.13804,0.356833] [ - 0.49112,0.85065,0.18759] [0.57295 ,1.00000,0] [12.8664,4.13804,0.356833] [ - 0.49112,-0.85065,0.18759] [0.57295,0.00000,0] [11.9322,4.52,-0.356811] [ - 0.49112,-0.85065,0.18759] [0.07295,0.1998, 0] [12.5938,4.13804,-0.356811] [ - 0.49112,-0.85065,0.18759] [0.42705,0.00000,0] [12.8664,4.13804,0.356833] [ - 0.49112,-0.85065,0.18759] [0.57295,0.00000,0] [ - 0.49112,-0.85065,0.18759] [ - 0.00000,0.30902,0] [11.9322,4.52,-0.356811] [ - 0.49112,-0.85065,0.18759] [0.07295,0.19098,0] [12.8664, 4.1 3804,356833] [ - 0.49112,-0.85065,0.18759] [0.57295,0.00000,0] [12.3732,4.52,0.779889] [ - 0.49112,-0.85065,0.18759] [0.30902,0.19098,0] [11.7959,4.75607,3456833] [-0.49112,-0.85065,0.18759] [ - 0.00000,0.302,02,0] [12.8664,6.13804,0.356833] [0.49112,0.85065,0.18759] [0.57295,1.00000,0] [13.0869,5.75607,0.797867] [0.49112, 0.85065,0.18759] [0.69098,0.80902,0] [12.5938,6.13804,-0.356811] [0.49112,0.85065,-0.18759] [0.42705,1.00000,0] [12.8664,6.13804,0.356833] [0.49112,0.85065,-0.18759] [0.57295,1.00000,0] [13.6642,5.52,-0.356811] [0.49112,0.85065,0.18759] [1.00000,0.69098,0] [13.0869,5.75607,0.797867] [0.49112,0.85065,0.18759] [0.69098,0.80902 ,0] [12.8664,6.13804,0.356833] [0.49112,0.85065,0.18759] [0.57295,1.00000,0] [13.5279,5.75607,3456833] [0.49112,0.85065,0.18759] [0.92705,0.80902,0] [13.6642] 5.52,-0.356811] [0.49112,0.85065,0.18759] [1.00000,0.69098,0] [13.6642,4.75607,0.356811] [0.49112,-0.85065,-0.18759] [1.00000,0.30902,0] [12.5938, 4.13804,-0.356811] [0.49112,-0.85065,0.18759] [0.42705,0.00000,0] [13.0869,4.52,0.797867] [0.49112,-0.85065,-0.18759] [0.69098,0.19098,0] [13.6642,4.75607, -0.356811] [0.49112,-0.85065,-0.18759] [1.00000,0.302,02,0] [12.8664,4.13804,0.356833] [0.49112,-0.85065,-0.18759] [0.57295,0.00000,0] [12.5938,4.13804,-0.356811] [0.49112,-0.85065,-0.18759] [0.42705,0.00000,0] [13.6642,4.75607,0.356811] [0.49112,-0.85065,-0.18759] [1.00000,0.302,02] [13.5279,4.52,3556833] [0.49112, -0.85065,0.18759] [0.92705,0.19098,0] [12.8664,4.13804,0.356833] [0.49112,-0.85065,-0.18759] [0.57295,0.00000,0] [11.7959,4.75607,0.356833] [ - 0.98225,0.00000, 0.18759] [ - 0.00000,0.30902,0] [12.0164,5.13804,-0.797867] [ - 0.98225,0.00000,-0.18759] [0.11803,0.50000,0] [11.9322,4.52,-0.356811] [ - 0.98225,0.00000,-0.18759 ] [0.07295,0.199098,0] [11.7959,4.75607,3456833] [ - 0.98225,0.00000,0.18759] [ - 0.00000,0.30902,0] [11.9322,5.75607,-0.356811] [ - 0.98225,0.00000,-0.18759] 0.07295,0.8090 2,0] [12.0164,5.13804,-0.797867] [ - 0.98225,0.00000,-0.18759] [0.11803,0.50000,0] [11.7959,4.75607,0.3596833] [ - 0.98225,0.00000,0.18759] [ - 0.00000,0.30902] 0] [11.7959,5.552,0.3686833] [ - 0.98225,0.00000,0.18759] [ - 0.00000,0.69098,0] [11.9322,5.75607,-0.356811] [ - 0.98225,0.00000,-0.18759] [0.07295,0.80902,0] [13.0869,5.75607,0.797867] [0.60707,0.00000,0.79465] [0.69098,0.80902,0] [13.0869,4.52,0.797867] [0.60707,0.00000,0.79465] [0.69098,0.1998,06] [12.7301,5.13804 ,-1.07046] [0.60707,0.00000,0.79465] [0.50000,0.50000,0] [13.0869,5.75607,0.797867] [0.60707,0.00000,0.79465] [0.69098,0.80902,0] [13.6642,4.75607,0.356811] [0.60707,0.00000,0.79465] [1.00000,0.302,02,0] [13.0869,4.52,0.797867] [0.60707,0.00000,0.79465] [0.69098,0.19098,0] [13.0869,5.75607,0.797867] [0.60707,0.00000 ,-0.79465] [0.69098,0.80902,0] [13.6642,5.52,-0.356811] [0.60707,0.00000,0.79465] [1.00000,0.69098,0] [13.6642,4.75607,0.356811] [0.60707,0.00000,0.79465] [1.00000,0 .30902,0] [12.0164,5.13804,-0.797867] [ - 0.30353,0.52574,0.79465] [0.11803,0.50000,0] [13.0869,5.75607,-0.797867] [ - 0.30353,0.52574,0.79465] [0.69098,0.80902 ,0] [12.7301,5.13804,-1.07046] [ - 0.30353,0.52574,0.79465] [0.50000,0.50000,0] [12.0164,5.13804,-0.797867] [ - 0.30353,0.52574,0.79465] [0.11803,0.50000,0 ] [[12.5938,6.13804,-0.356811] [ - 0.30353,0.52574,0.79465] [0.42705,100.00,0] [13.0869,5.75607,0.797867] [ - 0.30353,0.52574,0.79465] [0.69098,0.80902,0] [ 12.0164,5.13804,-0.797867] [ - 0.30353,0.52574,0.79465] [0.11803,0.50000,0] [11.9322,5.75607,-0.356811] [ - 0.30353,0.52574,0.79465] [0.07295,0.80902,0] [12.5938, 6.13804,-0.356811] [ - 0.30353,0.52574,0.79465] [0.42705,1.00000,0] [13.0869,4.52,0.797867] [ - 0.30353,-0.52574,0.79465] [0.69098,0.19898,0] [12.0164,5.13804 ,-0.797867] [ - 0.30353,-0.52574,0.79465] [0.11803,0.50000,0] [12.7301,5.13804,-1.07046] [ - 0.30353,-0.52574,0.79465] [0.50000,0.50000,0] [13.0869,4.52 ,-0.797867] [ - 0.30353,-0.5257 4,-0.79465] [0.69098,0.19898,0] [11.9322,4.52,-0.356811] [ - 0.30353,-0.52574,0.79465] [0.07295,0.19098,0] [12.0164,5.13804,-0.797867] [ - 0.30353, 0.52574,0.79465] [0.11803,0.50000,0] [13.0869,4.52,0.797867] [ - 0.30353,-0.52574,0.79465] [0.69098,0.19898,0] [12.5938,4.13804,-0.356811] [ - 0.30353, 0.52574,0.79465] [0.42705,0.00000,0] [11.9322,4.52,-0.356811] [ - 0.30353,-0.52574,0.79465] [0.07295,0.19098,0]
pre>

该网格看起来像这个



问题是我有大约200MB的.3ds数据,我需要转换为Roblox的.mesh,但Anim8or的.mesh导出程序崩溃。



有没有任何程序可以输出.mesh吗?



PS:我知道Roblox已禁用.mesh上传但我有一个脚本将其转换为常规的Roblox地形

解决方案

Blender 将其导出到Roblox的.mesh



==编辑==



对不起,我刚才指出在某些我认为会工作的东西,但是当我尝试它时,我注意到附件是有缺陷的(没有太多的工作),所以我编辑了一点(这是我做的第一个搅拌机附件,我不太了解.mesh部分,但它可能会工作,但是期待错误):

  bl_info = {
name:Export Roblox Mesh(.mesh),
description:将所选模型导出到.mesh源:http://www.roblox.com/BlenderExport-py-item ?ID = 258 95023,
作者:原始由stravant,然后编辑,
版本:(1,0),
位置:文件>导出,
warning:,
wiki_url:http://www.roblox.com/BlenderExport-py-item?id=25895023,
类别:Import-Export
}

import bpy

def get_face_vertex_array(face,uvface,mesh,matrix):
varray = []
for inx,verti in enumerate(face.vertices):
tcoord =(matrix * mesh.vertices [verti] .co).to_tuple(3)
tnorm =(matrix.to_3x3 )* face.normal).normalized()。to_tuple(3)
tuv =(0,0,0)
varray.append((tcoord,tnorm,tuv))
return varray

def write_tuple_3(tuple,file,flip):
如果翻转:
file.write([+ str(tuple [0])+,+ str (tuple [2])+,+ str(tuple [1])+])
else:
file.write([+ str(tuple [0])+ ,+ str(tuple [1])+,+ str(tuple [2])+])

def write_verts(varray,nverts,file):
file对于varray中的vert的

write_tuple_3(vert [0],file,True)
wr(str(nverts)+\\\

ite_tuple_3(vert [1],file,True)
write_tuple_3(vert [2],file,False)
file.write(\\\


def do_export (path,selected_only):
file = open(path,w)
file.write(version 1.00 \\\

tmp_mesh_verts = []
tmp_mesh_size = 0
invert_rot = False
场景= bpy.context.scene

(在selected_only和bpy.context.selected_objects或bpy.data.objects中):
如果obj.type ==MESH:
tmp_mesh = obj.to_mesh(scene,True,PREVIEW)
matrix = obj.matrix_world.copy()
用于索引,枚举(tmp_mesh.tessfaces):
verts = get_face_vertex_array(face,None,tmp_mesh,matrix)
如果len(verts)> 3:
如果invert_rot:
tmp_mesh_verts.extend([verts [2],verts [1],verts [0],verts [3],verts [2],verts [0]])
else:
tmp_mesh_verts.extend([verts [0],verts [1],verts [2],verts [0],verts [2],verts [3]]
tmp_mesh_size + = 2
else:
如果invert_rot:
tmp_mesh_verts.extend([verts [2],verts [1],verts [0]]
else:
tmp_mesh_verts.extend([verts [0],verts [1],verts [2]]
tmp_mesh_size + = 1
bpy.data.meshes.remove(tmp_mesh)
write_verts tmp_mesh_verts,tmp_mesh_size,file)
file.close()

class RbxExporter(bpy.types.Operator):
将模型导出到.mesh$ $ b bl_idname =export.mesh
bl_label =导出RBXMesh

filepath = bpy.props.StringProperty(subtype = FILE_PATH)
ends = bpy.props.StringProperty(name =File ending,description =要使用的文件,maxlen = 1024,default =.mesh)
selected_only = bpy.props.BoolProperty(name =仅限所选对象,description =仅导出所选对象?,default = False)

def execute(self,context):
print(RBX :: Execute)
do_export(self.filepath +(self.filepath.endswith(self.ending)和或self.ending),self.selected_only)
return {


def invoke(self,context,event):
print(RBX :: Invoke)
context.window_manager.fileselect_add(self)
return {RUNNING_MODAL}

def menu_func(self,context):
print(RBX :: MenuFunc)
self.layout.operator(RbxExporter.bl_idname,text =Roblox Mesh(.mesh))

def register():
print(RBX :: Register)
bpy.utils.register_class(RbxExporter)
bpy.types.INFO_MT_file_export。 append(menu_func)

def unregister():
print(RBX :: Unregister)
bpy.utils.unregister_class(RbxExporter)
bpy.types。 INFO_MT_file_export.remove(menu_func)

如果__name__ ==__main__:
注册()

我在猴头上尝试过,似乎工作。
还要注意的是,我删除了UV映射并更改了很多东西(不知道如果它在内存中正确处理等等)。



记住激活它
导出到.mesh的选项应该出现在文件菜单的导出部分。






另一种方法您可以使用的是将其导入Blender,将其导出为.obj,并将导入它在roblox


I need to export some USGS (U.S. Geological Survey) DEM (Digital Elevation Model) data into .mesh format. I need it to be in the Roblox's .mesh format though. The only program that I know that does this is Anim8tor's program. Basically it makes the .mesh look like this:

version 1.00
36
[12.3732, 5.75607, 0.797889][0.30353, 0.52573, 0.79465][0.30902, 0.80902, 0][13.5279, 5.75607, 0.356833][0.30353, 0.52573, 0.79465][0.92705, 0.80902, 0][12.8664, 6.13804, 0.356833][0.30353, 0.52573, 0.79465][0.57295, 1.00000, 0][12.3732, 5.75607, 0.797889][0.30353, 0.52573, 0.79465][0.30902, 0.80902, 0][13.4437, 5.13804, 0.797889][0.30353, 0.52573, 0.79465][0.88197, 0.50000, 0][13.5279, 5.75607, 0.356833][0.30353, 0.52573, 0.79465][0.92705, 0.80902, 0][12.3732, 5.75607, 0.797889][0.30353, 0.52573, 0.79465][0.30902, 0.80902, 0][12.7301, 5.13804, 1.07048][0.30353, 0.52573, 0.79465][0.50000, 0.50000, 0][13.4437, 5.13804, 0.797889][0.30353, 0.52573, 0.79465][0.88197, 0.50000, 0][12.3732, 4.52, 0.797889][-0.60706, 0.00000, 0.79465][0.30902, 0.19098, 0][11.7959, 5.52, 0.356833][-0.60706, 0.00000, 0.79465][-0.00000, 0.69098, 0][11.7959, 4.75607, 0.356833][-0.60706, 0.00000, 0.79465][-0.00000, 0.30902, 0][12.3732, 4.52, 0.797889][-0.60706, 0.00000, 0.79465][0.30902, 0.19098, 0][12.3732, 5.75607, 0.797889][-0.60706, 0.00000, 0.79465][0.30902, 0.80902, 0][11.7959, 5.52, 0.356833][-0.60706, 0.00000, 0.79465][-0.00000, 0.69098, 0][12.3732, 4.52, 0.797889][-0.60706, 0.00000, 0.79465][0.30902, 0.19098, 0][12.7301, 5.13804, 1.07048][-0.60706, 0.00000, 0.79465][0.50000, 0.50000, 0][12.3732, 5.75607, 0.797889][-0.60706, 0.00000, 0.79465][0.30902, 0.80902, 0][13.4437, 5.13804, 0.797889][0.30353, -0.52573, 0.79465][0.88197, 0.50000, 0][12.8664, 4.13804, 0.356833][0.30353, -0.52573, 0.79465][0.57295, 0.00000, 0][13.5279, 4.52, 0.356833][0.30353, -0.52573, 0.79465][0.92705, 0.19098, 0][13.4437, 5.13804, 0.797889][0.30353, -0.52573, 0.79465][0.88197, 0.50000, 0][12.3732, 4.52, 0.797889][0.30353, -0.52573, 0.79465][0.30902, 0.19098, 0][12.8664, 4.13804, 0.356833][0.30353, -0.52573, 0.79465][0.57295, 0.00000, 0][13.4437, 5.13804, 0.797889][0.30353, -0.52573, 0.79465][0.88197, 0.50000, 0][12.7301, 5.13804, 1.07048][0.30353, -0.52573, 0.79465][0.50000, 0.50000, 0][12.3732, 4.52, 0.797889][0.30353, -0.52573, 0.79465][0.30902, 0.19098, 0][13.5279, 5.75607, 0.356833][0.98225, -0.00000, 0.18759][0.92705, 0.80902, 0][13.6642, 4.75607, -0.356811][0.98225, -0.00000, 0.18759][1.00000, 0.30902, 0][13.6642, 5.52, -0.356811][0.98225, -0.00000, 0.18759][1.00000, 0.69098, 0][13.5279, 5.75607, 0.356833][0.98225, -0.00000, 0.18759][0.92705, 0.80902, 0][13.5279, 4.52, 0.356833][0.98225, -0.00000, 0.18759][0.92705, 0.19098, 0][13.6642, 4.75607, -0.356811][0.98225, -0.00000, 0.18759][1.00000, 0.30902, 0][13.5279, 5.75607, 0.356833][0.98225, -0.00000, 0.18759][0.92705, 0.80902, 0][13.4437, 5.13804, 0.797889][0.98225, -0.00000, 0.18759][0.88197, 0.50000, 0][13.5279, 4.52, 0.356833][0.98225, -0.00000, 0.18759][0.92705, 0.19098, 0][11.7959, 5.52, 0.356833][-0.49112, 0.85065, 0.18759][-0.00000, 0.69098, 0][12.5938, 6.13804, -0.356811][-0.49112, 0.85065, 0.18759][0.42705, 1.00000, 0][11.9322, 5.75607, -0.356811][-0.49112, 0.85065, 0.18759][0.07295, 0.80902, 0][11.7959, 5.52, 0.356833][-0.49112, 0.85065, 0.18759][-0.00000, 0.69098, 0][12.8664, 6.13804, 0.356833][-0.49112, 0.85065, 0.18759][0.57295, 1.00000, 0][12.5938, 6.13804, -0.356811][-0.49112, 0.85065, 0.18759][0.42705, 1.00000, 0][11.7959, 5.52, 0.356833][-0.49112, 0.85065, 0.18759][-0.00000, 0.69098, 0][12.3732, 5.75607, 0.797889][-0.49112, 0.85065, 0.18759][0.30902, 0.80902, 0][12.8664, 6.13804, 0.356833][-0.49112, 0.85065, 0.18759][0.57295, 1.00000, 0][12.8664, 4.13804, 0.356833][-0.49112, -0.85065, 0.18759][0.57295, 0.00000, 0][11.9322, 4.52, -0.356811][-0.49112, -0.85065, 0.18759][0.07295, 0.19098, 0][12.5938, 4.13804, -0.356811][-0.49112, -0.85065, 0.18759][0.42705, 0.00000, 0][12.8664, 4.13804, 0.356833][-0.49112, -0.85065, 0.18759][0.57295, 0.00000, 0][11.7959, 4.75607, 0.356833][-0.49112, -0.85065, 0.18759][-0.00000, 0.30902, 0][11.9322, 4.52, -0.356811][-0.49112, -0.85065, 0.18759][0.07295, 0.19098, 0][12.8664, 4.13804, 0.356833][-0.49112, -0.85065, 0.18759][0.57295, 0.00000, 0][12.3732, 4.52, 0.797889][-0.49112, -0.85065, 0.18759][0.30902, 0.19098, 0][11.7959, 4.75607, 0.356833][-0.49112, -0.85065, 0.18759][-0.00000, 0.30902, 0][12.8664, 6.13804, 0.356833][0.49112, 0.85065, -0.18759][0.57295, 1.00000, 0][13.0869, 5.75607, -0.797867][0.49112, 0.85065, -0.18759][0.69098, 0.80902, 0][12.5938, 6.13804, -0.356811][0.49112, 0.85065, -0.18759][0.42705, 1.00000, 0][12.8664, 6.13804, 0.356833][0.49112, 0.85065, -0.18759][0.57295, 1.00000, 0][13.6642, 5.52, -0.356811][0.49112, 0.85065, -0.18759][1.00000, 0.69098, 0][13.0869, 5.75607, -0.797867][0.49112, 0.85065, -0.18759][0.69098, 0.80902, 0][12.8664, 6.13804, 0.356833][0.49112, 0.85065, -0.18759][0.57295, 1.00000, 0][13.5279, 5.75607, 0.356833][0.49112, 0.85065, -0.18759][0.92705, 0.80902, 0][13.6642, 5.52, -0.356811][0.49112, 0.85065, -0.18759][1.00000, 0.69098, 0][13.6642, 4.75607, -0.356811][0.49112, -0.85065, -0.18759][1.00000, 0.30902, 0][12.5938, 4.13804, -0.356811][0.49112, -0.85065, -0.18759][0.42705, 0.00000, 0][13.0869, 4.52, -0.797867][0.49112, -0.85065, -0.18759][0.69098, 0.19098, 0][13.6642, 4.75607, -0.356811][0.49112, -0.85065, -0.18759][1.00000, 0.30902, 0][12.8664, 4.13804, 0.356833][0.49112, -0.85065, -0.18759][0.57295, 0.00000, 0][12.5938, 4.13804, -0.356811][0.49112, -0.85065, -0.18759][0.42705, 0.00000, 0][13.6642, 4.75607, -0.356811][0.49112, -0.85065, -0.18759][1.00000, 0.30902, 0][13.5279, 4.52, 0.356833][0.49112, -0.85065, -0.18759][0.92705, 0.19098, 0][12.8664, 4.13804, 0.356833][0.49112, -0.85065, -0.18759][0.57295, 0.00000, 0][11.7959, 4.75607, 0.356833][-0.98225, 0.00000, -0.18759][-0.00000, 0.30902, 0][12.0164, 5.13804, -0.797867][-0.98225, 0.00000, -0.18759][0.11803, 0.50000, 0][11.9322, 4.52, -0.356811][-0.98225, 0.00000, -0.18759][0.07295, 0.19098, 0][11.7959, 4.75607, 0.356833][-0.98225, 0.00000, -0.18759][-0.00000, 0.30902, 0][11.9322, 5.75607, -0.356811][-0.98225, 0.00000, -0.18759][0.07295, 0.80902, 0][12.0164, 5.13804, -0.797867][-0.98225, 0.00000, -0.18759][0.11803, 0.50000, 0][11.7959, 4.75607, 0.356833][-0.98225, 0.00000, -0.18759][-0.00000, 0.30902, 0][11.7959, 5.52, 0.356833][-0.98225, 0.00000, -0.18759][-0.00000, 0.69098, 0][11.9322, 5.75607, -0.356811][-0.98225, 0.00000, -0.18759][0.07295, 0.80902, 0][13.0869, 5.75607, -0.797867][0.60707, 0.00000, -0.79465][0.69098, 0.80902, 0][13.0869, 4.52, -0.797867][0.60707, 0.00000, -0.79465][0.69098, 0.19098, 0][12.7301, 5.13804, -1.07046][0.60707, 0.00000, -0.79465][0.50000, 0.50000, 0][13.0869, 5.75607, -0.797867][0.60707, 0.00000, -0.79465][0.69098, 0.80902, 0][13.6642, 4.75607, -0.356811][0.60707, 0.00000, -0.79465][1.00000, 0.30902, 0][13.0869, 4.52, -0.797867][0.60707, 0.00000, -0.79465][0.69098, 0.19098, 0][13.0869, 5.75607, -0.797867][0.60707, 0.00000, -0.79465][0.69098, 0.80902, 0][13.6642, 5.52, -0.356811][0.60707, 0.00000, -0.79465][1.00000, 0.69098, 0][13.6642, 4.75607, -0.356811][0.60707, 0.00000, -0.79465][1.00000, 0.30902, 0][12.0164, 5.13804, -0.797867][-0.30353, 0.52574, -0.79465][0.11803, 0.50000, 0][13.0869, 5.75607, -0.797867][-0.30353, 0.52574, -0.79465][0.69098, 0.80902, 0][12.7301, 5.13804, -1.07046][-0.30353, 0.52574, -0.79465][0.50000, 0.50000, 0][12.0164, 5.13804, -0.797867][-0.30353, 0.52574, -0.79465][0.11803, 0.50000, 0][12.5938, 6.13804, -0.356811][-0.30353, 0.52574, -0.79465][0.42705, 1.00000, 0][13.0869, 5.75607, -0.797867][-0.30353, 0.52574, -0.79465][0.69098, 0.80902, 0][12.0164, 5.13804, -0.797867][-0.30353, 0.52574, -0.79465][0.11803, 0.50000, 0][11.9322, 5.75607, -0.356811][-0.30353, 0.52574, -0.79465][0.07295, 0.80902, 0][12.5938, 6.13804, -0.356811][-0.30353, 0.52574, -0.79465][0.42705, 1.00000, 0][13.0869, 4.52, -0.797867][-0.30353, -0.52574, -0.79465][0.69098, 0.19098, 0][12.0164, 5.13804, -0.797867][-0.30353, -0.52574, -0.79465][0.11803, 0.50000, 0][12.7301, 5.13804, -1.07046][-0.30353, -0.52574, -0.79465][0.50000, 0.50000, 0][13.0869, 4.52, -0.797867][-0.30353, -0.52574, -0.79465][0.69098, 0.19098, 0][11.9322, 4.52, -0.356811][-0.30353, -0.52574, -0.79465][0.07295, 0.19098, 0][12.0164, 5.13804, -0.797867][-0.30353, -0.52574, -0.79465][0.11803, 0.50000, 0][13.0869, 4.52, -0.797867][-0.30353, -0.52574, -0.79465][0.69098, 0.19098, 0][12.5938, 4.13804, -0.356811][-0.30353, -0.52574, -0.79465][0.42705, 0.00000, 0][11.9322, 4.52, -0.356811][-0.30353, -0.52574, -0.79465][0.07295, 0.19098, 0]

That mesh looks something like this

The problem is that I have about 200MB of .3ds data that I need to convert to Roblox's .mesh but Anim8or's .mesh exporter crashes.

Is there any program that exports .mesh like that?

PS: I know Roblox disabled .mesh uploading but I have a script that converts it into regular Roblox terrain

解决方案

Open the model in Blender and export it to Roblox's .mesh

==Edit==

Sorry, I just pointed at some stuff that i thought would work, but when I tried it I noticed that the add-on was flawed (not much of it was working) so I edited it a bit (it is the first blender add-on I have made, and I am not too sure about the .mesh part, but it might work, however expect bugs):

bl_info = {
    "name": "Export Roblox Mesh (.mesh)",
    "description": "Exports the selected model to .mesh    Source: http://www.roblox.com/BlenderExport-py-item?id=25895023",
    "author": "Original by stravant, then edited",
    "version": (1,0),
    "location": "File > Export",
    "warning": "",
    "wiki_url": "http://www.roblox.com/BlenderExport-py-item?id=25895023",
    "category": "Import-Export"
}

import bpy

def get_face_vertex_array(face, uvface, mesh, matrix):
    varray = []
    for inx, verti in enumerate(face.vertices):
        tcoord = (matrix * mesh.vertices[verti].co).to_tuple(3)
        tnorm = (matrix.to_3x3() * face.normal).normalized().to_tuple(3)
        tuv = (0,0,0)
        varray.append((tcoord, tnorm, tuv))
    return varray

def write_tuple_3(tuple, file, flip):
    if flip:
        file.write("["+str(tuple[0])+","+str(tuple[2])+","+str(tuple[1])+"]")
    else:
        file.write("["+str(tuple[0])+","+str(tuple[1])+","+str(tuple[2])+"]")

def write_verts(varray, nverts, file):
    file.write(str(nverts) + "\n")
    for vert in varray:
        write_tuple_3(vert[0], file, True)
        write_tuple_3(vert[1], file, True)
        write_tuple_3(vert[2], file, False)
    file.write("\n")

def do_export(path,selected_only):
    file = open(path, "w")
    file.write("version 1.00\n")
    tmp_mesh_verts = []
    tmp_mesh_size = 0
    invert_rot = False
    scene = bpy.context.scene

    for obj in (selected_only and bpy.context.selected_objects or bpy.data.objects):
        if obj.type == "MESH":
            tmp_mesh = obj.to_mesh(scene,True, "PREVIEW")
            matrix = obj.matrix_world.copy()
            for index, face in enumerate(tmp_mesh.tessfaces):
                verts = get_face_vertex_array(face, None, tmp_mesh, matrix)
                if len(verts) > 3:
                    if invert_rot:
                        tmp_mesh_verts.extend([verts[2], verts[1], verts[0], verts[3], verts[2], verts[0]])
                    else:
                        tmp_mesh_verts.extend([verts[0], verts[1], verts[2], verts[0], verts[2], verts[3]])
                    tmp_mesh_size += 2
                else:
                    if invert_rot:
                        tmp_mesh_verts.extend([verts[2], verts[1], verts[0]])
                    else:
                        tmp_mesh_verts.extend([verts[0], verts[1], verts[2]])
                    tmp_mesh_size += 1
            bpy.data.meshes.remove(tmp_mesh)
    write_verts(tmp_mesh_verts, tmp_mesh_size, file)
    file.close()

class RbxExporter(bpy.types.Operator):
    """Export model to .mesh"""
    bl_idname = "export.mesh"
    bl_label = "Export RBXMesh"

    filepath = bpy.props.StringProperty(subtype="FILE_PATH")
    ending = bpy.props.StringProperty(name="File ending", description="The file ending to be used", maxlen= 1024, default= ".mesh")
    selected_only = bpy.props.BoolProperty(name="Selected objects only", description="Export only the selected objects?", default= False)

    def execute(self, context):
        print("RBX::Execute")
        do_export(self.filepath + (self.filepath.endswith(self.ending) and "" or self.ending),self.selected_only)
        return {"FINISHED"}

    def invoke(self, context, event):
        print("RBX::Invoke")
        context.window_manager.fileselect_add(self)
        return {"RUNNING_MODAL"}

def menu_func(self, context):
    print("RBX::MenuFunc")
    self.layout.operator(RbxExporter.bl_idname, text="Roblox Mesh (.mesh)")

def register():
    print("RBX::Register")
    bpy.utils.register_class(RbxExporter)
    bpy.types.INFO_MT_file_export.append(menu_func)

def unregister():
    print("RBX::Unregister")
    bpy.utils.unregister_class(RbxExporter)
    bpy.types.INFO_MT_file_export.remove(menu_func)

if __name__ == "__main__":
    register()

I tried it on the monkey head, and it seems to work. Also to note is that i removed the UV mapping and changed lots of stuff (no idea if it is handled correctly in memory and so).

Remember to activate it. The option to export to .mesh should appear in the export section of the file menu.


Another method you could use is to import it in Blender, export it as .obj, and import it in roblox.

这篇关于什么程序导出.mesh?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆