What programs export .mesh?

I need to export some USGS (US Geological Survey) DEM (digital elevation) model data to .mesh format. I need it to be in Roblox.mesh format . The only program I know of is Anim8tor . It basically does the .mesh 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]

      

This grid looks something like this

The problem is I have about 200MB of .3ds data that I need to convert to Roblox.mesh, but it fails to export Anim8or.mesh.

Is there any program that will export .mesh?

PS: I know that Roblox turned off the .mesh loading, but I have a script that converts it to the normal Roblox environment

0


source to share


1 answer


Open the model in Blender and export it to Roblox. grid

== Edit ==

Sorry, I just pointed out some things that I thought would work, but when I tried this I noticed that the add-on was buggy (not much work), so I edited it a bit (this is the first blender addition that i did and i'm not too sure about the .mesh part, but it might work, however expect errors):

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 a monkey head and it seems to work. It should also be noted that I removed the UV mapping and changed a lot of things (not sure if it is being handled correctly in memory, etc.).

Don't forget to activate it. The export to .mesh option should appear in the export section of the file menu.


Another way you can use is to import it into Blender, export it as .obj and import it into roblox .

+1


source







All Articles