Merge pull request #748 from Areloch/MiscImportAndToolFixes

Misc Tool and Asset Import fixes and improvements
This commit is contained in:
Brian Roberts 2022-03-20 18:49:36 -05:00 committed by GitHub
commit 05a6a249ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 160 additions and 17 deletions

View file

@ -195,7 +195,7 @@
<Setting
name="AutomaticallyPromptMissingFiles">0</Setting>
<Setting
name="DuplicateAutoResolution">FolderPrefix</Setting>
name="DuplicateAutoResolution">AutoPrune</Setting>
<Setting
name="PreventImportWithErrors">1</Setting>
<Setting

View file

@ -108,7 +108,8 @@ function isShapeFormat(%fileExt)
(%fileExt $= ".gltf") ||
(%fileExt $= ".glb") ||
(%fileExt $= ".obj") ||
(%fileExt $= ".blend"))
(%fileExt $= ".blend") ||
(%fileExt $= ".dsq"))
return true;
return false;

View file

@ -148,10 +148,15 @@ function AssetBrowser::importImageAsset(%this, %assetItem)
assetName = %assetName;
versionId = 1;
imageFile = fileName(%filePath);
originalFilePath = %filePath;
imageType = %assetItem.imageType;
};
//No point in indicating the original path data if it was imported in-place
if(!startsWith(makeFullPath(%filePath), getMainDotCsDir()))
{
%newAsset.originalFilePath = %filePath;
}
%assetImportSuccessful = TAMLWrite(%newAsset, %assetPath @ "/" @ %assetName @ ".asset.taml");
//and copy the file into the relevent directory

View file

@ -321,10 +321,16 @@ function AssetBrowser::importMaterialAsset(%this, %assetItem)
versionId = 1;
shaderGraph = %sgfPath;
scriptFile = %assetName @ "." @ $TorqueScriptFileExtension;
originalFilePath = %filePath;
materialDefinitionName = %assetName;
};
//No point in indicating the original path data if it was imported in-place
%mainPath = getMainDotCsDir();
if(!startsWith(makeFullPath(%filePath), getMainDotCsDir()))
{
%newAsset.originalFilePath = %filePath;
}
//check dependencies
%dependencySlotId = 0;
for(%i=0; %i < %assetItem.childAssetItems.count(); %i++)

View file

@ -131,10 +131,15 @@ function AssetBrowser::importShapeAsset(%this, %assetItem)
assetName = %assetName;
versionId = 1;
fileName = fileName(%filePath);
originalFilePath = %filePath;
isNewShape = true;
};
//No point in indicating the original path data if it was imported in-place
if(!startsWith(makeFullPath(%filePath), getMainDotCsDir()))
{
%newAsset.originalFilePath = %filePath;
}
//check dependencies
%dependencySlotId = 0;
for(%i=0; %i < %assetItem.childAssetItems.count(); %i++)