mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Updates the rest of the asset types to utilize separate expanded path variables to avoid breaking assetDef saving
Fixes select mode for the Asset Browser to properly filter to the selecting type Fixes the imageType in the asset import window inspector to properly set to the importing image asset's discovered type if valid Fixes AssetBrowser asset selection return so it returns back a valid assetId Fixes TerrainMaterial save crash by ensuring we fill in the diffuseMapAsset Removes saving of TerrainMaterial being saved to a generic script file if one isn't found for an existing TerrainMaterialAssets
This commit is contained in:
parent
08f8d8abf2
commit
79ecc2f4a0
30 changed files with 241 additions and 106 deletions
|
|
@ -92,6 +92,7 @@ ConsoleSetType(TypeScriptAssetPtr)
|
|||
ScriptAsset::ScriptAsset() : AssetBase(), mIsServerSide(true)
|
||||
{
|
||||
mScriptFile = StringTable->EmptyString();
|
||||
mScriptPath = StringTable->EmptyString();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -121,9 +122,9 @@ void ScriptAsset::copyTo(SimObject* object)
|
|||
|
||||
void ScriptAsset::initializeAsset()
|
||||
{
|
||||
mScriptFile = expandAssetFilePath(mScriptFile);
|
||||
mScriptPath = expandAssetFilePath(mScriptFile);
|
||||
|
||||
if (Platform::isFile(mScriptFile))
|
||||
if (Platform::isFile(mScriptPath))
|
||||
{
|
||||
//We're initialized properly, so we'll go ahead and kick along any dependencies we may have as well
|
||||
AssetManager::typeAssetDependsOnHash::Iterator assetDependenciesItr = mpOwningAssetManager->getDependedOnAssets()->find(mpAssetDefinition->mAssetId);
|
||||
|
|
@ -143,15 +144,15 @@ void ScriptAsset::initializeAsset()
|
|||
}
|
||||
}
|
||||
|
||||
Con::executeFile(mScriptFile, false, false);
|
||||
Con::executeFile(mScriptPath, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptAsset::onAssetRefresh()
|
||||
{
|
||||
mScriptFile = expandAssetFilePath(mScriptFile);
|
||||
mScriptPath = expandAssetFilePath(mScriptFile);
|
||||
|
||||
if (Platform::isFile(mScriptFile))
|
||||
if (Platform::isFile(mScriptPath))
|
||||
{
|
||||
//Refresh any dependencies we may have
|
||||
for (U32 i = 0; i < mScriptAssets.size(); i++)
|
||||
|
|
@ -159,7 +160,7 @@ void ScriptAsset::onAssetRefresh()
|
|||
mScriptAssets[i]->onAssetRefresh();
|
||||
}
|
||||
|
||||
Con::executeFile(mScriptFile, false, false);
|
||||
Con::executeFile(mScriptPath, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -176,7 +177,7 @@ void ScriptAsset::setScriptFile(const char* pScriptFile)
|
|||
return;
|
||||
|
||||
// Update.
|
||||
mScriptFile = getOwned() ? expandAssetFilePath(pScriptFile) : StringTable->insert(pScriptFile);
|
||||
mScriptFile = StringTable->insert(pScriptFile);
|
||||
|
||||
// Refresh the asset.
|
||||
refreshAsset();
|
||||
|
|
@ -191,9 +192,9 @@ bool ScriptAsset::execScript()
|
|||
|
||||
return false;
|
||||
|
||||
if (Platform::isFile(mScriptFile))
|
||||
if (Platform::isFile(mScriptPath))
|
||||
{
|
||||
return Con::executeFile(mScriptFile, false, false);
|
||||
return Con::executeFile(mScriptPath, false, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue