# Added support for automatically loading 3d models in the COLLADA format.

* CMeshManager: Changed to check for .pmd and .dae files and convert
and cache as appropriate.
 * CModelDef: Fixed misinterpreted doc comments in.
 * lib:
   * Fixed init/shutdown sequences to support multiple VFS-using tests
correctly.
   * Fixed most reported memory leaks from the new leak-reporting test
system.
   * Fixed error when trying to dump debug data about fonts after
unloading them.
 * Added sphere dae/pmd data for tests.
 * Added output buffering to DAE->PMD converter.
 * Added precompiled COLLADA converter DLLs.
 * Removed old redundant conversion script.

This was SVN commit r4709.
This commit is contained in:
Ykkrosh
2006-12-20 03:22:24 +00:00
parent ab12d7303f
commit f6de818ea8
25 changed files with 733 additions and 282 deletions
-43
View File
@@ -1,43 +0,0 @@
from ctypes import *
import sys
import os
if len(sys.argv) != 3:
print "Incorrect command-line syntax. Use"
print " " + sys.argv[0] + " input.dae output.pmd"
sys.exit(-1)
input_filename, output_filename = sys.argv[1:]
if not os.path.exists(input_filename):
print "Cannot find input file '%s'" % input_filename
sys.exit(-1)
dll_filename = {
'posix': './libCollada_dbg.so',
'nt': 'Collada.dll',
}[os.name]
library = cdll.LoadLibrary(dll_filename)
def log(severity, message):
print '[%s] %s' % (('INFO', 'WARNING', 'ERROR')[severity], message)
clog = CFUNCTYPE(None, c_int, c_char_p)(log)
# (the CFUNCTYPE must not be GC'd, so try to keep a reference)
library.set_logger(clog)
def convert_dae_to_pmd(filename):
output = []
def cb(str, len):
output.append(string_at(str, len))
cbtype = CFUNCTYPE(None, POINTER(c_char), c_uint)
status = library.convert_dae_to_pmd(filename, cbtype(cb))
assert(status == 0)
return ''.join(output)
input = open(input_filename).read()
output = convert_dae_to_pmd(input)
open(output_filename, 'wb').write(output)