Who please makes help me me to create script to export to .tmb

Who please makes help me me to create script to export to .tmb since I have the one to concern archives .tmb

It is that I have the code to concern archives .tmb to blender (is script of a game) but I need the one to export of blender to .tmb does not matter if can be done in another version of blender I need equal it.

Thanks Python-script community


The one of down is the code that I must to concern archives .tmb I need is the one to export to .tmb

“”" Name: ‘Tantra Online (*.tmb)…’
Blender: 246
Group: ‘Import’
Tooltip: ‘Import Tantra Online *.tmb game files’
“”"

author = ‘Peter S. Stevens’
email = ‘pstevens:cryptomail*org’
url = (‘blender’, ‘elysiun’, ‘Project homepage, http://www.ragezone.com/’)
version = ‘09.05.0a’
bpydoc = “”"
This script imports Tantra Online *.tmb game files
“”"
import Blender
import struct

def tmb_read_mesh(file_object, revision):
data_chunk = file_object.read(256) # Read mesh name

  name = data_chunk[0:data_chunk.find('\0', 0)]
  
  print "mesh %s start 0x%x" % (name, file_object.tell() - 256)
  
  data_chunk = file_object.read(4) # Read vertex count
  
  vertex_count = struct.unpack('<I', data_chunk)[0]
  
  print "	vertex count %d" % vertex_count
  
  mesh_object = Blender.Object.New('Mesh', name)
  
  mesh = mesh_object.getData(mesh = True)
  
  if mesh is None:
      mesh = Blender.Mesh.New(name)
      
      mesh_object.link(mesh)
  
  mesh.vertexUV = True
  
  for x in xrange(vertex_count): # Read vertex positions
      data_chunk = file_object.read(12)
      
      position = Blender.Mathutils.Vector(struct.unpack('<3f', data_chunk))
      
      mesh.verts.extend(position)
  
  for x in xrange(vertex_count): # Read vertex normals
      data_chunk = file_object.read(12)
      
      normal = Blender.Mathutils.Vector(struct.unpack('<3f', data_chunk))
      
      vertex = mesh.verts[x]
      
      vertex.no = normal
  
  for x in xrange(vertex_count): # Read texture coordinates
      data_chunk = file_object.read(8)
      
      uv_coordinates = Blender.Mathutils.Vector(struct.unpack('<2f', data_chunk))
      
      vertex.uvco = uv_coordinates
  
  data_chunk = file_object.read(4)
  
  matrix_count = struct.unpack('<I', data_chunk)[0]
  
  print "	matrix count %d" % matrix_count
  
  if matrix_count > 1:
      data_chunk = file_object.read(4 * (matrix_count - 1))
  
  for x in xrange(matrix_count):
      data_chunk = file_object.read(64) # Read matrix
  
  data_chunk = file_object.read(12)
  
  x_count, face_count = struct.unpack_from('<2I', data_chunk, 4)
  
  if matrix_count > 1:
      data_chunk = file_object.read(4 * (matrix_count - 1))
  
  print "	face count %d, %d" % (x_count, face_count)
  
  for x in xrange(face_count):
      data_chunk = file_object.read(12)
      
      face_vertices = [mesh.verts[y] for y in struct.unpack('<3I', data_chunk)]
      
      mesh.faces.extend(face_vertices)
      
      face = mesh.faces[-1]
      
      face.uv = [vertex.uvco for vertex in face_vertices]
  
  for x in xrange(matrix_count):
      data_chunk = file_object.read(256) # Read texture file name
      
      texture_file_name = data_chunk[0:data_chunk.find('\0', 0)]
      
      print "	texture %d: %s" % (x, texture_file_name)
  
  data_chunk = file_object.read(40)
  
  if revision == 2:
      data_chunk = file_object.read(8)
      
      joint_count, unknown_0 = struct.unpack('<2I', data_chunk) # Read joint count
      
      for x in xrange(joint_count):
          data_chunk = file_object.read(256)
          
          joint_name = data_chunk[0:data_chunk.find('\0', 0)]
          
          print "	joint %s" % joint_name
      
      unknown_1 = []
      
      for x in xrange(unknown_0):
          data_chunk = file_object.read(4)
          
          unknown_1.append(struct.unpack('<I', data_chunk)[0])
      
      for unknown in unknown_1:
          for x in xrange(unknown):
              data_chunk = file_object.read(8)
      
      data_chunk = file_object.read(4) # unknown_0
      
      unknown_2 =  struct.unpack('<I', data_chunk)[0]
      
      unknown_3 = []
      
      for x in xrange(unknown_2):
          data_chunk = file_object.read(4)
          
          unknown_3.append(struct.unpack('<I', data_chunk)[0])
      
      for unknown in unknown_3:
          for x in xrange(unknown):
              data_chunk = file_object.read(4)
      
      for x in xrange(vertex_count):
          data_chunk = file_object.read(12)
  
  print "mesh %s end 0x%x" % (name, file_object.tell())
  
  return mesh_object

def tmb_read(file_path):
file_object = None

  try:
      file_object = open(file_path, 'rb')
      
      data_chunk = file_object.read(12) # Read header chunk
      
      unknown_0, revision, mesh_count = struct.unpack('<3I', data_chunk)
      
      print "mesh count %d" % mesh_count
      
      mesh_objects = []
      
      for x in xrange(mesh_count):
          mesh_objects.append(tmb_read_mesh(file_object, revision))
      
      scene = Blender.Scene.GetCurrent()
      
      for mesh_object in mesh_objects:
          scene.objects.link(mesh_object)
  except IOError, (errno, strerror):
      Blender.Draw.PupMenu("Error%%t|I/O error(%d): %s." % (errno, strerror))
  except Exception, err:
      Blender.Draw.PupMenu("Error%%t|.%s" % err)
  finally:
      if file_object is not None:
          file_object.close()

def main():
def tmb_file_selector(file_path):
if file_path and not Blender.sys.exists(file_path):
Blender.Draw.PupMenu(“Error%%t|The file %s does not exist.” % file_path)
else:
tmb_read(file_path)

  Blender.Window.FileSelector(tmb_file_selector, 'Ok', Blender.sys.makename(ext='.tmb'))

if name == “main”:
main()

Please friendly I need aid in this, I will be been thankful for all my life of those who helps me, can lower that script here:

script: http://www.mediafire.com/?clmdgkymsfooddd
secondly attached file: http://www.mediafire.com/?lbmj594ru6r4b67 (This it is a scratch file that this in format .tmb)

Thanks I will be pending of its messages.

That somebody says something to me, they do not leave me with this uncertainty. I want to listen to commentaries, if not it can, or if it is encriptado with another program.

Thanks I will be pending to have respond to me.

Thanks community, you are my last hope since I have tried with almost all and nobody says nothing to me, some say to me that you have the solution.

Thanks, with hope,

Jean C. Páez Ramírez

Please I need aid in this, no longer that to do, I will be been thankful with the soul.

hi zeap,
There’s a few things you can do to help yourself.
You could try to contact the original author to find out exactly when the script last worked.
In the script it says Blender: 246, so you could try to get Blender 2.46 version & see if the script works there.
If the script does not work in Blender 2.46, you will see an error in the console (command line that opens with Blender 2.46)
You can report the error here & maybe someone will be interested or have an answer for you.

I unload to blender blender-2.46-Windows and python-3.1.1 and everything worked with that script, but I want that they help me with one to export to that same format .tmb I will be been thankful with you.

Thanks community.

I only need that they help me with exporting to .tmb and showed the code here to matter to see if they help me with one to export to .tmb

That is everything what I want that they help me, please, are my completes hope.

Apparently nobody can help me in this problem (the creation of script to export from blender to archives .tmb), no longer I have hope of which somebody helps me, will be to leave this quiet one and to follow with this problem in my head.

Of all way thanks community, I thank for it, although at least somebody answers to me and it says to me if it does not have solution or if they did not help me.

Thanks.