mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
More fixes to max exporter
This commit is contained in:
parent
1243548892
commit
80f14fc6ac
@ -526,6 +526,15 @@ void MaxEggPlugin::DoExport() {
|
||||
|
||||
for (int i = 0; i < numEggs; i++) {
|
||||
if (eggList[i]->_checked) {
|
||||
// If "auto overwrite" was not checked and the file exists,
|
||||
// ask if the user wishes to overwrite the file
|
||||
bool do_write = true;
|
||||
if (!autoOverwrite && Filename::from_os_specific(eggList[i]->_file_name).exists()) {
|
||||
char msg[1024];
|
||||
sprintf(msg, "Overwrite file \"%s.egg\"?", eggList[i]->_short_name);
|
||||
do_write = (MessageBox(hMaxEggParams, msg, "Panda3D Exporter", MB_YESNO | MB_ICONQUESTION) == IDYES);
|
||||
}
|
||||
if (do_write) {
|
||||
MaxToEggConverter converter;
|
||||
if (converter.convert((MaxEggOptions*)eggList[i])) {
|
||||
good += 1;
|
||||
@ -534,6 +543,10 @@ void MaxEggPlugin::DoExport() {
|
||||
bad += 1;
|
||||
status << "Could not export " << eggList[i]->_short_name << ".egg\n";
|
||||
}
|
||||
} else {
|
||||
bad += 1;
|
||||
status << "Skipped file " << eggList[i]->_short_name << ".egg\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -545,7 +558,6 @@ void MaxEggPlugin::DoExport() {
|
||||
} else {
|
||||
if (bad > 0) mask |= MB_ICONEXCLAMATION;
|
||||
else mask |= MB_ICONINFORMATION;
|
||||
|
||||
MessageBox(hMaxEggParams, status.str().c_str(), "Panda3D Export results", mask);
|
||||
}
|
||||
|
||||
@ -554,16 +566,21 @@ void MaxEggPlugin::DoExport() {
|
||||
for (i = 0; i < numEggs; i++) {
|
||||
if (eggList[i]->_checked && eggList[i]->_successful) {
|
||||
if (eggList[i]->_anim_type != MaxEggOptions::AT_chan) {
|
||||
char buf[1024];
|
||||
PROCESS_INFORMATION pi;
|
||||
STARTUPINFO si;
|
||||
|
||||
memset(&si,0,sizeof(si));
|
||||
si.cb= sizeof(si);
|
||||
|
||||
sprintf(buf, "pview %s.egg?", eggList[i]->_short_name);
|
||||
char cmdLine[2048];
|
||||
// If we have just one model and animation file, pview them both
|
||||
if (numEggs == 2 && eggList[i]->_anim_type == MaxEggOptions::AT_model &&
|
||||
eggList[1-i]->_checked && eggList[1-i]->_successful &&
|
||||
eggList[1-i]->_anim_type == MaxEggOptions::AT_chan) {
|
||||
sprintf(cmdLine, "pview \"%s\" \"%s\"", eggList[i]->_file_name, eggList[1-i]->_file_name);
|
||||
} else {
|
||||
sprintf(cmdLine, "pview \"%s\"", eggList[i]->_file_name);
|
||||
}
|
||||
CreateProcess(NULL, cmdLine, NULL, NULL, FALSE, CREATE_NEW_CONSOLE,
|
||||
NULL, NULL, &si, &pi);
|
||||
pviewed += 1;
|
||||
|
@ -119,7 +119,7 @@ bool MaxToEggConverter::convert(MaxEggOptions *options) {
|
||||
output_frame_rate);
|
||||
break;
|
||||
|
||||
case AC_both:
|
||||
case MaxEggOptions::AT_both:
|
||||
// both: Put a model and its animation into the same egg file.
|
||||
_options->_anim_type = MaxEggOptions::AT_model;
|
||||
if (!convert_char_model()) {
|
||||
@ -130,7 +130,12 @@ bool MaxToEggConverter::convert(MaxEggOptions *options) {
|
||||
output_frame_rate)) {
|
||||
all_ok = false;
|
||||
}
|
||||
// Set the type back to AT_both
|
||||
_options->_anim_type = MaxEggOptions::AT_both;
|
||||
break;
|
||||
|
||||
default:
|
||||
all_ok = false;
|
||||
};
|
||||
|
||||
reparent_decals(_egg_data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user