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

View File

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

View File

@ -163,7 +163,7 @@ def setEnvVar( var, value ):
# -------------------------------------------------------------------------------
def getEnvVar( var ):
if Environment.has_key( var ):
if var in Environment:
return Environment[ var ]
else:
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.flush()
assimp_bin_path = getEnvVar("assimp_path")
print( "assimp_bin_path = " + assimp_bin_pat )
print( "assimp_bin_path = " + assimp_bin_path )
command = [assimp_bin_path,
"dump",
fullpath, outfile_actual, "-b", "-s", "-l" ] +\
pppreset.split()
print(command = " + command )
print( "command = " + str( command ) )
r = subprocess.call(command, **shellparams)
outfile_results.flush()