Implementation of updated handling of Legacy Project importer to better seperate out importer versions as well as more explicit processing of incoming content

This commit is contained in:
JeffR 2022-01-20 01:14:43 -06:00
parent 3812ce2e82
commit ecd35df7e9
14 changed files with 3107 additions and 2663 deletions

View file

@ -102,7 +102,7 @@ void GUIAsset::initPersistFields()
&setScriptFile, &getScriptFile, "Path to the script file for the gui");
addProtectedField("GUIFile", TypeAssetLooseFilePath, Offset(mGUIFile, GUIAsset),
&setScriptFile, &getScriptFile, "Path to the gui file");
&setGUIFile, &getGUIFile, "Path to the gui file");
}
//------------------------------------------------------------------------------

View file

@ -623,8 +623,8 @@ const char* ShapeAsset::generateCachedPreviewImage(S32 resolution, String overri
String dumpPath = String(mFilePath) + "_Preview.dds";
char* returnBuffer = Con::getReturnBuffer(dumpPath.length());
dSprintf(returnBuffer, dumpPath.length(), "%s", dumpPath.c_str());
char* returnBuffer = Con::getReturnBuffer(128);
dSprintf(returnBuffer, 128, "%s", dumpPath.c_str());
/*FileStream stream;
if (stream.open(dumpPath, Torque::FS::File::Write))

View file

@ -2099,22 +2099,28 @@ void AssetImporter::processShapeMaterialInfo(AssetImportObject* assetItem, S32 m
String imgFileName = AssetImporter::findImagePath(testFilePath.getPath() + "/" + testFilePath.getFileName());
if (imgFileName.isNotEmpty())
filePath = imgFileName;
else
filePath = ""; //no luck, so we just won't try importing in the image
}
}
matAssetItem = addImportingAsset("MaterialAsset", shapePathBase + "/" + matName, assetItem, matName);
AssetImportObject* imageAssetItem = addImportingAsset("ImageAsset", filePath, matAssetItem, "");
String suffixType;
String suffix = parseImageSuffixes(imageAssetItem->assetName, &suffixType);
if (suffix.isNotEmpty())
if (!filePath.isEmpty())
{
imageAssetItem->imageSuffixType = suffixType;
}
else
{
//we'll assume it's albedo
imageAssetItem->imageSuffixType = "Albedo";
AssetImportObject* imageAssetItem = addImportingAsset("ImageAsset", filePath, matAssetItem, "");
String suffixType;
String suffix = parseImageSuffixes(imageAssetItem->assetName, &suffixType);
if (suffix.isNotEmpty())
{
imageAssetItem->imageSuffixType = suffixType;
}
else
{
//we'll assume it's albedo
imageAssetItem->imageSuffixType = "Albedo";
}
}
}
else