mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-22 21:05:39 +00:00
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path
Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector Adjusted expand behavior of guiTree to be more reliable Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields Removed redundant PreMult translucency type code Added setting of feature so probes work when in forward/basic lit mode Corrected indexing error in SQLiteObject class so it properly parses with the updated console API Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy Fixed var when trying to bind the camera to the client Added project setting field to dictate the default render mode between Forward or Deferred Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field Integrated DOF PostFX into updated PostFX Editor paradigm Updated setting group name for vignette postFX Shifted shaderCache to be in data/cache along with other cached files Added helper function to replace strings in a file Fixed ExampleCppObject asset to have correct loose file references Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default Fixed verve reference to root scene group Adjusted location of a nonmodal gui profile so it loads at the correct time Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful Initial work into zip and folder drag-and-drop asset importing support Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions Updated example asset type file Ensured all asset types have proper handling for move, rename and delete actions Fixed double-click behavior on folders in the AB Fixed CPP asset preview Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser Added ability to convert a non-module top-level folder in the AB into a module Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake Fixed convex editor's material handling to work with AB and reference back properly Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open Added some additional common text gui profiles Disabled calls to old editor settings logic in various editors to remove spam Added callOnModules call so tools can initialize properly when the world editor is opened Fixed logic test for visualizers Added ability for cmake to scan tools directory for any tools that add source files
This commit is contained in:
parent
9735b1180d
commit
f7b891442a
92 changed files with 1735 additions and 536 deletions
|
|
@ -137,7 +137,7 @@ void CppAsset::setCppFile(const char* pCppFile)
|
|||
return;
|
||||
|
||||
// Update.
|
||||
mCodeFile = getOwned() ? expandAssetFilePath(pCppFile) : StringTable->insert(pCppFile);
|
||||
mCodeFile = /*getOwned() ? expandAssetFilePath(pCppFile) : */StringTable->insert(pCppFile);
|
||||
|
||||
// Refresh the asset.
|
||||
refreshAsset();
|
||||
|
|
@ -156,8 +156,15 @@ void CppAsset::setHeaderFile(const char* pHeaderFile)
|
|||
return;
|
||||
|
||||
// Update.
|
||||
mHeaderFile = getOwned() ? expandAssetFilePath(pHeaderFile) : StringTable->insert(pHeaderFile);
|
||||
mHeaderFile = /*getOwned() ? expandAssetFilePath(pHeaderFile) :*/ StringTable->insert(pHeaderFile);
|
||||
|
||||
// Refresh the asset.
|
||||
refreshAsset();
|
||||
}
|
||||
|
||||
void CppAsset::initializeAsset()
|
||||
{
|
||||
mCodeFile = expandAssetFilePath(mCodeFile);
|
||||
|
||||
mHeaderFile = expandAssetFilePath(mHeaderFile);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public:
|
|||
inline StringTableEntry getHeaderFile(void) const { return mHeaderFile; };
|
||||
|
||||
protected:
|
||||
virtual void initializeAsset(void) {};
|
||||
virtual void initializeAsset(void);
|
||||
virtual void onAssetRefresh(void) {};
|
||||
|
||||
static bool setCppFile(void *obj, const char *index, const char *data) { static_cast<CppAsset*>(obj)->setCppFile(data); return false; }
|
||||
|
|
|
|||
|
|
@ -141,7 +141,9 @@ void ImageAsset::loadImage()
|
|||
|
||||
void ImageAsset::initializeAsset()
|
||||
{
|
||||
setImageFileName(mImageFileName);
|
||||
mImageFileName = expandAssetFilePath(mImageFileName);
|
||||
|
||||
loadImage();
|
||||
}
|
||||
|
||||
void ImageAsset::onAssetRefresh()
|
||||
|
|
@ -155,10 +157,7 @@ void ImageAsset::setImageFileName(const char* pScriptFile)
|
|||
AssertFatal(pScriptFile != NULL, "Cannot use a NULL image file.");
|
||||
|
||||
// Update.
|
||||
mImageFileName = getOwned() ? expandAssetFilePath(pScriptFile) : StringTable->insert(pScriptFile);
|
||||
|
||||
// Refresh the asset.
|
||||
loadImage();
|
||||
mImageFileName = StringTable->insert(pScriptFile);
|
||||
}
|
||||
|
||||
DefineEngineMethod(ImageAsset, getImageFilename, const char*, (), ,
|
||||
|
|
|
|||
|
|
@ -119,13 +119,13 @@ void LevelAsset::initPersistFields()
|
|||
&setPreviewImageFile, &getPreviewImageFile, "Path to the image used for selection preview.");
|
||||
|
||||
addProtectedField("PostFXPresetFile", TypeAssetLooseFilePath, Offset(mPostFXPresetFile, LevelAsset),
|
||||
&setLevelFile, &getLevelFile, "Path to the level's postFXPreset.");
|
||||
&setPostFXPresetFile, &getPostFXPresetFile, "Path to the level's postFXPreset.");
|
||||
addProtectedField("DecalsFile", TypeAssetLooseFilePath, Offset(mDecalsFile, LevelAsset),
|
||||
&setLevelFile, &getLevelFile, "Path to the decals cache file.");
|
||||
&setDecalsFile, &getDecalsFile, "Path to the decals cache file.");
|
||||
addProtectedField("ForestFile", TypeAssetLooseFilePath, Offset(mForestFile, LevelAsset),
|
||||
&setLevelFile, &getLevelFile, "Path to the Forest cache file.");
|
||||
&setForestFile, &getForestFile, "Path to the Forest cache file.");
|
||||
addProtectedField("NavmeshFile", TypeAssetLooseFilePath, Offset(mNavmeshFile, LevelAsset),
|
||||
&setLevelFile, &getLevelFile, "Path to the navmesh file.");
|
||||
&setNavmeshFile, &getNavmeshFile, "Path to the navmesh file.");
|
||||
|
||||
addProtectedField("EditorFile", TypeAssetLooseFilePath, Offset(mEditorFile, LevelAsset),
|
||||
&setEditorFile, &getEditorFile, "Path to the level file with objects that were removed as part of the baking process. Loaded when the editor is loaded for ease of editing.");
|
||||
|
|
@ -153,6 +153,10 @@ void LevelAsset::initializeAsset()
|
|||
// Ensure the image-file is expanded.
|
||||
mPreviewImage = expandAssetFilePath(mPreviewImage);
|
||||
mLevelFile = expandAssetFilePath(mLevelFile);
|
||||
mPostFXPresetFile = expandAssetFilePath(mPostFXPresetFile);
|
||||
mDecalsFile = expandAssetFilePath(mDecalsFile);
|
||||
mForestFile = expandAssetFilePath(mForestFile);
|
||||
mNavmeshFile = expandAssetFilePath(mNavmeshFile);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
@ -169,7 +173,7 @@ void LevelAsset::setLevelFile(const char* pLevelFile)
|
|||
return;
|
||||
|
||||
// Update.
|
||||
mLevelFile = getOwned() ? expandAssetFilePath(pLevelFile) : StringTable->insert(pLevelFile);
|
||||
mLevelFile = pLevelFile;
|
||||
|
||||
// Refresh the asset.
|
||||
refreshAsset();
|
||||
|
|
@ -188,7 +192,7 @@ void LevelAsset::setImageFile(const char* pImageFile)
|
|||
return;
|
||||
|
||||
// Update.
|
||||
mPreviewImage = getOwned() ? expandAssetFilePath(pImageFile) : StringTable->insert(pImageFile);
|
||||
mPreviewImage = pImageFile;
|
||||
|
||||
// Refresh the asset.
|
||||
refreshAsset();
|
||||
|
|
@ -207,7 +211,7 @@ void LevelAsset::setEditorFile(const char* pEditorFile)
|
|||
return;
|
||||
|
||||
// Update.
|
||||
mEditorFile = getOwned() ? expandAssetFilePath(pEditorFile) : StringTable->insert(pEditorFile);
|
||||
mEditorFile = pEditorFile;
|
||||
|
||||
// Refresh the asset.
|
||||
refreshAsset();
|
||||
|
|
@ -226,7 +230,83 @@ void LevelAsset::setBakedSceneFile(const char* pBakedSceneFile)
|
|||
return;
|
||||
|
||||
// Update.
|
||||
mBakedSceneFile = getOwned() ? expandAssetFilePath(pBakedSceneFile) : StringTable->insert(pBakedSceneFile);
|
||||
mBakedSceneFile = pBakedSceneFile;
|
||||
|
||||
// Refresh the asset.
|
||||
refreshAsset();
|
||||
}
|
||||
|
||||
void LevelAsset::setPostFXPresetFile(const char* pPostFXPresetFile)
|
||||
{
|
||||
// Sanity!
|
||||
AssertFatal(pPostFXPresetFile != NULL, "Cannot use a NULL postFX preset file.");
|
||||
|
||||
// Fetch file.
|
||||
pPostFXPresetFile = StringTable->insert(pPostFXPresetFile);
|
||||
|
||||
// Ignore no change,
|
||||
if (pPostFXPresetFile == mPostFXPresetFile)
|
||||
return;
|
||||
|
||||
// Update.
|
||||
mPostFXPresetFile = pPostFXPresetFile;
|
||||
|
||||
// Refresh the asset.
|
||||
refreshAsset();
|
||||
}
|
||||
|
||||
void LevelAsset::setDecalsFile(const char* pDecalsFile)
|
||||
{
|
||||
// Sanity!
|
||||
AssertFatal(pDecalsFile != NULL, "Cannot use a NULL decals file.");
|
||||
|
||||
// Fetch file.
|
||||
pDecalsFile = StringTable->insert(pDecalsFile);
|
||||
|
||||
// Ignore no change,
|
||||
if (pDecalsFile == mDecalsFile)
|
||||
return;
|
||||
|
||||
// Update.
|
||||
mDecalsFile = pDecalsFile;
|
||||
|
||||
// Refresh the asset.
|
||||
refreshAsset();
|
||||
}
|
||||
|
||||
void LevelAsset::setForestFile(const char* pForestFile)
|
||||
{
|
||||
// Sanity!
|
||||
AssertFatal(pForestFile != NULL, "Cannot use a NULL decals file.");
|
||||
|
||||
// Fetch file.
|
||||
pForestFile = StringTable->insert(pForestFile);
|
||||
|
||||
// Ignore no change,
|
||||
if (pForestFile == mForestFile)
|
||||
return;
|
||||
|
||||
// Update.
|
||||
mForestFile = pForestFile;
|
||||
|
||||
// Refresh the asset.
|
||||
refreshAsset();
|
||||
}
|
||||
|
||||
void LevelAsset::setNavmeshFile(const char* pNavmeshFile)
|
||||
{
|
||||
// Sanity!
|
||||
AssertFatal(pNavmeshFile != NULL, "Cannot use a NULL Navmesh file.");
|
||||
|
||||
// Fetch file.
|
||||
pNavmeshFile = StringTable->insert(pNavmeshFile);
|
||||
|
||||
// Ignore no change,
|
||||
if (pNavmeshFile == mNavmeshFile)
|
||||
return;
|
||||
|
||||
// Update.
|
||||
mNavmeshFile = pNavmeshFile;
|
||||
|
||||
// Refresh the asset.
|
||||
refreshAsset();
|
||||
|
|
|
|||
|
|
@ -102,6 +102,16 @@ protected:
|
|||
static bool setBakedSceneFile(void* obj, const char* index, const char* data) { static_cast<LevelAsset*>(obj)->setBakedSceneFile(data); return false; }
|
||||
static const char* getBakedSceneFile(void* obj, const char* data) { return static_cast<LevelAsset*>(obj)->getBakedSceneFile(); }
|
||||
|
||||
static bool setPostFXPresetFile(void* obj, const char* index, const char* data) { static_cast<LevelAsset*>(obj)->setPostFXPresetFile(data); return false; }
|
||||
static const char* getPostFXPresetFile(void* obj, const char* data) { return static_cast<LevelAsset*>(obj)->getPostFXPresetFile(); }
|
||||
static bool setDecalsFile(void* obj, const char* index, const char* data) { static_cast<LevelAsset*>(obj)->setDecalsFile(data); return false; }
|
||||
static const char* getDecalsFile(void* obj, const char* data) { return static_cast<LevelAsset*>(obj)->getDecalsFile(); }
|
||||
|
||||
static bool setForestFile(void* obj, const char* index, const char* data) { static_cast<LevelAsset*>(obj)->setForestFile(data); return false; }
|
||||
static const char* getForestFile(void* obj, const char* data) { return static_cast<LevelAsset*>(obj)->getForestFile(); }
|
||||
static bool setNavmeshFile(void* obj, const char* index, const char* data) { static_cast<LevelAsset*>(obj)->setNavmeshFile(data); return false; }
|
||||
static const char* getNavmeshFile(void* obj, const char* data) { return static_cast<LevelAsset*>(obj)->getNavmeshFile(); }
|
||||
|
||||
|
||||
virtual void initializeAsset(void);
|
||||
virtual void onAssetRefresh(void) {}
|
||||
|
|
|
|||
|
|
@ -221,7 +221,9 @@ GuiControl* GuiInspectorTypeMaterialAssetPtr::constructEditControl()
|
|||
|
||||
char bitmapName[512] = "tools/worldEditor/images/toolbar/shape-editor";
|
||||
|
||||
if (!Sim::findObject(matAsset->getMaterialDefinitionName(), materialDef))
|
||||
StringTableEntry matDefName = matAsset ? matAsset->getMaterialDefinitionName() : matAssetId;
|
||||
|
||||
if (!Sim::findObject(matDefName, materialDef))
|
||||
{
|
||||
Con::errorf("GuiInspectorTypeMaterialAssetPtr::constructEditControl() - unable to find material in asset");
|
||||
}
|
||||
|
|
@ -244,7 +246,7 @@ GuiControl* GuiInspectorTypeMaterialAssetPtr::constructEditControl()
|
|||
mMatPreviewButton->setDataField(StringTable->insert("hovertime"), NULL, "1000");
|
||||
|
||||
StringBuilder strbld;
|
||||
strbld.append(matAsset->getMaterialDefinitionName());
|
||||
strbld.append(matDefName);
|
||||
strbld.append("\n");
|
||||
strbld.append("Open this file in the Material Editor");
|
||||
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ void PostEffectAsset::setScriptFile(const char* pScriptFile)
|
|||
return;
|
||||
|
||||
// Update.
|
||||
mScriptFile = getOwned() ? expandAssetFilePath(pScriptFile) : StringTable->insert(pScriptFile);
|
||||
mScriptFile = pScriptFile;
|
||||
|
||||
// Refresh the asset.
|
||||
refreshAsset();
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ ConsoleSetType(TypeShapeAssetPtr)
|
|||
ShapeAsset::ShapeAsset()
|
||||
{
|
||||
mFileName = StringTable->EmptyString();
|
||||
mConstructorFileName = StringTable->EmptyString();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -105,6 +106,8 @@ void ShapeAsset::initPersistFields()
|
|||
|
||||
addProtectedField("fileName", TypeAssetLooseFilePath, Offset(mFileName, ShapeAsset),
|
||||
&setShapeFile, &getShapeFile, "Path to the shape file we want to render");
|
||||
addProtectedField("constuctorFileName", TypeAssetLooseFilePath, Offset(mConstructorFileName, ShapeAsset),
|
||||
&setShapeConstructorFile, &getShapeConstructorFile, "Path to the shape file we want to render");
|
||||
}
|
||||
|
||||
void ShapeAsset::setDataField(StringTableEntry slotName, const char *array, const char *value)
|
||||
|
|
@ -135,6 +138,8 @@ void ShapeAsset::initializeAsset()
|
|||
if (!Platform::isFullPath(mFileName))
|
||||
mFileName = getOwned() ? expandAssetFilePath(mFileName) : mFileName;
|
||||
|
||||
mConstructorFileName = expandAssetFilePath(mConstructorFileName);
|
||||
|
||||
loadShape();
|
||||
}
|
||||
|
||||
|
|
@ -156,6 +161,24 @@ void ShapeAsset::setShapeFile(const char* pShapeFile)
|
|||
refreshAsset();
|
||||
}
|
||||
|
||||
void ShapeAsset::setShapeConstructorFile(const char* pShapeConstructorFile)
|
||||
{
|
||||
// Sanity!
|
||||
AssertFatal(pShapeConstructorFile != NULL, "Cannot use a NULL shape constructor file.");
|
||||
|
||||
// Fetch image file.
|
||||
pShapeConstructorFile = StringTable->insert(pShapeConstructorFile);
|
||||
|
||||
// Ignore no change,
|
||||
if (pShapeConstructorFile == mConstructorFileName)
|
||||
return;
|
||||
|
||||
mConstructorFileName = pShapeConstructorFile;
|
||||
|
||||
// Refresh the asset.
|
||||
refreshAsset();
|
||||
}
|
||||
|
||||
void ShapeAsset::_onResourceChanged(const Torque::Path &path)
|
||||
{
|
||||
if (path != Torque::Path(mFileName) )
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ class ShapeAsset : public AssetBase
|
|||
|
||||
protected:
|
||||
StringTableEntry mFileName;
|
||||
StringTableEntry mConstructorFileName;
|
||||
Resource<TSShape> mShape;
|
||||
|
||||
//Material assets we're dependent on and use
|
||||
|
|
@ -124,11 +125,18 @@ public:
|
|||
void setShapeFile(const char* pScriptFile);
|
||||
inline StringTableEntry getShapeFile(void) const { return mFileName; };
|
||||
|
||||
void setShapeConstructorFile(const char* pScriptFile);
|
||||
inline StringTableEntry getShapeConstructorFile(void) const { return mConstructorFileName; };
|
||||
|
||||
protected:
|
||||
virtual void onAssetRefresh(void);
|
||||
|
||||
static bool setShapeFile(void *obj, const char *index, const char *data) { static_cast<ShapeAsset*>(obj)->setShapeFile(data); return false; }
|
||||
static const char* getShapeFile(void* obj, const char* data) { return static_cast<ShapeAsset*>(obj)->getShapeFile(); }
|
||||
|
||||
static bool setShapeConstructorFile(void* obj, const char* index, const char* data) { static_cast<ShapeAsset*>(obj)->setShapeConstructorFile(data); return false; }
|
||||
static const char* getShapeConstructorFile(void* obj, const char* data) { return static_cast<ShapeAsset*>(obj)->getShapeConstructorFile(); }
|
||||
|
||||
};
|
||||
|
||||
DefineConsoleType(TypeShapeAssetPtr, S32)
|
||||
|
|
|
|||
|
|
@ -131,8 +131,7 @@ void TerrainAsset::initializeAsset()
|
|||
// Call parent.
|
||||
Parent::initializeAsset();
|
||||
|
||||
if (!Platform::isFullPath(mTerrainFilePath))
|
||||
mTerrainFilePath = getOwned() ? expandAssetFilePath(mTerrainFilePath) : mTerrainFilePath;
|
||||
mTerrainFilePath = expandAssetFilePath(mTerrainFilePath);
|
||||
|
||||
loadTerrain();
|
||||
}
|
||||
|
|
@ -153,7 +152,7 @@ void TerrainAsset::setTerrainFilePath(const char* pScriptFile)
|
|||
pScriptFile = StringTable->insert(pScriptFile);
|
||||
|
||||
// Update.
|
||||
mTerrainFilePath = getOwned() ? expandAssetFilePath(pScriptFile) : pScriptFile;
|
||||
mTerrainFilePath = pScriptFile;
|
||||
|
||||
// Refresh the asset.
|
||||
refreshAsset();
|
||||
|
|
@ -161,6 +160,9 @@ void TerrainAsset::setTerrainFilePath(const char* pScriptFile)
|
|||
|
||||
bool TerrainAsset::loadTerrain()
|
||||
{
|
||||
if (!Platform::isFile(mTerrainFilePath))
|
||||
return false;
|
||||
|
||||
mTerrMaterialAssets.clear();
|
||||
mTerrMaterialAssetIds.clear();
|
||||
|
||||
|
|
|
|||
|
|
@ -120,8 +120,7 @@ void TerrainMaterialAsset::initializeAsset()
|
|||
|
||||
compileShader();
|
||||
|
||||
if (!Platform::isFullPath(mScriptFile))
|
||||
mScriptFile = getOwned() ? expandAssetFilePath(mScriptFile) : mScriptFile;
|
||||
mScriptFile = expandAssetFilePath(mScriptFile);
|
||||
|
||||
if (Platform::isFile(mScriptFile))
|
||||
Con::executeFile(mScriptFile, false, false);
|
||||
|
|
@ -156,7 +155,7 @@ void TerrainMaterialAsset::setScriptFile(const char* pScriptFile)
|
|||
pScriptFile = StringTable->insert(pScriptFile);
|
||||
|
||||
// Update.
|
||||
mScriptFile = getOwned() ? expandAssetFilePath(pScriptFile) : pScriptFile;
|
||||
mScriptFile = pScriptFile;
|
||||
|
||||
// Refresh the asset.
|
||||
refreshAsset();
|
||||
|
|
|
|||
|
|
@ -139,6 +139,11 @@ void StateMachineAsset::setStateMachineFile(const char* pStateMachineFile)
|
|||
refreshAsset();
|
||||
}
|
||||
|
||||
void StateMachineAsset::initializeAsset()
|
||||
{
|
||||
mStateMachineFile = expandAssetFilePath(mStateMachineFile);
|
||||
}
|
||||
|
||||
|
||||
DefineEngineMethod(StateMachineAsset, notifyAssetChanged, void, (),,"")
|
||||
{
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ public:
|
|||
inline StringTableEntry getStateMachineFile(void) const { return mStateMachineFile; };
|
||||
|
||||
protected:
|
||||
virtual void initializeAsset(void) {}
|
||||
virtual void initializeAsset(void);
|
||||
virtual void onAssetRefresh(void) {}
|
||||
|
||||
static bool setStateMachineFile(void *obj, const char *index, const char *data) { static_cast<StateMachineAsset*>(obj)->setStateMachineFile(data); return false; }
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ EndImplementEnumType;
|
|||
|
||||
void TSStatic::initPersistFields()
|
||||
{
|
||||
addGroup("Media");
|
||||
addGroup("Shape");
|
||||
|
||||
addProtectedField("shapeAsset", TypeShapeAssetPtr, Offset(mShapeAsset, TSStatic),
|
||||
&TSStatic::_setShapeAsset, &defaultProtectedGetFn,
|
||||
|
|
@ -174,6 +174,9 @@ void TSStatic::initPersistFields()
|
|||
addField("shapeName", TypeShapeFilename, Offset( mShapeName, TSStatic ),
|
||||
"%Path and filename of the model file (.DTS, .DAE) to use for this TSStatic.", AbstractClassRep::FieldFlags::FIELD_HideInInspectors );
|
||||
|
||||
endGroup("Shape");
|
||||
|
||||
addGroup("Materials");
|
||||
addProtectedField( "skin", TypeRealString, Offset( mAppliedSkinName, TSStatic ), &_setFieldSkin, &_getFieldSkin,
|
||||
"@brief The skin applied to the shape.\n\n"
|
||||
|
||||
|
|
@ -199,9 +202,8 @@ void TSStatic::initPersistFields()
|
|||
"Material targets are only renamed if an existing Material maps to that "
|
||||
"name, or if there is a diffuse texture in the model folder with the same "
|
||||
"name as the new target.\n\n" );
|
||||
|
||||
endGroup("Media");
|
||||
|
||||
endGroup("Materials");
|
||||
|
||||
addGroup("Rendering");
|
||||
|
||||
addField( "playAmbient", TypeBool, Offset( mPlayAmbient, TSStatic ),
|
||||
|
|
@ -1606,20 +1608,20 @@ void TSStatic::updateMaterials()
|
|||
|
||||
void TSStatic::onInspect(GuiInspector* inspector)
|
||||
{
|
||||
if (mShapeAsset == nullptr)
|
||||
return;
|
||||
|
||||
//Put the GameObject group before everything that'd be gameobject-effecting, for orginazational purposes
|
||||
GuiInspectorGroup* tsStaticInspGroup = new GuiInspectorGroup("Shape", inspector);
|
||||
|
||||
tsStaticInspGroup->registerObject();
|
||||
inspector->addInspectorGroup(tsStaticInspGroup);
|
||||
inspector->addObject(tsStaticInspGroup);
|
||||
|
||||
GuiInspectorGroup* materialGroup = inspector->findExistentGroup(StringTable->insert("Materials"));
|
||||
GuiControl* stack = dynamic_cast<GuiControl*>(materialGroup->findObjectByInternalName(StringTable->insert("Stack")));
|
||||
|
||||
//Do this on both the server and client
|
||||
/*S32 materialCount = mShapeAsset->getShape()->materialList->getMaterialNameList().size(); //mMeshAsset->getMaterialCount();
|
||||
S32 materialCount = mShapeAsset->getShape()->materialList->getMaterialNameList().size(); //mMeshAsset->getMaterialCount();
|
||||
|
||||
if (isServerObject())
|
||||
{
|
||||
//we need to update the editor
|
||||
for (U32 i = 0; i < mFields.size(); i++)
|
||||
/*for (U32 i = 0; i < mFields.size(); i++)
|
||||
{
|
||||
//find any with the materialslot title and clear them out
|
||||
if (FindMatch::isMatch("MaterialSlot*", mFields[i].mFieldName, false))
|
||||
|
|
@ -1628,36 +1630,66 @@ void TSStatic::onInspect(GuiInspector* inspector)
|
|||
mFields.erase(i);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
//next, get a listing of our materials in the shape, and build our field list for them
|
||||
char matFieldName[128];
|
||||
|
||||
if (materialCount > 0)
|
||||
mComponentGroup = StringTable->insert("Materials");
|
||||
|
||||
for (U32 i = 0; i < materialCount; i++)
|
||||
{
|
||||
StringTableEntry materialname = StringTable->insert(mMeshAsset->getShape()->materialList->getMaterialName(i).c_str());
|
||||
StringTableEntry materialname = StringTable->insert(mShapeAsset->getShape()->materialList->getMaterialName(i).c_str());
|
||||
|
||||
//Iterate through our assetList to find the compliant entry in our matList
|
||||
for (U32 m = 0; m < mMeshAsset->getMaterialCount(); m++)
|
||||
for (U32 m = 0; m < mShapeAsset->getMaterialCount(); m++)
|
||||
{
|
||||
AssetPtr<MaterialAsset> matAsset = mMeshAsset->getMaterialAsset(m);
|
||||
AssetPtr<MaterialAsset> matAsset = mShapeAsset->getMaterialAsset(m);
|
||||
|
||||
if (matAsset->getMaterialDefinitionName() == materialname)
|
||||
{
|
||||
dSprintf(matFieldName, 128, "MaterialSlot%d", i);
|
||||
|
||||
addComponentField(matFieldName, "A material used in the shape file", "Material", matAsset->getAssetId(), "");
|
||||
//addComponentField(matFieldName, "A material used in the shape file", "Material", matAsset->getAssetId(), "");
|
||||
//Con::executef(this, "onConstructComponentField", mTargetComponent, field->mFieldName);
|
||||
Con::printf("Added material field for MaterialSlot %d", i);
|
||||
|
||||
GuiInspectorField* fieldGui = materialGroup->constructField(TypeMaterialAssetPtr);
|
||||
fieldGui->init(inspector, materialGroup);
|
||||
|
||||
fieldGui->setSpecialEditField(true);
|
||||
fieldGui->setTargetObject(this);
|
||||
|
||||
StringTableEntry fldnm = StringTable->insert(matFieldName);
|
||||
|
||||
fieldGui->setSpecialEditVariableName(fldnm);
|
||||
|
||||
fieldGui->setInspectorField(NULL, fldnm);
|
||||
fieldGui->setDocs("");
|
||||
|
||||
if (fieldGui->registerObject())
|
||||
{
|
||||
fieldGui->setValue(materialname);
|
||||
|
||||
stack->addObject(fieldGui);
|
||||
}
|
||||
else
|
||||
{
|
||||
SAFE_DELETE(fieldGui);
|
||||
}
|
||||
|
||||
/*if (materialGroup->isMethod("onConstructField"))
|
||||
{
|
||||
//ensure our stack variable is bound if we need it
|
||||
//Con::evaluatef("%d.stack = %d;", materialGroup->getId(), materialGroup->at(0)->getId());
|
||||
|
||||
Con::executef(materialGroup, "onConstructField", matFieldName,
|
||||
matFieldName, "material", matFieldName,
|
||||
materialname, "", "", this);
|
||||
}*/
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (materialCount > 0)
|
||||
mComponentGroup = "";
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
DefineEngineMethod( TSStatic, getTargetName, const char*, ( S32 index ),(0),
|
||||
|
|
|
|||
|
|
@ -2435,15 +2435,17 @@ bool GuiTreeViewCtrl::setItemExpanded(S32 itemId, bool expand)
|
|||
if(item->isExpanded() == expand)
|
||||
return(true);
|
||||
|
||||
item->setExpanded(expand);
|
||||
|
||||
// expand parents
|
||||
if(expand)
|
||||
{
|
||||
while(item)
|
||||
while (item)
|
||||
{
|
||||
if(item->mState.test(Item::VirtualParent))
|
||||
if (!item->isInspectorData() && item->mState.test(Item::VirtualParent))
|
||||
onVirtualParentExpand(item);
|
||||
|
||||
item->setExpanded(true);
|
||||
scrollVisible(item);
|
||||
item = item->mParent;
|
||||
}
|
||||
}
|
||||
|
|
@ -2454,6 +2456,12 @@ bool GuiTreeViewCtrl::setItemExpanded(S32 itemId, bool expand)
|
|||
|
||||
item->setExpanded(false);
|
||||
}
|
||||
|
||||
//if (!item->isInspectorData() && item->mState.test(Item::VirtualParent))
|
||||
// onVirtualParentExpand(item);
|
||||
|
||||
mFlags.set(RebuildVisible);
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -584,8 +584,6 @@ void GuiInspector::refresh()
|
|||
mGroups.push_back(general);
|
||||
addObject(general);
|
||||
|
||||
mTargets.first()->onInspect(this);
|
||||
|
||||
// Create the inspector groups for static fields.
|
||||
|
||||
for( TargetVector::iterator iter = mTargets.begin(); iter != mTargets.end(); ++ iter )
|
||||
|
|
@ -624,6 +622,8 @@ void GuiInspector::refresh()
|
|||
}
|
||||
}
|
||||
|
||||
mTargets.first()->onInspect(this);
|
||||
|
||||
// Deal with dynamic fields
|
||||
if ( !isGroupFiltered( "Dynamic Fields" ) )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -107,6 +107,7 @@ bool GuiInspectorGroup::createContent()
|
|||
|
||||
// Prefer GuiTransperantProfile for the stack.
|
||||
mStack->setDataField( StringTable->insert("profile"), NULL, "GuiInspectorStackProfile" );
|
||||
mStack->setInternalName(StringTable->insert("stack"));
|
||||
if( !mStack->registerObject() )
|
||||
{
|
||||
SAFE_DELETE( mStack );
|
||||
|
|
|
|||
|
|
@ -86,8 +86,7 @@ ImplementEnumType( MaterialBlendOp,
|
|||
{ Material::Add, "Add", "Adds the color of the material to the frame buffer with full alpha for each pixel." },
|
||||
{ Material::AddAlpha, "AddAlpha", "The color is modulated by the alpha channel before being added to the frame buffer." },
|
||||
{ Material::Sub, "Sub", "Subtractive Blending. Reverses the color model, causing dark colors to have a stronger visual effect." },
|
||||
{ Material::LerpAlpha, "LerpAlpha", "Linearly interpolates between Material color and frame buffer color based on alpha." },
|
||||
{ Material::PreMult, "PreMult", "" }
|
||||
{ Material::LerpAlpha, "LerpAlpha", "Linearly interpolates between Material color and frame buffer color based on alpha." }
|
||||
EndImplementEnumType;
|
||||
|
||||
ImplementEnumType( MaterialWaveType,
|
||||
|
|
|
|||
|
|
@ -111,7 +111,6 @@ public:
|
|||
Sub,
|
||||
LerpAlpha, // linear interpolation modulated with alpha channel
|
||||
ToneMap,
|
||||
PreMult,
|
||||
NumBlendTypes
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -148,13 +148,6 @@ void ProcessedMaterial::_setBlendState(Material::BlendOp blendOp, GFXStateBlockD
|
|||
break;
|
||||
}
|
||||
|
||||
case Material::PreMult:
|
||||
{
|
||||
desc.blendSrc = GFXBlendOne;
|
||||
desc.blendDest = GFXBlendInvSrcAlpha;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
// default to LerpAlpha
|
||||
|
|
|
|||
|
|
@ -336,8 +336,11 @@ void ProcessedShaderMaterial::_determineFeatures( U32 stageNum,
|
|||
|
||||
// TODO: This sort of sucks... BL should somehow force this
|
||||
// feature on from the outside and not this way.
|
||||
if ( dStrcmp( LIGHTMGR->getId(), "BLM" ) == 0 )
|
||||
fd.features.addFeature( MFT_ForwardShading );
|
||||
if (dStrcmp(LIGHTMGR->getId(), "BLM") == 0)
|
||||
{
|
||||
fd.features.addFeature(MFT_ForwardShading);
|
||||
fd.features.addFeature(MFT_ReflectionProbes);
|
||||
}
|
||||
|
||||
// Disabling the InterlacedDeferred feature for now. It is not ready for prime-time
|
||||
// and it should not be triggered off of the DoubleSided parameter. [2/5/2010 Pat]
|
||||
|
|
|
|||
|
|
@ -111,11 +111,6 @@ LangElement* ShaderFeatureHLSL::assignColor( LangElement *elem,
|
|||
assign = new GenOp( "@ -= @", color, elem );
|
||||
break;
|
||||
|
||||
case Material::PreMult:
|
||||
//result = src.rgb + (dst.rgb * (1 - src.A))
|
||||
assign = new GenOp("@.rgb = @.rgb + (@.rgb * (1 - @.a))", color, color, elem, color);
|
||||
break;
|
||||
|
||||
case Material::Mul:
|
||||
assign = new GenOp( "@ *= @", color, elem );
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -906,4 +906,4 @@ DefineEngineMethod(SQLiteObject, numResultSets, S32, (),, "numResultSets()")
|
|||
DefineEngineMethod(SQLiteObject, getLastRowId, S32, (), , "getLastRowId()")
|
||||
{
|
||||
return object->getLastRowId();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue