diff --git a/Templates/BaseGame/game/tools/projectImporter/importers/pre40/T3Dpre4ProjectImporter.tscript b/Templates/BaseGame/game/tools/projectImporter/importers/pre40/T3Dpre4ProjectImporter.tscript index c6ac5c2b2..abbe166e0 100644 --- a/Templates/BaseGame/game/tools/projectImporter/importers/pre40/T3Dpre4ProjectImporter.tscript +++ b/Templates/BaseGame/game/tools/projectImporter/importers/pre40/T3Dpre4ProjectImporter.tscript @@ -1038,6 +1038,12 @@ function T3Dpre4ProjectImporter::processMaterialObject(%this, %fileObject, %obje %assetScriptPath = %assetDef.getScriptPath(); + if(fileExt(%assetScriptPath) $= "") + { + //try the default extension + %assetScriptPath = %assetScriptPath @ "." @ $TorqueScriptFileExtension; + } + if(isFile(%assetScriptPath) && isObject(%objectName)) { //Regular material in a companion file, so we'll want to write it to the diff --git a/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript b/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript index f7b86be34..13797d2a2 100644 --- a/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript +++ b/Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript @@ -488,7 +488,7 @@ function preprocessImportingFiles() if(%className $= "") { - //we clearly have some unusual formatting, potentially a progromattic + //we clearly have some unusual formatting, potentially a programmatic //object block creation going on here. so we'll just skip it and move on %currentFileSectionObject.add(%line); continue; @@ -506,6 +506,8 @@ function preprocessImportingFiles() %objectName = getSubStr(%objectName, 0, %inheritanceSplit); } + %objectName = trim(%objectName); + %parentFileSectionObject = %currentFileSectionObject; %currentFileSectionObject = new ArrayObject(); @@ -548,6 +550,14 @@ function preprocessImportingFiles() %className = getSubStr(%line, %start + 10, %end-%start-10); } + if(%className $= "") + { + //we clearly have some unusual formatting, potentially a programmatic + //object block creation going on here. so we'll just skip it and move on + %currentFileSectionObject.add(%line); + continue; + } + %nameEnd = strpos(%line, ")", %end); %objectName = getSubStr(%line, %end+1, %nameEnd-%end-1); @@ -560,6 +570,8 @@ function preprocessImportingFiles() %objectName = getSubStr(%objectName, 0, %inheritanceSplit); } + %objectName = trim(%objectName); + %parentFileSectionObject = %currentFileSectionObject; %currentFileSectionObject = new ArrayObject(); @@ -602,6 +614,14 @@ function preprocessImportingFiles() %className = getSubStr(%line, %start + 10, %end-%start-10); } + if(%className $= "") + { + //we clearly have some unusual formatting, potentially a programmatic + //object block creation going on here. so we'll just skip it and move on + %currentFileSectionObject.add(%line); + continue; + } + %nameEnd = strpos(%line, ")", %end); %objectName = getSubStr(%line, %end+1, %nameEnd-%end-1); @@ -614,6 +634,8 @@ function preprocessImportingFiles() %objectName = getSubStr(%objectName, 0, %inheritanceSplit); } + %objectName = trim(%objectName); + %parentFileSectionObject = %currentFileSectionObject; %currentFileSectionObject = new ArrayObject();