From: <ki...@us...> - 2009-03-27 12:27:10
|
Revision: 3294 http://nebuladevice.svn.sourceforge.net/nebuladevice/?rev=3294&view=rev Author: kimsama Date: 2009-03-27 12:16:27 +0000 (Fri, 27 Mar 2009) Log Message: ----------- Modified to read 'nmaxtoolbox.ini' file from '$3dsmax/scripts/nebula2' directory if it fails to read it from '$3dsmax/scripts/plugcfg' directory. It is hard to detect 'plugcfg' directory under Vista. Modified Paths: -------------- trunk/nebula2/code/contrib/nmax/src/export2/nmaxmaterial_shd.cc trunk/nebula2/code/contrib/nmax/src/export2/nmaxoptions.cc trunk/nebula2/code/contrib/nmax/src/pluginlibs/nmaxdirdlg.cc Modified: trunk/nebula2/code/contrib/nmax/src/export2/nmaxmaterial_shd.cc =================================================================== --- trunk/nebula2/code/contrib/nmax/src/export2/nmaxmaterial_shd.cc 2009-03-27 11:28:45 UTC (rev 3293) +++ trunk/nebula2/code/contrib/nmax/src/export2/nmaxmaterial_shd.cc 2009-03-27 12:16:27 UTC (rev 3294) @@ -55,12 +55,21 @@ // check the .ini file exist in 3dsmax plugin directory. if (!fileServer->FileExists(iniFilename)) { - // .ini file does not exist in '/plugcfg' directory. - n_message("%s file does not exist in '$3dsmax/plugcfg' directory.\n", - N_MAXEXPORT_INIFILE); + // try to find the .ini file in the 'scripts\nebula' dirtectory. e.g.) d:\3dsmax\Scripts\nebula2 + iniFilename = ""; + iniFilename += GetCOREInterface()->GetDir(APP_SCRIPTS_DIR); + iniFilename += "\\"; + iniFilename += "nebula2\\"; + iniFilename += N_MAXEXPORT_INIFILE; + if (!fileServer->FileExists(iniFilename)) + { + // .ini file does not exist in '/plugcfg' directory. + n_message("%s file does not exist in '$3dsmax/plugcfg' directory.\n", + N_MAXEXPORT_INIFILE); - // return a empty string. - return shdxml; + // return a empty string. + return shdxml; + } } nString homeDir; Modified: trunk/nebula2/code/contrib/nmax/src/export2/nmaxoptions.cc =================================================================== --- trunk/nebula2/code/contrib/nmax/src/export2/nmaxoptions.cc 2009-03-27 11:28:45 UTC (rev 3293) +++ trunk/nebula2/code/contrib/nmax/src/export2/nmaxoptions.cc 2009-03-27 12:16:27 UTC (rev 3294) @@ -84,9 +84,18 @@ // check the .ini file exist in 3dsmax plugin directory. if (!fileServer->FileExists(iniFilename)) { - // .ini file does not exist in '/plugcfg' directory. - n_listener("%s file does not exist in '$3dsmax/plugcfg' directory.", N_MAXEXPORT_INIFILE); - return 0; + // try to find the .ini file in the 'scripts\nebula' dirtectory. e.g.) d:\3dsmax\Scripts\nebula2 + iniFilename = ""; + iniFilename += GetCOREInterface()->GetDir(APP_SCRIPTS_DIR); + iniFilename += "\\"; + iniFilename += "nebula2\\"; + iniFilename += N_MAXEXPORT_INIFILE; + if (!fileServer->FileExists(iniFilename)) + { + // .ini file does not exist in '/plugcfg' directory. + n_listener("%s file does not exist in '$3dsmax/plugcfg' directory.", N_MAXEXPORT_INIFILE); + return 0; + } } nIniPrefServer* iniFile = (nIniPrefServer*)nKernelServer::Instance()->New("niniprefserver", "/iniprefsrv"); Modified: trunk/nebula2/code/contrib/nmax/src/pluginlibs/nmaxdirdlg.cc =================================================================== --- trunk/nebula2/code/contrib/nmax/src/pluginlibs/nmaxdirdlg.cc 2009-03-27 11:28:45 UTC (rev 3293) +++ trunk/nebula2/code/contrib/nmax/src/pluginlibs/nmaxdirdlg.cc 2009-03-27 12:16:27 UTC (rev 3294) @@ -68,14 +68,29 @@ iniFilename += "\\"; iniFilename += N_MAXEXPORT_INIFILE; - // check the .ini file exist in 3dsmax plugin directory. + // check the .ini file exist in 3dsmax plugcfg directory. if (!fileServer->FileExists(iniFilename)) { // the .ini file does not exist, so make new one. - nFile* file = fileServer->NewFileObject(); - file->Open(iniFilename.Get(), "w"); - file->Close(); - file->Release(); + //nFile* file = fileServer->NewFileObject(); + //file->Open(iniFilename.Get(), "w"); + //file->Close(); + //file->Release(); + + //FIXME: put an messago box + // try to find the .ini file in the 'scripts\nebula' dirtectory. e.g.) d:\3dsmax\Scripts\nebula2 + iniFilename = ""; + iniFilename += GetCOREInterface()->GetDir(APP_SCRIPTS_DIR); + iniFilename += "\\"; + iniFilename += "nebula2\\"; + iniFilename += N_MAXEXPORT_INIFILE; + if (!fileServer->FileExists(iniFilename)) + { + n_message("Cannot find %s file in $3dsmax/plugcfg or $3dsmax/scripts/nebula2 directory.", + iniFilename.Get()); + + return; + } } // read values from .ini file and specify those to dialog controls. @@ -253,12 +268,25 @@ } else { + nFileServer2* fileServer = nFileServer2::Instance(); + // write the values to .ini file. nString iniFilename; iniFilename += GetCOREInterface()->GetDir(APP_PLUGCFG_DIR); iniFilename += "\\"; iniFilename += N_MAXEXPORT_INIFILE; + // check the .ini file exist in 3dsmax plugin directory. + if (!fileServer->FileExists(iniFilename)) + { + // try to find the .ini file in the 'scripts\nebula' dirtectory. e.g.) d:\3dsmax\Scripts\nebula2 + iniFilename = ""; + iniFilename += GetCOREInterface()->GetDir(APP_SCRIPTS_DIR); + iniFilename += "\\"; + iniFilename += "nebula2\\"; + iniFilename += N_MAXEXPORT_INIFILE; + } + nIniPrefServer* iniFile = (nIniPrefServer*)nKernelServer::Instance()->New("niniprefserver", "/iniprefsrv"); iniFile->SetFileName(iniFilename); iniFile->SetSection("GeneralSettings"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |