mirror of
https://github.com/jmarshall23/DoomRTX.git
synced 2026-08-16 08:10:32 +02:00
Added modelviewer.
Added neural network code(turned off by default). Lots of editor and rendering fixes.
This commit is contained in:
@@ -42,7 +42,7 @@ static idStr Maya_Error;
|
||||
|
||||
static exporterInterface_t Maya_ConvertModel = NULL;
|
||||
static exporterShutdown_t Maya_Shutdown = NULL;
|
||||
static int importDLL = 0;
|
||||
static INT_PTR importDLL = 0;
|
||||
|
||||
bool idModelExport::initialized = false;
|
||||
|
||||
@@ -83,39 +83,51 @@ idModelExport::CheckMayaInstall
|
||||
Determines if Maya is installed on the user's machine
|
||||
=====================
|
||||
*/
|
||||
bool idModelExport::CheckMayaInstall( void ) {
|
||||
bool idModelExport::CheckMayaInstall(void) {
|
||||
#ifndef _WIN32
|
||||
return false;
|
||||
#elif 0
|
||||
HKEY hKey;
|
||||
long lres, lType;
|
||||
|
||||
lres = RegOpenKey( HKEY_LOCAL_MACHINE, "SOFTWARE\\Alias|Wavefront\\Maya\\4.5\\Setup\\InstallPath", &hKey );
|
||||
|
||||
if ( lres != ERROR_SUCCESS ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
lres = RegQueryValueEx( hKey, "MAYA_INSTALL_LOCATION", NULL, (unsigned long*)&lType, (unsigned char*)NULL, (unsigned long*)NULL );
|
||||
|
||||
RegCloseKey( hKey );
|
||||
|
||||
if ( lres != ERROR_SUCCESS ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
#else
|
||||
HKEY hKey;
|
||||
long lres;
|
||||
struct mayaRegistryKey_t {
|
||||
HKEY root;
|
||||
const char* path;
|
||||
};
|
||||
|
||||
// only check the non-version specific key so that we only have to update the maya dll when new versions are released
|
||||
lres = RegOpenKey( HKEY_LOCAL_MACHINE, "SOFTWARE\\Alias|Wavefront\\Maya", &hKey );
|
||||
RegCloseKey( hKey );
|
||||
static const mayaRegistryKey_t mayaKeys[] = {
|
||||
// Modern Maya installs
|
||||
{ HKEY_LOCAL_MACHINE, "SOFTWARE\\Autodesk\\Maya" },
|
||||
{ HKEY_CURRENT_USER, "SOFTWARE\\Autodesk\\Maya" },
|
||||
|
||||
if ( lres != ERROR_SUCCESS ) {
|
||||
return false;
|
||||
// Older Maya installs
|
||||
{ HKEY_LOCAL_MACHINE, "SOFTWARE\\Alias|Wavefront\\Maya" },
|
||||
{ HKEY_CURRENT_USER, "SOFTWARE\\Alias|Wavefront\\Maya" },
|
||||
};
|
||||
|
||||
static const REGSAM views[] = {
|
||||
KEY_READ | KEY_WOW64_64KEY,
|
||||
KEY_READ | KEY_WOW64_32KEY,
|
||||
KEY_READ
|
||||
};
|
||||
|
||||
for (int i = 0; i < sizeof(mayaKeys) / sizeof(mayaKeys[0]); i++) {
|
||||
for (int j = 0; j < sizeof(views) / sizeof(views[0]); j++) {
|
||||
HKEY hKey = NULL;
|
||||
|
||||
LONG lres = RegOpenKeyExA(
|
||||
mayaKeys[i].root,
|
||||
mayaKeys[i].path,
|
||||
0,
|
||||
views[j],
|
||||
&hKey
|
||||
);
|
||||
|
||||
if (lres == ERROR_SUCCESS) {
|
||||
RegCloseKey(hKey);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -153,7 +165,7 @@ void idModelExport::LoadMayaDll( void ) {
|
||||
}
|
||||
|
||||
// initialize the DLL
|
||||
if ( !dllEntry( MD5_VERSION, common, sys ) ) {
|
||||
if ( !dllEntry( MD5_VERSION, common, sys, fileSystem ) ) {
|
||||
// init failed
|
||||
Maya_ConvertModel = NULL;
|
||||
Maya_Shutdown = NULL;
|
||||
@@ -539,6 +551,7 @@ int idModelExport::ExportModels( const char *pathname, const char *extension ) {
|
||||
|
||||
if ( !CheckMayaInstall() ) {
|
||||
// if Maya isn't installed, don't bother checking if we have anims to export
|
||||
common->Warning("idModelExport::ExportModels: Maya Install not detected!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user