2015-06-20 56 views
0

我需要将USGS(美国地质调查局)DEM(数字高程模型)数据导出为.mesh格式。但我需要它在Roblox's .mesh format。我知道的唯一程序是Anim8tor's program。基本上,它使.mesh这个样子:什么程序导出.mesh?

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] 

该网格看起来像this

的问题是,我对.3DS数据的200MB,我需要转换为Roblox的.mesh但Anim8or的.mesh导出器崩溃。

是否有任何程序导出.mesh那样?

PS:我知道Roblox残疾人.mesh上传,但我有把它转换成普通Roblox地形

回答

1

打开模型Blenderexport it to Roblox's .mesh

== ==编辑

对不起脚本,我只是指出了一些我认为会起作用的东西,但是当我尝试它时,我发现附加组件存在缺陷(没有太多工作),所以我编辑了一下(这是第一个搅拌器附加组件我已经做了,我不太清楚.mesh部分,但它可能会工作,但期望错误):

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() 

我在猴头上试过了,它似乎工作。 另外要注意的是,我删除了紫外线贴图,并改变了很多东西(不知道它是否在内存中正确处理等)。

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


你可以使用另一种方法是将其导入搅拌机,将其导出为OBJ,和import it in roblox

+0

我该如何使用它?我试着把它作为插件安装,但它什么都不做。 – GShocked

+1

@Shocked我没有尝试过,现在当我做了,我发现它很有缺陷。编辑答案,希望它有帮助。 – ZombieSpy

+0

谢谢!我在[this](http://www.roblox.com/Polygon-to-terrain-voxel-converter-item?id=97274434)poly到terrain转换器脚本中使用它。与Anim8or相比,它还创造了大约40%的输出文件大小。 – GShocked