Added getShapeConstructorFilePath console function on shapeAsset

Fixed typo in import config settings for DuplicateAutoResolution
Converted TSShapeConstructor to utilize assets
Updated shape editor to work with assetified constructors
Converted guiBitmapButtonCtrl to use assets
This commit is contained in:
Areloch 2021-08-02 04:20:27 -05:00
parent 52c83d19e1
commit 88ae8a9665
181 changed files with 2343 additions and 1577 deletions

View file

@ -536,12 +536,19 @@ DefineEngineMethod(ShapeAsset, getAnimation, ShapeAnimationAsset*, (S32 index),
}
DefineEngineMethod(ShapeAsset, getShapeFile, const char*, (), ,
"Creates a new script asset using the targetFilePath.\n"
"@return The bool result of calling exec")
"Gets the shape's file path\n"
"@return The filename of the shape file")
{
return object->getShapeFilePath();
}
DefineEngineMethod(ShapeAsset, getShapeConstructorFilePath, const char*, (), ,
"Gets the shape's constructor file.\n"
"@return The filename of the shape constructor file")
{
return object->getShapeConstructorFilePath();
}
DefineEngineMethod(ShapeAsset, getStatusString, String, (), , "get status string")\
{
return ShapeAsset::getAssetErrstrn(object->getStatus());

View file

@ -32,7 +32,7 @@ ConsoleDocClass(AssetImportConfig,
IMPLEMENT_CONOBJECT(AssetImportConfig);
AssetImportConfig::AssetImportConfig() :
DuplicatAutoResolution("AutoRename"),
DuplicateAutoResolution("AutoRename"),
WarningsAsErrors(false),
PreventImportWithErrors(true),
AutomaticallyPromptMissingFiles(false),
@ -132,7 +132,7 @@ void AssetImportConfig::initPersistFields()
Parent::initPersistFields();
addGroup("General");
addField("DuplicatAutoResolution", TypeRealString, Offset(DuplicatAutoResolution, AssetImportConfig), "Duplicate Asset Auto-Resolution Action. Options are None, AutoPrune, AutoRename, FolderPrefix");
addField("DuplicateAutoResolution", TypeRealString, Offset(DuplicateAutoResolution, AssetImportConfig), "Duplicate Asset Auto-Resolution Action. Options are None, AutoPrune, AutoRename, FolderPrefix");
addField("WarningsAsErrors", TypeBool, Offset(WarningsAsErrors, AssetImportConfig), "Indicates if warnings should be treated as errors");
addField("PreventImportWithErrors", TypeBool, Offset(PreventImportWithErrors, AssetImportConfig), "Indicates if importing should be prevented from completing if any errors are detected at all");
addField("AutomaticallyPromptMissingFiles", TypeBool, Offset(AutomaticallyPromptMissingFiles, AssetImportConfig), "Should the importer automatically prompt to find missing files if they are not detected automatically by the importer");
@ -230,7 +230,7 @@ void AssetImportConfig::initPersistFields()
void AssetImportConfig::loadImportConfig(Settings* configSettings, String configName)
{
//General
DuplicatAutoResolution = configSettings->value(String(configName + "/General/DuplicatAutoResolution").c_str());
DuplicateAutoResolution = configSettings->value(String(configName + "/General/DuplicateAutoResolution").c_str());
WarningsAsErrors = dAtob(configSettings->value(String(configName + "/General/WarningsAsErrors").c_str()));
PreventImportWithErrors = dAtob(configSettings->value(String(configName + "/General/PreventImportWithErrors").c_str()));
AutomaticallyPromptMissingFiles = dAtob(configSettings->value(String(configName + "/General/AutomaticallyPromptMissingFiles").c_str()));
@ -320,7 +320,7 @@ void AssetImportConfig::loadImportConfig(Settings* configSettings, String config
void AssetImportConfig::CopyTo(AssetImportConfig* target) const
{
target->DuplicatAutoResolution = DuplicatAutoResolution;
target->DuplicateAutoResolution = DuplicateAutoResolution;
target->WarningsAsErrors = WarningsAsErrors;
target->PreventImportWithErrors = PreventImportWithErrors;
target->AutomaticallyPromptMissingFiles = AutomaticallyPromptMissingFiles;
@ -2345,7 +2345,7 @@ void AssetImporter::resolveAssetItemIssues(AssetImportObject* assetItem)
String humanReadableReason = assetItem->statusType == String("DuplicateImportAsset") ? "Importing asset was duplicate of another importing asset" : "Importing asset was duplicate of an existing asset";
//get the config value for duplicateAutoResolution
if (activeImportConfig->DuplicatAutoResolution == String("AutoPrune"))
if (activeImportConfig->DuplicateAutoResolution == String("AutoPrune"))
{
//delete the item
deleteImportingAsset(assetItem);
@ -2356,7 +2356,7 @@ void AssetImporter::resolveAssetItemIssues(AssetImportObject* assetItem)
importIssues = false;
}
else if (activeImportConfig->DuplicatAutoResolution == String("AutoRename"))
else if (activeImportConfig->DuplicateAutoResolution == String("AutoRename"))
{
//Set trailing number
String renamedAssetName = assetItem->assetName;
@ -2375,11 +2375,11 @@ void AssetImporter::resolveAssetItemIssues(AssetImportObject* assetItem)
resetAssetValidationStatus(assetItem);
importIssues = false;
}
else if (activeImportConfig->DuplicatAutoResolution == String("UseExisting"))
else if (activeImportConfig->DuplicateAutoResolution == String("UseExisting"))
{
}
else if (activeImportConfig->DuplicatAutoResolution == String("FolderPrefix"))
else if (activeImportConfig->DuplicateAutoResolution == String("FolderPrefix"))
{
//Set trailing number
String renamedAssetName = assetItem->assetName;
@ -3150,7 +3150,7 @@ Torque::Path AssetImporter::importShapeAsset(AssetImportObject* assetItem)
activityLog.push_back(importLogBuffer);
//find/create shape constructor
TSShapeConstructor* constructor = TSShapeConstructor::findShapeConstructor(Torque::Path(qualifiedToFile).getFullPath());
TSShapeConstructor* constructor = TSShapeConstructor::findShapeConstructorByFilename(Torque::Path(qualifiedToFile).getFullPath());
if (constructor == nullptr)
{
constructor = new TSShapeConstructor(StringTable->insert(qualifiedToFile));

View file

@ -22,7 +22,7 @@ public:
/// <summary>
/// Duplicate Asset Auto-Resolution Action. Options are None, AutoPrune, AutoRename
/// </summary>
String DuplicatAutoResolution;
String DuplicateAutoResolution;
/// <summary>
/// Indicates if warnings should be treated as errors.

View file

@ -111,6 +111,7 @@ ReflectionProbe::ReflectionProbe()
mUseHDRCaptures = true;
mCubemapName = StringTable->EmptyString();
mStaticCubemap = NULL;
mProbeUniqueID = "";
@ -259,7 +260,7 @@ bool ReflectionProbe::_setReflectionMode(void *object, const char *index, const
{
//Clear our cubemap if we changed it to be baked, just for cleanliness
probe->mReflectionModeType = BakedCubemap;
probe->mCubemapName = "";
probe->mCubemapName = StringTable->EmptyString();
}
probe->setMaskBits(StaticDataMask);