Misc fixes to ensure that the default postFX save, load and editing process is valid

Also fixes it so if a level asset doesn't point to a valid postfx preset file, it'll generate a clean one on save
This commit is contained in:
Areloch 2020-11-01 15:39:30 -06:00
parent 302a64edd1
commit 9ca276fef0
9 changed files with 63 additions and 114 deletions

View file

@ -41,29 +41,33 @@ DefineEngineMethod(AssetBase, getAssetId, String, (), ,
}
DefineEngineMethod(AssetBase, getAssetDependencyFieldCount, S32, (const char* pFieldName), (""),
"Gets the assets' Asset Id. This is only available if the asset was acquired from the asset manager.\n"
"@return The assets' Asset Id.\n")
"Gets the number of asset dependencies of a given field name.\n"
"eg. Would return '2' if you searched for 'myDependencyField'\n"
"and the asset had myDependencyField0 and myDependencyField1\n"
"@param fieldName The name of the field to get a count of\n"
"@return The number of dependency fields matching the search name.\n")
{
return object->getAssetDependencyFieldCount(pFieldName);
}
DefineEngineMethod(AssetBase, clearAssetDependencyFields, void, (const char* pFieldName), (""),
"Gets the assets' Asset Id. This is only available if the asset was acquired from the asset manager.\n"
"@return The assets' Asset Id.\n")
"Clears any asset dependency fields matching the name provided.\n"
"@param fieldName The name of the fields to be cleared")
{
object->clearAssetDependencyFields(pFieldName);
}
DefineEngineMethod(AssetBase, addAssetDependencyField, void, (const char* pFieldName, const char* pAssetId), ("", ""),
"Gets the assets' Asset Id. This is only available if the asset was acquired from the asset manager.\n"
"@return The assets' Asset Id.\n")
"Adds an asset dependency field to the asset definition.\n"
"@param fieldName The name of the field. Will automatically increment the tailing number if the field is used multiple times\n"
"@param assetId The assetId to be marked as a dependency")
{
object->addAssetDependencyField(pFieldName, pAssetId);
}
DefineEngineMethod(AssetBase, saveAsset, bool, (), ,
"Gets the assets' Asset Id. This is only available if the asset was acquired from the asset manager.\n"
"@return The assets' Asset Id.\n")
"Saves the asset definition.\n"
"@return Whether the save was successful.\n")
{
return object->saveAsset();
}