AssxmlExporter: fix crash in writing header info in VS2015.

pull/859/head
Kim Kulling 2016-04-16 18:42:49 +02:00
parent 3893c593de
commit dec93efc92
3 changed files with 17 additions and 17 deletions

View File

@ -180,23 +180,22 @@ void WriteDump(const aiScene* scene, IOStream* io, bool shortened)
time_t tt = ::time(NULL); time_t tt = ::time(NULL);
tm* p = ::gmtime(&tt); tm* p = ::gmtime(&tt);
aiString name;
// write header // write header
ioprintf(io, std::string header(
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
"<ASSIMP format_id=\"1\">\n\n" "<ASSIMP format_id=\"1\">\n\n"
"<!-- XML Model dump produced by assimp dump\n" "<!-- XML Model dump produced by assimp dump\n"
" Library version: %i.%i.%i\n" " Library version: %i.%i.%i\n"
" %s\n" " %s\n"
"-->" "-->"
" \n\n" " \n\n"
"<Scene flags=\"%i\" postprocessing=\"%i\">\n", "<Scene flags=\"%i\" postprocessing=\"%i\">\n"
);
aiGetVersionMajor(),aiGetVersionMinor(),aiGetVersionRevision(),asctime(p), ioprintf( io, header.c_str(),
aiGetVersionMajor(), aiGetVersionMinor(), aiGetVersionRevision(), asctime( p ),
scene->mFlags, scene->mFlags,
0 /*globalImporter->GetEffectivePostProcessing()*/); 0 /*globalImporter->GetEffectivePostProcessing()*/ );
// write the node graph // write the node graph
WriteNode(scene->mRootNode, io, 0); WriteNode(scene->mRootNode, io, 0);
@ -266,6 +265,7 @@ void WriteDump(const aiScene* scene, IOStream* io, bool shortened)
ioprintf(io,"\t</Light>\n"); ioprintf(io,"\t</Light>\n");
} }
#endif #endif
aiString name;
// write textures // write textures
if (scene->mNumTextures) { if (scene->mNumTextures) {

View File

@ -39,7 +39,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
from Tkinter import * from tkinter import *
import sys import sys
import run import run
import result_checker as rc import result_checker as rc
@ -54,7 +54,7 @@ class RegDialog( object ):
def run_reg(self): def run_reg(self):
print "run_reg" print( "run_reg" )
run.setEnvVar( "assimp_path", self.assimp_bin_path ) run.setEnvVar( "assimp_path", self.assimp_bin_path )
run.run_test() run.run_test()
rc.run() rc.run()
@ -62,11 +62,11 @@ class RegDialog( object ):
return 0 return 0
def reg_update(self): def reg_update(self):
print "ToDo!" print( "ToDo!" )
return 0 return 0
def quit(self): def quit(self):
print "quit" print( "quit" )
sys.exit( 0 ) sys.exit( 0 )
def initUi(self): def initUi(self):
@ -78,9 +78,9 @@ class RegDialog( object ):
self.b_run_.grid( row = 0, column = 0, sticky = W+E) self.b_run_.grid( row = 0, column = 0, sticky = W+E)
self.b_update_.grid( row = 1, column = 0, sticky = W+E) self.b_update_.grid( row = 1, column = 0, sticky = W+E)
self.b_quit_.grid( row = 2, column = 0, sticky = W+E) self.b_quit_.grid( row = 2, column = 0, sticky = W+E)
self.b_run_.pack() #self.b_run_.pack()
self.b_update_.pack() #self.b_update_.pack()
self.b_quit_.pack() #self.b_quit_.pack()
self.b_update_.config( state=DISABLED ) self.b_update_.config( state=DISABLED )
root.mainloop() root.mainloop()

View File

@ -163,7 +163,7 @@ def setEnvVar( var, value ):
# ------------------------------------------------------------------------------- # -------------------------------------------------------------------------------
def getEnvVar( var ): def getEnvVar( var ):
if Environment.has_key( var ): if var in Environment:
return Environment[ var ] return Environment[ var ]
else: else:
print ( "Error: cannot find " + var ) print ( "Error: cannot find " + var )
@ -217,12 +217,12 @@ def process_dir(d, outfile_results, zipin, result ):
outfile_results.write("assimp dump "+"-"*80+"\n") outfile_results.write("assimp dump "+"-"*80+"\n")
outfile_results.flush() outfile_results.flush()
assimp_bin_path = getEnvVar("assimp_path") assimp_bin_path = getEnvVar("assimp_path")
print( "assimp_bin_path = " + assimp_bin_pat ) print( "assimp_bin_path = " + assimp_bin_path )
command = [assimp_bin_path, command = [assimp_bin_path,
"dump", "dump",
fullpath, outfile_actual, "-b", "-s", "-l" ] +\ fullpath, outfile_actual, "-b", "-s", "-l" ] +\
pppreset.split() pppreset.split()
print(command = " + command ) print( "command = " + str( command ) )
r = subprocess.call(command, **shellparams) r = subprocess.call(command, **shellparams)
outfile_results.flush() outfile_results.flush()