mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 00:54:54 +00:00
Merge pull request #731 from Areloch/importerObjectProcessingFix
Fixes some mishandled cases when preprocessing objects and functions for project import
This commit is contained in:
commit
da5cb56c83
2 changed files with 40 additions and 4 deletions
|
|
@ -1038,6 +1038,12 @@ function T3Dpre4ProjectImporter::processMaterialObject(%this, %fileObject, %obje
|
||||||
|
|
||||||
%assetScriptPath = %assetDef.getScriptPath();
|
%assetScriptPath = %assetDef.getScriptPath();
|
||||||
|
|
||||||
|
if(fileExt(%assetScriptPath) $= "")
|
||||||
|
{
|
||||||
|
//try the default extension
|
||||||
|
%assetScriptPath = %assetScriptPath @ "." @ $TorqueScriptFileExtension;
|
||||||
|
}
|
||||||
|
|
||||||
if(isFile(%assetScriptPath) && isObject(%objectName))
|
if(isFile(%assetScriptPath) && isObject(%objectName))
|
||||||
{
|
{
|
||||||
//Regular material in a companion file, so we'll want to write it to the
|
//Regular material in a companion file, so we'll want to write it to the
|
||||||
|
|
|
||||||
|
|
@ -486,6 +486,14 @@ function preprocessImportingFiles()
|
||||||
%className = getSubStr(%line, %start + 4, %end-%start-4);
|
%className = getSubStr(%line, %start + 4, %end-%start-4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
%nameEnd = strpos(%line, ")", %end);
|
||||||
|
|
||||||
%objectName = getSubStr(%line, %end+1, %nameEnd-%end-1);
|
%objectName = getSubStr(%line, %end+1, %nameEnd-%end-1);
|
||||||
|
|
@ -498,6 +506,8 @@ function preprocessImportingFiles()
|
||||||
%objectName = getSubStr(%objectName, 0, %inheritanceSplit);
|
%objectName = getSubStr(%objectName, 0, %inheritanceSplit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%objectName = trim(%objectName);
|
||||||
|
|
||||||
%parentFileSectionObject = %currentFileSectionObject;
|
%parentFileSectionObject = %currentFileSectionObject;
|
||||||
|
|
||||||
%currentFileSectionObject = new ArrayObject();
|
%currentFileSectionObject = new ArrayObject();
|
||||||
|
|
@ -540,6 +550,14 @@ function preprocessImportingFiles()
|
||||||
%className = getSubStr(%line, %start + 10, %end-%start-10);
|
%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);
|
%nameEnd = strpos(%line, ")", %end);
|
||||||
|
|
||||||
%objectName = getSubStr(%line, %end+1, %nameEnd-%end-1);
|
%objectName = getSubStr(%line, %end+1, %nameEnd-%end-1);
|
||||||
|
|
@ -552,6 +570,8 @@ function preprocessImportingFiles()
|
||||||
%objectName = getSubStr(%objectName, 0, %inheritanceSplit);
|
%objectName = getSubStr(%objectName, 0, %inheritanceSplit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%objectName = trim(%objectName);
|
||||||
|
|
||||||
%parentFileSectionObject = %currentFileSectionObject;
|
%parentFileSectionObject = %currentFileSectionObject;
|
||||||
|
|
||||||
%currentFileSectionObject = new ArrayObject();
|
%currentFileSectionObject = new ArrayObject();
|
||||||
|
|
@ -594,6 +614,14 @@ function preprocessImportingFiles()
|
||||||
%className = getSubStr(%line, %start + 10, %end-%start-10);
|
%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);
|
%nameEnd = strpos(%line, ")", %end);
|
||||||
|
|
||||||
%objectName = getSubStr(%line, %end+1, %nameEnd-%end-1);
|
%objectName = getSubStr(%line, %end+1, %nameEnd-%end-1);
|
||||||
|
|
@ -606,6 +634,8 @@ function preprocessImportingFiles()
|
||||||
%objectName = getSubStr(%objectName, 0, %inheritanceSplit);
|
%objectName = getSubStr(%objectName, 0, %inheritanceSplit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%objectName = trim(%objectName);
|
||||||
|
|
||||||
%parentFileSectionObject = %currentFileSectionObject;
|
%parentFileSectionObject = %currentFileSectionObject;
|
||||||
|
|
||||||
%currentFileSectionObject = new ArrayObject();
|
%currentFileSectionObject = new ArrayObject();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue