More updating of editor icons to assets

Fixed handling of convex shape editor's active and default materials
Fixed assignment of material for convex shapes via editor
Fixed material editor map assignment logic
Added utility function to detect possible duplicate files in project to ProjectImporter
Added conversion of legacy sky and water classes to importer
Fixed bufferLen issue with guiTreeViewCtrl
This commit is contained in:
Areloch 2021-08-07 19:27:01 -05:00
parent 2f5f585aaf
commit 555c563b39
18 changed files with 147 additions and 30 deletions

View file

@ -468,6 +468,32 @@ function T3Dpre4ProjectImporter::beginCodeFilesImport(%this)
{
%outLine = %this.call("processLevelInfoLine", %line);
if(%line !$= %outLine)
{
%fileWasChanged = true;
%line = %outLine;
}
}
}
else if(%className $= "Sky")
{
if(%this.isMethod("processSkyLine"))
{
%outLine = %this.call("processSkyLine", %line);
if(%line !$= %outLine)
{
%fileWasChanged = true;
%line = %outLine;
}
}
}
else if(%className $= "Water")
{
if(%this.isMethod("processWaterLine"))
{
%outLine = %this.call("processWaterLine", %line);
if(%line !$= %outLine)
{
%fileWasChanged = true;
@ -761,6 +787,26 @@ function T3Dpre4ProjectImporter::processLevelInfoLine(%this, %line)
return %line;
}
function T3Dpre4ProjectImporter::processSkyLine(%this, %line)
{
%outline = strreplace(%line, "Sky", "Skybox");
if(%outLine !$= %line)
return %outLine;
else
return %line;
}
function T3Dpre4ProjectImporter::processWaterLine(%this, %line)
{
%outline = strreplace(%line, "Water", "WaterPlane");
if(%outLine !$= %line)
return %outLine;
else
return %line;
}
//==============================================================================
// GUIs
//==============================================================================

View file

@ -1221,4 +1221,62 @@ function doDeleteAssetDefinitions()
echo("===========================================");
echo("Finished Deleting Asset Definitions");
echo("===========================================");
}
function scanForDuplicateFiles(%toTestFile)
{
echo("===========================================");
echo("Scanning for duplicate files!");
echo("===========================================");
//First, wipe out any files inside the folder first
%file = findFirstFileMultiExpr( "*/*.*", true);
while( %file !$= "" )
{
//We only really care about content files for this
if(!endsWith(%file, "dts") &&
!endsWith(%file, "dae") &&
!endsWith(%file, "fbx") &&
!endsWith(%file, "ter") &&
!endsWith(%file, "png") &&
!endsWith(%file, "jpg") &&
!endsWith(%file, "jpeg") &&
!endsWith(%file, "dds"))
{
%file = findNextFileMultiExpr( "*/*.*" );
continue;
}
%filename = fileName(%file);
%fileExt = fileExt(%file);
%filePath = filePath(%file);
if(%toTestFile $= "")
{
scanForDuplicateFiles(%file);
}
else
{
%testFilename = fileName(%toTestFile);
%testFileExt = fileExt(%toTestFile);
%testFilePath = filePath(%toTestFile);
if(%testFilename $= %filename && %testFileExt $= %fileExt)
{
//name matches, lets double check it'd actually cause a collision via the module it'd be in
%moduleName = AssetBrowser.dirHandler.getModuleFromAddress(%file).ModuleId;
%testModuleName = AssetBrowser.dirHandler.getModuleFromAddress(%testFilename).ModuleId;
if(%moduleName !$= "" && %testModuleName !$= "" && %moduleName $= %testModuleName)
{
//report the probable duplicate
error("Probable duplicate asset detected!");
error("Files: " @ %file @ " and " @ %toTestFile @ " have matching names and exist within the same module!");
}
}
}
%file = findNextFileMultiExpr( "*/*.*" );
}
}