mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
Merge pull request #748 from Areloch/MiscImportAndToolFixes
Misc Tool and Asset Import fixes and improvements
This commit is contained in:
commit
05a6a249ea
10 changed files with 160 additions and 17 deletions
|
|
@ -195,7 +195,7 @@
|
|||
<Setting
|
||||
name="AutomaticallyPromptMissingFiles">0</Setting>
|
||||
<Setting
|
||||
name="DuplicateAutoResolution">FolderPrefix</Setting>
|
||||
name="DuplicateAutoResolution">AutoPrune</Setting>
|
||||
<Setting
|
||||
name="PreventImportWithErrors">1</Setting>
|
||||
<Setting
|
||||
|
|
|
|||
|
|
@ -108,7 +108,8 @@ function isShapeFormat(%fileExt)
|
|||
(%fileExt $= ".gltf") ||
|
||||
(%fileExt $= ".glb") ||
|
||||
(%fileExt $= ".obj") ||
|
||||
(%fileExt $= ".blend"))
|
||||
(%fileExt $= ".blend") ||
|
||||
(%fileExt $= ".dsq"))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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++)
|
||||
|
|
|
|||
|
|
@ -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++)
|
||||
|
|
|
|||
|
|
@ -290,6 +290,15 @@ function SubMaterialSelector::onSelect( %this )
|
|||
if( MaterialEditorGui.currentObject.isMethod("postApply") )
|
||||
MaterialEditorGui.currentObject.postApply();*/
|
||||
}
|
||||
else
|
||||
{
|
||||
%materialAssetId = MaterialAsset::getAssetIdByMaterialName(%material);
|
||||
if(%materialAssetId !$= "" && %materialAssetId !$= $Core::NoMaterialAssetFallback)
|
||||
{
|
||||
MaterialEditorGui.currentMaterialAsset = %materialAssetId;
|
||||
%assetDef = AssetDatabase.acquireAsset(%material);
|
||||
}
|
||||
}
|
||||
|
||||
MaterialEditorGui.prepareActiveMaterial( %material.getId() );
|
||||
}
|
||||
|
|
@ -1950,6 +1959,7 @@ function MaterialEditorGui::save( %this )
|
|||
|
||||
if(MaterialEditorGui.currentMaterialAsset !$= "")
|
||||
{
|
||||
echo("Attempting to save material: " @ MaterialEditorGui.currentMaterialAsset);
|
||||
MaterialEditorGui.copyMaterials( materialEd_previewMaterial, notDirtyMaterial );
|
||||
|
||||
%assetDef = AssetDatabase.acquireAsset(MaterialEditorGui.currentMaterialAsset);
|
||||
|
|
|
|||
|
|
@ -1029,6 +1029,8 @@ function testFilenameExtensions(%filename)
|
|||
return %filename @ ".dae";
|
||||
else if(isFile(%filename @ ".dds"))
|
||||
return %filename @ ".dds";
|
||||
else if(isFile(%filename @ ".dsq"))
|
||||
return %filename @ ".dsq";
|
||||
else if(isFile(%filename @ ".ogg"))
|
||||
return %filename @ ".ogg";
|
||||
else if(isFile(%filename @ ".wav"))
|
||||
|
|
@ -2155,6 +2157,7 @@ function scanForDuplicateFiles(%toTestFile)
|
|||
//We only really care about content files for this
|
||||
if(!endsWith(%file, "dts") &&
|
||||
!endsWith(%file, "dae") &&
|
||||
!endsWith(%file, "dsq") &&
|
||||
!endsWith(%file, "fbx") &&
|
||||
!endsWith(%file, "ter") &&
|
||||
!endsWith(%file, "png") &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue