mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 23:24:41 +00:00
Merge branch 'Preview4_0' into SoundAssetImplements
# Conflicts: # Engine/source/T3D/assets/assetImporter.cpp # Engine/source/forest/forestItem.cpp
This commit is contained in:
commit
f5600826d7
122 changed files with 686 additions and 577 deletions
|
|
@ -65,8 +65,6 @@ ConsoleSetType(TypeGUIAssetPtr)
|
|||
if (argc == 1)
|
||||
{
|
||||
// Yes, so fetch field value.
|
||||
const char* pFieldValue = argv[0];
|
||||
|
||||
*((const char**)dptr) = StringTable->insert(argv[0]);
|
||||
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ void ImageAsset::consoleInit()
|
|||
Con::addVariable("$Core::NoImageAssetFallback", TypeString, &smNoImageAssetFallback,
|
||||
"The assetId of the texture to display when the requested image asset is missing.\n"
|
||||
"@ingroup GFX\n");
|
||||
|
||||
|
||||
smNoImageAssetFallback = StringTable->insert(Con::getVariable("$Core::NoImageAssetFallback"));
|
||||
}
|
||||
|
||||
|
|
@ -274,22 +274,8 @@ void ImageAsset::loadImage()
|
|||
|
||||
mLoadedState = Ok;
|
||||
mIsValidImage = true;
|
||||
return;
|
||||
|
||||
//GFXTexHandle texture = getTexture(&GFXStaticTextureSRGBProfile);
|
||||
|
||||
//mTexture.set(mImagePath, &GFXStaticTextureSRGBProfile, avar("%s() - mImage (line %d)", __FUNCTION__, __LINE__));
|
||||
|
||||
/*if (texture.isValid())
|
||||
{
|
||||
mIsValidImage = true;
|
||||
|
||||
//mBitmap = texture.getBitmap();
|
||||
|
||||
return;
|
||||
}*/
|
||||
|
||||
mChangeSignal.trigger();
|
||||
return;
|
||||
}
|
||||
mLoadedState = BadFileReference;
|
||||
|
||||
|
|
@ -497,8 +483,6 @@ GuiControl* GuiInspectorTypeImageAssetPtr::constructEditControl()
|
|||
mInspector->getInspectObject()->getIdString(), mCaption);
|
||||
mBrowseButton->setField("Command", szBuffer);
|
||||
|
||||
const char* id = mInspector->getInspectObject()->getIdString();
|
||||
|
||||
setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString());
|
||||
|
||||
// Create "Open in ShapeEditor" button
|
||||
|
|
@ -569,7 +553,7 @@ bool GuiInspectorTypeImageAssetPtr::renderTooltip(const Point2I& hoverPos, const
|
|||
if (texture.isNull())
|
||||
return false;
|
||||
|
||||
// Render image at a reasonable screen size while
|
||||
// Render image at a reasonable screen size while
|
||||
// keeping its aspect ratio...
|
||||
Point2I screensize = getRoot()->getWindowSize();
|
||||
Point2I offset = hoverPos;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
#pragma once
|
||||
|
||||
#ifndef MATERIALASSET_H
|
||||
#include "MaterialAsset.h"
|
||||
|
|
@ -168,13 +167,29 @@ void MaterialAsset::initializeAsset()
|
|||
|
||||
mScriptPath = getOwned() ? expandAssetFilePath(mScriptFile) : mScriptPath;
|
||||
|
||||
if (mMatDefinitionName == StringTable->EmptyString())
|
||||
{
|
||||
mLoadedState = Failed;
|
||||
return;
|
||||
}
|
||||
|
||||
if (Torque::FS::IsScriptFile(mScriptPath))
|
||||
{
|
||||
if (!Sim::findObject(mMatDefinitionName))
|
||||
if (Con::executeFile(mScriptPath, false, false))
|
||||
mLoadedState = ScriptLoaded;
|
||||
else
|
||||
mLoadedState = Failed;
|
||||
{
|
||||
if (Con::executeFile(mScriptPath, false, false))
|
||||
{
|
||||
mLoadedState = ScriptLoaded;
|
||||
}
|
||||
else
|
||||
{
|
||||
mLoadedState = Failed;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mLoadedState = DefinitionAlreadyExists;
|
||||
}
|
||||
}
|
||||
|
||||
loadMaterial();
|
||||
|
|
@ -184,6 +199,12 @@ void MaterialAsset::onAssetRefresh()
|
|||
{
|
||||
mScriptPath = getOwned() ? expandAssetFilePath(mScriptFile) : mScriptPath;
|
||||
|
||||
if (mMatDefinitionName == StringTable->EmptyString())
|
||||
{
|
||||
mLoadedState = Failed;
|
||||
return;
|
||||
}
|
||||
|
||||
if (Torque::FS::IsScriptFile(mScriptPath))
|
||||
{
|
||||
//Since we're refreshing, we can assume that the file we're executing WILL have an existing definition.
|
||||
|
|
@ -199,7 +220,6 @@ void MaterialAsset::onAssetRefresh()
|
|||
|
||||
//And now that we've executed, switch back to the prior behavior
|
||||
Con::setVariable("$Con::redefineBehavior", redefineBehaviorPrev.c_str());
|
||||
|
||||
}
|
||||
|
||||
loadMaterial();
|
||||
|
|
@ -227,7 +247,7 @@ void MaterialAsset::loadMaterial()
|
|||
if (mMaterialDefinition)
|
||||
SAFE_DELETE(mMaterialDefinition);
|
||||
|
||||
if (mLoadedState == ScriptLoaded && mMatDefinitionName != StringTable->EmptyString())
|
||||
if ((mLoadedState == ScriptLoaded || mLoadedState == DefinitionAlreadyExists) && mMatDefinitionName != StringTable->EmptyString())
|
||||
{
|
||||
Material* matDef;
|
||||
if (!Sim::findObject(mMatDefinitionName, matDef))
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ public:
|
|||
enum MaterialAssetErrCode
|
||||
{
|
||||
ScriptLoaded = AssetErrCode::Extended,
|
||||
DefinitionAlreadyExists,
|
||||
Extended
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -190,17 +190,12 @@ bool ScriptAsset::execScript()
|
|||
if (handle)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
if (Torque::FS::IsScriptFile(mScriptPath))
|
||||
{
|
||||
return Con::executeFile(mScriptPath, false, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
Con::errorf("ScriptAsset:execScript() - Script asset must have a valid file to exec");
|
||||
return false;
|
||||
}
|
||||
Con::errorf("ScriptAsset:execScript() - Script asset must have a valid file to exec");
|
||||
return false;
|
||||
}
|
||||
|
||||
DefineEngineMethod(ScriptAsset, execScript, bool, (), ,
|
||||
|
|
|
|||
|
|
@ -603,8 +603,6 @@ GuiControl* GuiInspectorTypeShapeAssetPtr::constructEditControl()
|
|||
mInspector->getInspectObject()->getIdString(), mCaption);
|
||||
mBrowseButton->setField("Command", szBuffer);
|
||||
|
||||
const char* id = mInspector->getInspectObject()->getIdString();
|
||||
|
||||
setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString());
|
||||
|
||||
// Create "Open in ShapeEditor" button
|
||||
|
|
|
|||
|
|
@ -468,8 +468,6 @@ GuiControl* GuiInspectorTypeTerrainAssetPtr::constructEditControl()
|
|||
mInspector->getInspectObject()->getIdString(), mCaption);
|
||||
mBrowseButton->setField("Command", szBuffer);
|
||||
|
||||
const char* id = mInspector->getInspectObject()->getIdString();
|
||||
|
||||
setDataField(StringTable->insert("targetObject"), NULL, mInspector->getInspectObject()->getIdString());
|
||||
|
||||
// Create "Open in ShapeEditor" button
|
||||
|
|
|
|||
|
|
@ -1821,10 +1821,8 @@ void AssetImporter::processShapeAsset(AssetImportObject* assetItem)
|
|||
}
|
||||
|
||||
S32 meshCount = dAtoi(assetItem->shapeInfo->getDataField(StringTable->insert("_meshCount"), nullptr));
|
||||
S32 shapeItem = assetItem->shapeInfo->findItemByName("Meshes");
|
||||
|
||||
S32 animCount = dAtoi(assetItem->shapeInfo->getDataField(StringTable->insert("_animCount"), nullptr));
|
||||
S32 animItem = assetItem->shapeInfo->findItemByName("Animations");
|
||||
|
||||
S32 materialCount = dAtoi(assetItem->shapeInfo->getDataField(StringTable->insert("_materialCount"), nullptr));
|
||||
S32 matItem = assetItem->shapeInfo->findItemByName("Materials");
|
||||
|
|
@ -2005,9 +2003,7 @@ void AssetImporter::validateAsset(AssetImportObject* assetItem)
|
|||
if (assetItem->importStatus == AssetImportObject::Skipped || assetItem->importStatus == AssetImportObject::NotProcessed)
|
||||
return;
|
||||
|
||||
bool hasCollision = checkAssetForCollision(assetItem);
|
||||
|
||||
if (hasCollision)
|
||||
if (checkAssetForCollision(assetItem))
|
||||
{
|
||||
importIssues = true;
|
||||
return;
|
||||
|
|
@ -2018,7 +2014,6 @@ void AssetImporter::validateAsset(AssetImportObject* assetItem)
|
|||
AssetQuery aQuery;
|
||||
U32 numAssetsFound = AssetDatabase.findAllAssets(&aQuery);
|
||||
|
||||
hasCollision = false;
|
||||
for (U32 i = 0; i < numAssetsFound; i++)
|
||||
{
|
||||
StringTableEntry assetId = aQuery.mAssetList[i];
|
||||
|
|
@ -2032,7 +2027,6 @@ void AssetImporter::validateAsset(AssetImportObject* assetItem)
|
|||
|
||||
if (assetName == StringTable->insert(assetItem->assetName.c_str()))
|
||||
{
|
||||
hasCollision = true;
|
||||
assetItem->status = "Error";
|
||||
assetItem->statusType = "DuplicateAsset";
|
||||
assetItem->statusInfo = "Duplicate asset names found within the target module!\nAsset \"" + assetItem->assetName + "\" of type \"" + assetItem->assetType + "\" has a matching name.\nPlease rename it and try again!";
|
||||
|
|
@ -2241,7 +2235,6 @@ void AssetImporter::resetImportConfig()
|
|||
activeImportConfig->registerObject();
|
||||
}
|
||||
|
||||
bool foundConfig = false;
|
||||
Settings* editorSettings;
|
||||
//See if we can get our editor settings
|
||||
if (Sim::findObject("EditorSettings", editorSettings))
|
||||
|
|
|
|||
|
|
@ -931,15 +931,6 @@ public:
|
|||
return imagePath;
|
||||
}
|
||||
|
||||
static inline const char* makeFullPath(const String& path)
|
||||
{
|
||||
char qualifiedFilePath[2048];
|
||||
|
||||
Platform::makeFullPathName(path.c_str(), qualifiedFilePath, sizeof(qualifiedFilePath));
|
||||
|
||||
return qualifiedFilePath;
|
||||
}
|
||||
|
||||
//
|
||||
void setTargetModuleId(const String& moduleId) { targetModuleId = moduleId; }
|
||||
const String& getTargetModuleId() { return targetModuleId; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue