2015-06-20 58 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