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