diff --git a/Engine/source/T3D/assets/TerrainAsset.cpp b/Engine/source/T3D/assets/TerrainAsset.cpp index b3e2a8a1c..522b11a71 100644 --- a/Engine/source/T3D/assets/TerrainAsset.cpp +++ b/Engine/source/T3D/assets/TerrainAsset.cpp @@ -40,6 +40,8 @@ #include "assets/assetPtr.h" #endif +#include "T3D/assets/TerrainMaterialAsset.h" + //----------------------------------------------------------------------------- IMPLEMENT_CONOBJECT(TerrainAsset); @@ -89,7 +91,7 @@ ConsoleSetType(TypeTerrainAssetPtr) TerrainAsset::TerrainAsset() { - mTerrainFile = StringTable->EmptyString(); + mTerrainFilePath = StringTable->EmptyString(); } //----------------------------------------------------------------------------- @@ -106,8 +108,22 @@ void TerrainAsset::initPersistFields() Parent::initPersistFields(); //addField("shaderGraph", TypeRealString, Offset(mShaderGraphFile, TerrainAsset), ""); - addProtectedField("terrainFile", TypeAssetLooseFilePath, Offset(mTerrainFile, TerrainAsset), - &setTerrainFile, &getTerrainFile, "Path to the file containing the terrain data."); + addProtectedField("terrainFile", TypeAssetLooseFilePath, Offset(mTerrainFilePath, TerrainAsset), + &setTerrainFilePath, &getTerrainFilePath, "Path to the file containing the terrain data."); +} + +void TerrainAsset::setDataField(StringTableEntry slotName, const char* array, const char* value) +{ + Parent::setDataField(slotName, array, value); + + //Now, if it's a material slot of some fashion, set it up + StringTableEntry matSlotName = StringTable->insert("terrainMaterialAsset"); + if (String(slotName).startsWith(matSlotName)) + { + StringTableEntry matId = StringTable->insert(value); + + mTerrMaterialAssetIds.push_back(matId); + } } void TerrainAsset::initializeAsset() @@ -115,22 +131,20 @@ void TerrainAsset::initializeAsset() // Call parent. Parent::initializeAsset(); - if (!Platform::isFullPath(mTerrainFile)) - mTerrainFile = getOwned() ? expandAssetFilePath(mTerrainFile) : mTerrainFile; + if (!Platform::isFullPath(mTerrainFilePath)) + mTerrainFilePath = getOwned() ? expandAssetFilePath(mTerrainFilePath) : mTerrainFilePath; - //if (Platform::isFile(mTerrainFile)) - // Con::executeFile(mScriptFile, false, false); + loadTerrain(); } void TerrainAsset::onAssetRefresh() { - mTerrainFile = expandAssetFilePath(mTerrainFile); + mTerrainFilePath = expandAssetFilePath(mTerrainFilePath); - //if (Platform::isFile(mScriptFile)) - // Con::executeFile(mScriptFile, false, false); + loadTerrain(); } -void TerrainAsset::setTerrainFile(const char* pScriptFile) +void TerrainAsset::setTerrainFilePath(const char* pScriptFile) { // Sanity! AssertFatal(pScriptFile != NULL, "Cannot use a NULL script file."); @@ -139,12 +153,52 @@ void TerrainAsset::setTerrainFile(const char* pScriptFile) pScriptFile = StringTable->insert(pScriptFile); // Update. - mTerrainFile = getOwned() ? expandAssetFilePath(pScriptFile) : pScriptFile; + mTerrainFilePath = getOwned() ? expandAssetFilePath(pScriptFile) : pScriptFile; // Refresh the asset. refreshAsset(); } +bool TerrainAsset::loadTerrain() +{ + mTerrMaterialAssets.clear(); + mTerrMaterialAssetIds.clear(); + + //First, load any material, animation, etc assets we may be referencing in our asset + // Find any asset dependencies. + AssetManager::typeAssetDependsOnHash::Iterator assetDependenciesItr = mpOwningAssetManager->getDependedOnAssets()->find(mpAssetDefinition->mAssetId); + + // Does the asset have any dependencies? + if (assetDependenciesItr != mpOwningAssetManager->getDependedOnAssets()->end()) + { + // Iterate all dependencies. + while (assetDependenciesItr != mpOwningAssetManager->getDependedOnAssets()->end() && assetDependenciesItr->key == mpAssetDefinition->mAssetId) + { + StringTableEntry assetType = mpOwningAssetManager->getAssetType(assetDependenciesItr->value); + + if (assetType == StringTable->insert("TerrainMaterialAsset")) + { + mTerrMaterialAssetIds.push_front(assetDependenciesItr->value); + + //Force the asset to become initialized if it hasn't been already + AssetPtr matAsset = assetDependenciesItr->value; + + mTerrMaterialAssets.push_front(matAsset); + } + + // Next dependency. + assetDependenciesItr++; + } + } + + mTerrainFile = ResourceManager::get().load(mTerrainFilePath); + + if (mTerrainFile) + return true; + + return false; +} + //------------------------------------------------------------------------------ void TerrainAsset::copyTo(SimObject* object) @@ -190,7 +244,7 @@ GuiControl* GuiInspectorTypeTerrainAssetPtr::constructEditControl() TerrainAsset* matAsset = AssetDatabase.acquireAsset< TerrainAsset>(matAssetId); - TerrainMaterial* materialDef = nullptr; + //TerrainMaterial* materialDef = nullptr; char bitmapName[512] = "tools/worldEditor/images/toolbar/shape-editor"; @@ -268,23 +322,3 @@ bool GuiInspectorTypeTerrainAssetPtr::updateRects() return resized; } - -void GuiInspectorTypeTerrainAssetPtr::setMaterialAsset(String assetId) -{ - mTargetObject->setDataField(mCaption, "", assetId); - - //force a refresh - SimObject* obj = mInspector->getInspectObject(); - mInspector->inspectObject(obj); -} - -DefineEngineMethod(GuiInspectorTypeTerrainAssetPtr, setMaterialAsset, void, (String assetId), (""), - "Gets a particular shape animation asset for this shape.\n" - "@param animation asset index.\n" - "@return Shape Animation Asset.\n") -{ - if (assetId == String::EmptyString) - return; - - return object->setMaterialAsset(assetId); -} diff --git a/Engine/source/T3D/assets/TerrainAsset.h b/Engine/source/T3D/assets/TerrainAsset.h index e8c2be59b..805779fe9 100644 --- a/Engine/source/T3D/assets/TerrainAsset.h +++ b/Engine/source/T3D/assets/TerrainAsset.h @@ -19,6 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. //----------------------------------------------------------------------------- +#pragma once #ifndef TERRAINASSET_H #define TERRAINASSET_H @@ -46,14 +47,23 @@ #include "gui/editor/guiInspectorTypes.h" #endif -#include "terrain/terrData.h" +//#include "terrain/terrData.h" +#include "assets/assetPtr.h" +#include "terrain/terrFile.h" + +class TerrainMaterialAsset; //----------------------------------------------------------------------------- class TerrainAsset : public AssetBase { typedef AssetBase Parent; - StringTableEntry mTerrainFile; + StringTableEntry mTerrainFilePath; + Resource mTerrainFile; + + //Material assets we're dependent on and use + Vector mTerrMaterialAssetIds; + Vector> mTerrMaterialAssets; public: TerrainAsset(); @@ -63,8 +73,14 @@ public: static void initPersistFields(); virtual void copyTo(SimObject* object); - void setTerrainFile(const char* pTerrainFile); - inline StringTableEntry getTerrainFile(void) const { return mTerrainFile; }; + virtual void setDataField(StringTableEntry slotName, const char* array, const char* value); + + void setTerrainFilePath(const char* pTerrainFile); + inline StringTableEntry getTerrainFilePath(void) const { return mTerrainFilePath; }; + + inline Resource getTerrainResource(void) const { return mTerrainFile; }; + + bool loadTerrain(); /// Declare Console Object. DECLARE_CONOBJECT(TerrainAsset); @@ -73,8 +89,8 @@ protected: virtual void initializeAsset(); virtual void onAssetRefresh(void); - static bool setTerrainFile(void *obj, const char *index, const char *data) { static_cast(obj)->setTerrainFile(data); return false; } - static const char* getTerrainFile(void* obj, const char* data) { return static_cast(obj)->getTerrainFile(); } + static bool setTerrainFilePath(void *obj, const char *index, const char *data) { static_cast(obj)->setTerrainFilePath(data); return false; } + static const char* getTerrainFilePath(void* obj, const char* data) { return static_cast(obj)->getTerrainFilePath(); } }; DefineConsoleType(TypeTerrainAssetPtr, TerrainAsset) @@ -96,7 +112,6 @@ public: virtual GuiControl* constructEditControl(); virtual bool updateRects(); - void setMaterialAsset(String assetId); }; #endif // _ASSET_BASE_H_ diff --git a/Engine/source/T3D/assets/TerrainMaterialAsset.h b/Engine/source/T3D/assets/TerrainMaterialAsset.h index ae9a28f01..3fb4d3c7e 100644 --- a/Engine/source/T3D/assets/TerrainMaterialAsset.h +++ b/Engine/source/T3D/assets/TerrainMaterialAsset.h @@ -19,6 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. //----------------------------------------------------------------------------- +#pragma once #ifndef TERRAINMATERIALASSET_H #define TERRAINMATERIALASSET_H diff --git a/Engine/source/materials/materialDefinition.cpp b/Engine/source/materials/materialDefinition.cpp index b6c0cbfab..632e26fec 100644 --- a/Engine/source/materials/materialDefinition.cpp +++ b/Engine/source/materials/materialDefinition.cpp @@ -184,7 +184,7 @@ Material::Material() dMemset(mCellLayout, 0, sizeof(mCellLayout)); dMemset(mCellSize, 0, sizeof(mCellSize)); dMemset(mNormalMapAtlas, 0, sizeof(mNormalMapAtlas)); - dMemset(mUseAnisotropic, 0, sizeof(mUseAnisotropic)); + dMemset(mUseAnisotropic, 1, sizeof(mUseAnisotropic)); // Deferred Shading : Metalness dMemset(mUseMetalness, 0, sizeof(mUseMetalness)); diff --git a/Engine/source/terrain/terrData.cpp b/Engine/source/terrain/terrData.cpp index 78e991b63..2193ff66d 100644 --- a/Engine/source/terrain/terrData.cpp +++ b/Engine/source/terrain/terrData.cpp @@ -53,7 +53,7 @@ #include "T3D/physics/physicsCollision.h" #include "console/engineAPI.h" -#include "console/engineAPI.h" +#include "T3D/assets/TerrainMaterialAsset.h" using namespace Torque; IMPLEMENT_CO_NETOBJECT_V1(TerrainBlock); @@ -207,6 +207,9 @@ TerrainBlock::TerrainBlock() mNetFlags.set(Ghostable | ScopeAlways); mIgnoreZodiacs = false; zode_primBuffer = 0; + + mTerrainAsset = StringTable->EmptyString(); + mTerrainAssetId = StringTable->EmptyString(); } @@ -352,17 +355,121 @@ void TerrainBlock::setFile(const Resource& terr) mTerrFileName = terr.getPath(); } +bool TerrainBlock::setTerrainAsset(const StringTableEntry terrainAssetId) +{ + mTerrainAssetId = terrainAssetId; + mTerrainAsset = mTerrainAssetId; + + if (mTerrainAsset.isNull()) + { + Con::errorf("[TerrainBlock] Failed to load terrain asset."); + return false; + } + + Resource file = mTerrainAsset->getTerrainResource(); + if (!file) + return false; + + mFile = file; + return true; +} + bool TerrainBlock::save(const char *filename) { return mFile->save(filename); } +bool TerrainBlock::saveAsset() +{ + if (!mTerrainAsset.isNull() && mTerrainAsset->isAssetValid()) + { + //first, clear out our old dependency references + /*SimFieldDictionary* fieldDictionary = mTerrainAsset->getFieldDictionary(); + for (SimFieldDictionaryIterator itr(fieldDictionary); *itr; ++itr) + { + SimFieldDictionary::Entry* entry = *itr; + + if (String(entry->slotName).startsWith("terrainMaterailAsset")) + { + //got one, so clear it's value + setDataField(entry->slotName, NULL, ""); + } + } + + AssetQuery* pAssetQuery = new AssetQuery(); + AssetDatabase.findAssetType(pAssetQuery, "TerrainMaterialAsset"); + + TerrainBlock* clientTerr = static_cast(getClientObject()); + + U32 terrMatIdx = 0; + for (U32 i = 0; i < pAssetQuery->mAssetList.size(); i++) + { + //Acquire it so we can check it for matches + AssetPtr terrMatAsset = pAssetQuery->mAssetList[i]; + + for (U32 m = 0; m < clientTerr->mFile->mMaterials.size(); m++) + { + StringTableEntry intMatName = clientTerr->mFile->mMaterials[m]->getInternalName(); + + StringTableEntry assetMatDefName = terrMatAsset->getMaterialDefinitionName(); + if (assetMatDefName == intMatName) + { + //we have a match! + char depSlotName[30]; + dSprintf(depSlotName, sizeof(depSlotName), "terrainMaterialAsset%d", terrMatIdx); + + char depValue[255]; + dSprintf(depValue, sizeof(depValue), "@Asset=%s", terrMatAsset.getAssetId()); + + setDataField(depSlotName, NULL, depValue); + + terrMatIdx++; + } + } + + terrMatAsset.clear(); + } + + pAssetQuery->destroySelf(); + + // Set the format mode. + Taml taml; + + // Yes, so set it. + taml.setFormatMode(Taml::getFormatModeEnum("xml")); + + // Turn-off auto-formatting. + taml.setAutoFormat(false); + + // Read object. + bool success = taml.write(mTerrainAsset, AssetDatabase.getAssetFilePath(mTerrainAsset.getAssetId())); + + if (!success) + return false;*/ + + return mFile->save(mTerrainAsset->getTerrainFilePath()); + } + + return false; +} + bool TerrainBlock::_setTerrainFile( void *obj, const char *index, const char *data ) { static_cast( obj )->setFile( FileName( data ) ); return false; } +bool TerrainBlock::_setTerrainAsset(void* obj, const char* index, const char* data) +{ + TerrainBlock* terr = static_cast(obj);// ->setFile(FileName(data)); + + terr->setTerrainAsset(StringTable->insert(data)); + + terr->setMaskBits(FileMask | HeightMapChangeMask); + + return false; +} + void TerrainBlock::_updateBounds() { if ( !mFile ) @@ -901,31 +1008,50 @@ bool TerrainBlock::onAdd() if(!Parent::onAdd()) return false; - if ( mTerrFileName.isEmpty() ) + Resource terr; + + if (!mTerrainAsset.isNull()) { - mTerrFileName = Con::getVariable( "$Client::MissionFile" ); - String terrainDirectory( Con::getVariable( "$pref::Directories::Terrain" ) ); - if ( terrainDirectory.isEmpty() ) + terr = mTerrainAsset->getTerrainResource(); + + if (terr == NULL) { - terrainDirectory = "art/terrains/"; + if (isClientObject()) + NetConnection::setLastError("Unable to load terrain asset: %s", mTerrainAsset.getAssetId()); + return false; } - mTerrFileName.replace("tools/levels/", terrainDirectory); - mTerrFileName.replace("levels/", terrainDirectory); - Vector materials; - materials.push_back( "warning_material" ); - TerrainFile::create( &mTerrFileName, 256, materials ); + mFile = terr; } - - Resource terr = ResourceManager::get().load( mTerrFileName ); - if(terr == NULL) + else { - if(isClientObject()) - NetConnection::setLastError("You are missing a file needed to play this mission: %s", mTerrFileName.c_str()); - return false; - } + if (mTerrFileName.isEmpty()) + { + mTerrFileName = Con::getVariable("$Client::MissionFile"); + String terrainDirectory(Con::getVariable("$pref::Directories::Terrain")); + if (terrainDirectory.isEmpty()) + { + terrainDirectory = "art/terrains/"; + } + mTerrFileName.replace("tools/levels/", terrainDirectory); + mTerrFileName.replace("levels/", terrainDirectory); - setFile( terr ); + Vector materials; + materials.push_back("warning_material"); + TerrainFile::create(&mTerrFileName, 256, materials); + } + + terr = ResourceManager::get().load(mTerrFileName); + + if (terr == NULL) + { + if (isClientObject()) + NetConnection::setLastError("You are missing a file needed to play this mission: %s", mTerrFileName.c_str()); + return false; + } + + setFile(terr); + } if ( terr->mNeedsResaving ) { @@ -1130,6 +1256,10 @@ void TerrainBlock::initPersistFields() &TerrainBlock::_setTerrainFile, &defaultProtectedGetFn, "The source terrain data file." ); + addProtectedField("terrainAsset", TypeTerrainAssetPtr, Offset(mTerrainAsset, TerrainBlock), + &TerrainBlock::_setTerrainAsset, &defaultProtectedGetFn, + "The source terrain data asset."); + endGroup( "Media" ); addGroup( "Misc" ); @@ -1190,6 +1320,7 @@ U32 TerrainBlock::packUpdate(NetConnection* con, U32 mask, BitStream *stream) if ( stream->writeFlag( mask & FileMask ) ) { stream->write( mTerrFileName ); + stream->writeString( mTerrainAssetId ); stream->write( mCRC ); } @@ -1230,12 +1361,25 @@ void TerrainBlock::unpackUpdate(NetConnection* con, BitStream *stream) { FileName terrFile; stream->read( &terrFile ); + char buffer[256]; + stream->readString(buffer); + StringTableEntry terrainAsset = StringTable->insert(buffer); stream->read( &mCRC ); - if ( isProperlyAdded() ) - setFile( terrFile ); + if (terrainAsset != StringTable->EmptyString()) + { + if (isProperlyAdded()) + setTerrainAsset(StringTable->insert(terrFile.c_str())); + else + mTerrainAssetId = StringTable->insert(terrFile.c_str()); + } else - mTerrFileName = terrFile; + { + if (isProperlyAdded()) + setFile(terrFile); + else + mTerrFileName = terrFile; + } } if ( stream->readFlag() ) // SizeMask @@ -1310,6 +1454,16 @@ DefineEngineMethod( TerrainBlock, save, bool, ( const char* fileName),, return static_cast(object)->save(filename); } +DefineEngineMethod(TerrainBlock, saveAsset, bool, (), , + "@brief Saves the terrain block's terrain file to the specified file name.\n\n" + + "@param fileName Name and path of file to save terrain data to.\n\n" + + "@return True if file save was successful, false otherwise") +{ + return static_cast(object)->saveAsset(); +} + //ConsoleMethod(TerrainBlock, save, bool, 3, 3, "(string fileName) - saves the terrain block's terrain file to the specified file name.") //{ // char filename[256]; diff --git a/Engine/source/terrain/terrData.h b/Engine/source/terrain/terrData.h index 87f994a03..15b02bee5 100644 --- a/Engine/source/terrain/terrData.h +++ b/Engine/source/terrain/terrData.h @@ -50,7 +50,12 @@ #include "gfx/gfxPrimitiveBuffer.h" #endif - +#ifndef _ASSET_PTR_H_ +#include "assets/assetPtr.h" +#endif +#ifndef TERRAINASSET_H +#include "T3D/assets/TerrainAsset.h" +#endif class GBitmap; class TerrainBlock; @@ -120,6 +125,9 @@ protected: /// FileName mTerrFileName; + + AssetPtr mTerrainAsset; + StringTableEntry mTerrainAssetId; /// The maximum detail distance found in the material list. F32 mMaxDetailDistance; @@ -241,6 +249,7 @@ protected: // Protected fields static bool _setTerrainFile( void *obj, const char *index, const char *data ); + static bool _setTerrainAsset(void* obj, const char* index, const char* data); static bool _setSquareSize( void *obj, const char *index, const char *data ); static bool _setBaseTexSize(void *obj, const char *index, const char *data); static bool _setBaseTexFormat(void *obj, const char *index, const char *data); @@ -418,7 +427,10 @@ public: void setFile(const Resource& file); + bool setTerrainAsset(const StringTableEntry terrainAssetId); + bool save(const char* filename); + bool saveAsset(); F32 getSquareSize() const { return mSquareSize; } diff --git a/Engine/source/terrain/terrMaterial.cpp b/Engine/source/terrain/terrMaterial.cpp index ecbf8d822..02b776f58 100644 --- a/Engine/source/terrain/terrMaterial.cpp +++ b/Engine/source/terrain/terrMaterial.cpp @@ -97,7 +97,7 @@ void TerrainMaterial::initPersistFields() addField( "parallaxScale", TypeF32, Offset( mParallaxScale, TerrainMaterial ), "Used to scale the height from the normal map to give some self " "occlusion effect (aka parallax) to the terrain material" ); - addField("compositeMap", TypeStringFilename, Offset(mCompositeMap, TerrainMaterial), "Composite map for the material"); + addField("pbrConfigMap", TypeStringFilename, Offset(mCompositeMap, TerrainMaterial), "Composite map for the material"); Parent::initPersistFields(); // Gotta call this at least once or it won't get created! diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui index 1bf2eff3c..299007868 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui @@ -314,7 +314,7 @@ minExtent = "8 2"; horizSizing = "left"; vertSizing = "bottom"; - profile = "ToolsGuiDefaultProfile"; + profile = "ToolsGuiSolidDefaultProfile"; visible = "1"; active = "1"; command = "AssetBrowser.showVisibiltyOptions();"; @@ -343,7 +343,7 @@ minExtent = "64 64"; horizSizing = "relative"; vertSizing = "height"; - profile = "ToolsGuiDefaultProfile"; + profile = "ToolsGuiSolidDefaultProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; @@ -365,7 +365,7 @@ minExtent = "0 0"; horizSizing = "right"; vertSizing = "bottom"; - profile = "ToolsGuiDefaultProfile"; + profile = "ToolsGuiSolidDefaultProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; @@ -462,7 +462,7 @@ minExtent = "8 2"; horizSizing = "width"; vertSizing = "height"; - profile = "ToolsGuiDefaultProfile"; + profile = "ToolsGuiSolidDefaultProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; @@ -495,7 +495,7 @@ profile = "GuiEditorScrollProfile"; visible = "1"; active = "1"; - tooltipProfile = "ToolsGuiDefaultProfile"; + tooltipProfile = "ToolsGuiSolidDefaultProfile"; hovertime = "1000"; isContainer = "1"; canSave = "1"; @@ -554,7 +554,7 @@ minExtent = "16 16"; horizSizing = "right"; vertSizing = "bottom"; - profile = "ToolsGuiDefaultProfile"; + profile = "ToolsGuiSolidDefaultProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; @@ -629,7 +629,7 @@ minExtent = "8 2"; horizSizing = "left"; vertSizing = "bottom"; - profile = "ToolsGuiDefaultProfile"; + profile = "ToolsGuiSolidDefaultProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; @@ -654,7 +654,7 @@ minExtent = "8 2"; horizSizing = "right"; vertSizing = "bottom"; - profile = "ToolsGuiDefaultProfile"; + profile = "ToolsGuiSolidDefaultProfile"; visible = "1"; active = "1"; command = "AssetBrowser.toggleFolderCollapseButton();"; @@ -680,7 +680,7 @@ minExtent = "8 2"; horizSizing = "left"; vertSizing = "bottom"; - profile = "ToolsGuiDefaultProfile"; + profile = "ToolsGuiSolidDefaultProfile"; visible = "1"; active = "1"; command = "AssetBrowser.showFilterOptions();"; @@ -704,7 +704,7 @@ minExtent = "8 2"; horizSizing = "width"; vertSizing = "height"; - profile = "ToolsGuiDefaultProfile"; + profile = "ToolsGuiSolidDefaultProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; @@ -737,7 +737,7 @@ profile = "GuiEditorScrollProfile"; visible = "1"; active = "1"; - tooltipProfile = "ToolsGuiDefaultProfile"; + tooltipProfile = "ToolsGuiSolidDefaultProfile"; hovertime = "1000"; isContainer = "1"; canSave = "1"; @@ -825,7 +825,7 @@ minExtent = "8 2"; horizSizing = "width"; vertSizing = "height"; - profile = "ToolsGuiDefaultProfile"; + profile = "ToolsGuiSolidDefaultProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/main.cs b/Templates/BaseGame/game/tools/assetBrowser/main.cs index d35a3d6b6..b9ddf94ba 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/main.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/main.cs @@ -52,7 +52,7 @@ function initializeAssetBrowser() AssetFilterTypeList.add("ShapeAnimations"); AssetFilterTypeList.add("Sounds"); AssetFilterTypeList.add("StateMachines"); - AssetFilterTypeList.add("Terrains"); + AssetFilterTypeList.add("Terrain"); AssetFilterTypeList.add("TerrainMaterials"); } @@ -94,6 +94,8 @@ function initializeAssetBrowser() exec("./scripts/assetTypes/stateMachine.cs"); exec("./scripts/assetTypes/cubemap.cs"); exec("./scripts/assetTypes/folder.cs"); + exec("./scripts/assetTypes/terrain.cs"); + exec("./scripts/assetTypes/terrainMaterial.cs"); exec("./scripts/fieldTypes/fieldTypes.cs"); exec("./scripts/fieldTypes/listField.cs"); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs index 2de51f4e1..cd9c2ccd0 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs @@ -1124,28 +1124,9 @@ function AssetBrowserFilterTree::onRightMouseDown(%this, %itemId) } else { - //get the parent, and thus our module - %moduleId = %this.getParentItem(%itemId); - - //set the module value for creation info - AssetBrowser.selectedModule = %this.getItemText(%moduleId); - - if(%this.getItemText(%itemId) $= "ComponentAsset") - { - AddNewComponentAssetPopup.showPopup(Canvas); - //Canvas.popDialog(AssetBrowser_newComponentAsset); - //AssetBrowser_newComponentAsset-->AssetBrowserModuleList.setText(AssetBrowser.selectedModule); - } - else if(%this.getItemText(%itemId) $= "ScriptAsset") - { - EditAssetCategoryPopup.showPopup(Canvas); - } + EditFolderPopup.showPopup(Canvas); } } - else if( %this.getSelectedItemsCount() > 0 && %itemId == 1) - { - AddNewModulePopup.showPopup(Canvas); - } } // @@ -1254,6 +1235,9 @@ function AssetBrowser::rebuildAssetArray(%this) %assetType = AssetDatabase.getAssetType(%assetId); } + if(AssetBrowser.assetTypeFilter !$= "" && AssetBrowser.assetTypeFilter !$= %assetType) + continue; + /*if(%this.getItemText(%itemId) $= %assetType || (%assetType $= "" && %this.getItemText(%itemId) $= "Misc") || %moduleItemId == 1) {*/ diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/folder.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/folder.cs new file mode 100644 index 000000000..d6e05db29 --- /dev/null +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/folder.cs @@ -0,0 +1,95 @@ +function AssetBrowser::buildFolderPreview(%this, %assetDef, %previewData) +{ + %previewData.assetName = %assetDef.assetName; + %previewData.assetPath = %assetDef.dirPath; + + //%previewData.previewImage = "tools/assetBrowser/art/folderIcon"; + %previewData.previewImage = "tools/gui/images/folder"; + + //%previewData.assetFriendlyName = %assetDef.assetName; + %previewData.assetDesc = %assetDef.description; + %previewData.tooltip = %assetDef.dirPath; + %previewData.doubleClickCommand = "AssetBrowser.navigateTo(\""@ %assetDef.dirPath @ "/" @ %assetDef.assetName @"\")";//browseTo %assetDef.dirPath / %assetDef.assetName +} + +function AssetBrowser::renameFolder(%this, %folderPath, %newFolderName) +{ + %fullPath = makeFullPath(%folderPath); + %newFullPath = makeFullPath(%folderPath); + + %fullPath = strreplace(%fullPath, "//", "/"); + + %count = getTokenCount(%fullPath, "/"); + %basePath = getTokens(%fullPath, "/", 0, %count-2); + %oldName = getToken(%fullPath, "/", %count-1); + + //We need to ensure that no files are 'active' while we try and clean up behind ourselves with the delete action + //so, we nix any assets active for the module, do the delete action on the old folder, and then re-acquire our assets. + //This will have the added benefit of updating paths for asset items + + %module = AssetBrowser.getModuleFromAddress(AssetBrowser.currentAddress); + %moduleId = %module.ModuleId; + + AssetDatabase.removeDeclaredAssets(%moduleId); + + %copiedSuccess = pathCopy(%fullPath, %basePath @ "/" @ %newFolderName); + %this.deleteFolder(%fullPath); + + AssetDatabase.addModuleDeclaredAssets(%moduleId); +} + +function AssetBrowser::deleteFolder(%this, %folderPath) +{ + doDeleteFolder(%folderPath); + + %this.loadFilters(); +} + +function doDeleteFolder(%folderPath) +{ + %fullPath = makeFullPath(%folderPath); + + //First, wipe out any files inside the folder first + %file = findFirstFileMultiExpr( %fullPath @ "/*.*", true); + + while( %file !$= "" ) + { + %success = fileDelete( %file ); + + if(!%success) + { + error("doDeleteFolder - unable to delete file " @ %file); + return; + } + + %file = findNextFileMultiExpr( %fullPath @ "/*.*" ); + } + + //next, walk through and delete any subfolders that may be remaining + while(fileDelete(%fullPath) == 0) + { + //We couldn't delete the folder, so get a directory list and recurse through it, deleteing them as we go + %paths = getDirectoryList(%fullPath); + for(%i=0; %i < getFieldCount(%paths); %i++) + { + %childPath = getField(%paths, %i); + doDeleteFolder(%fullPath @ "/" @ %childPath); + } + } +} + +function AssetBrowser::moveFolder(%this, %folderPath, %newFolderPath) +{ + %fullPath = makeFullPath(%folderPath); + %newFullPath = makeFullPath(%newFolderPath); + + %fullPath = strreplace(%fullPath, "//", "/"); + %newFullPath = strreplace(%newFullPath, "//", "/"); + + %count = getTokenCount(%fullPath, "/"); + %basePath = getTokens(%fullPath, "/", 0, %count-2); + %oldName = getToken(%fullPath, "/", %count-1); + + %copiedSuccess = pathCopy(%fullPath, %newFullPath @ "/" @ %newFolderName); + %this.deleteFolder(%fullPath); +} \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.cs index 809c3166f..f5d2c32e6 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrain.cs @@ -1,5 +1,38 @@ function AssetBrowser::createTerrainAsset(%this) { + %moduleName = AssetBrowser.newAssetSettings.moduleName; + %modulePath = "data/" @ %moduleName; + + %assetName = AssetBrowser.newAssetSettings.assetName; + + %assetType = AssetBrowser.newAssetSettings.assetType; + %assetPath = AssetBrowser.currentAddress @ "/"; + + %tamlpath = %assetPath @ %assetName @ ".asset.taml"; + %terPath = %assetPath @ %assetName @ ".ter"; + + %asset = new TerrainAsset() + { + AssetName = %assetName; + versionId = 1; + terrainFile = %assetName @ ".ter"; + }; + + TamlWrite(%asset, %tamlpath); + + %moduleDef = ModuleDatabase.findModule(%moduleName, 1); + AssetDatabase.addDeclaredAsset(%moduleDef, %tamlpath); + + AssetBrowser.loadFilters(); + + AssetBrowserFilterTree.onSelect(%smItem); + + //Save out a basic terrain block here + %terrBlock = new TerrainBlock() { terrainFile = %terPath; }; + %terrBlock.save(%terPath); + %terrBlock.delete(); + + return %tamlpath; } function AssetBrowser::editTerrainAsset(%this, %assetDef) @@ -50,4 +83,45 @@ function GuiInspectorTypeTerrainAssetPtr::onClick( %this, %fieldName ) function GuiInspectorTypeTerrainAssetPtr::onControlDropped( %this, %payload, %position ) { +} + +//AssetDatabase.acquireAsset("pbr:NewTerrain"); +function TerrainAsset::saveAsset(%this) +{ + %matDepIdx = 0; + while(%this.getFieldValue("terrainMaterialAsset", %matDepIdx) !$= "") + { + %this.setFieldValue("terrainMaterialAsset", "", %matDepIdx); + } + + %filePath = AssetDatabase.getAssetFilePath(%this.getAssetId()); + + %mats = ETerrainEditor.getMaterials(); + + %assetQuery = new AssetQuery(); + AssetDatabase.findAssetType(%assetQuery, "TerrainMaterialAsset"); + + %count = %assetQuery.getCount(); + + %matDepIdx = 0; + for( %i = 0; %i < getRecordCount( %mats ); %i++ ) + { + %matInternalName = getRecord( %mats, %i ); + + for(%m=0; %m < %count; %m++) + { + %assetId = %assetQuery.getAsset(%m); + + %terrMatAssetDef = AssetDatabase.acquireAsset(%assetId); + + if(%terrMatAssetDef.materialDefinitionName $= %matInternalName) + { + %this.setFieldValue("terrainMaterialAsset", "@Asset=" @ %assetId, %matDepIdx); + %matDepIdx++; + } + } + } + %assetQuery.delete(); + + TAMLWrite(%this, %filePath); } \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrainMaterial.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrainMaterial.cs index d6a8488f7..5e249d59a 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrainMaterial.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/terrainMaterial.cs @@ -1,9 +1,70 @@ function AssetBrowser::createTerrainMaterialAsset(%this) { + %moduleName = AssetBrowser.newAssetSettings.moduleName; + %modulePath = "data/" @ %moduleName; + + %assetName = AssetBrowser.newAssetSettings.assetName; + + %assetType = AssetBrowser.newAssetSettings.assetType; + %assetPath = AssetBrowser.currentAddress @ "/"; + + %tamlpath = %assetPath @ %assetName @ ".asset.taml"; + %scriptPath = %assetPath @ %assetName @ ".cs"; + + %asset = new TerrainMaterialAsset() + { + AssetName = %assetName; + versionId = 1; + scriptFile = %assetName @ ".cs"; + materialDefinitionName = %assetName; + }; + + TamlWrite(%asset, %tamlpath); + + %moduleDef = ModuleDatabase.findModule(%moduleName, 1); + AssetDatabase.addDeclaredAsset(%moduleDef, %tamlpath); + + AssetBrowser.loadFilters(); + + AssetBrowserFilterTree.onSelect(%smItem); + + %file = new FileObject(); + %templateFile = new FileObject(); + + %templateFilePath = %this.templateFilesPath @ "terrainMaterial.cs.template"; + + if(%file.openForWrite(%scriptPath) && %templateFile.openForRead(%templateFilePath)) + { + while( !%templateFile.isEOF() ) + { + %line = %templateFile.readline(); + %line = strreplace( %line, "@", %assetName ); + + %file.writeline(%line); + //echo(%line); + } + + %file.close(); + %templateFile.close(); + } + else + { + %file.close(); + %templateFile.close(); + + warnf("CreateNewTerrainMaterialAsset - Something went wrong and we couldn't write thescript file!"); + } + + //If we've got the terrain mat editor open, go ahead and update it all + TerrainMaterialDlg.onWake(); + + return %tamlpath; } function AssetBrowser::editTerrainMaterialAsset(%this, %assetDef) { + TerrainMaterialDlg.show(0, 0, 0); + TerrainMaterialDlg.setActiveMaterial(%assetDef.assetName); } function AssetBrowser::duplicateTerrainMaterialAsset(%this, %assetDef, %targetModule) diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs index 31d317d38..88f2662c6 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/popupMenus.cs @@ -14,7 +14,8 @@ function AssetBrowser::buildPopupMenus(%this) AddNewModulePopup.enableItem(1, false); } - + + if( !isObject( EditAssetPopup ) ) { new PopupMenu( EditAssetPopup ) @@ -64,22 +65,6 @@ function AssetBrowser::buildPopupMenus(%this) }; } - if( !isObject( EditFolderPopup ) ) - { - new PopupMenu( EditFolderPopup ) - { - superClass = "MenuBuilder"; - class = "EditorWorldMenu"; - //isPopup = true; - - item[ 0 ] = "Rename Folder" TAB "" TAB "AssetBrowser.renameAsset();"; - item[ 1 ] = "-"; - Item[ 2 ] = "Duplicate Folder" TAB "" TAB "AssetBrowser.duplicateAsset();"; - item[ 3 ] = "-"; - item[ 4 ] = "Delete Folder" TAB "" TAB "AssetBrowser.deleteAsset();"; - }; - } - if( !isObject( AddNewComponentAssetPopup ) ) { new PopupMenu( AddNewComponentAssetPopup ) @@ -121,20 +106,23 @@ function AssetBrowser::buildPopupMenus(%this) //isPopup = true; item[ 0 ] = "Create Material" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"MaterialAsset\", AssetBrowser.selectedModule);";//"createNewMaterialAsset(\"NewMaterial\", AssetBrowser.selectedModule);"; - item[ 1 ] = "Create Image" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ImageAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewImageAsset(\"NewImage\", AssetBrowser.selectedModule);"; - item[ 2 ] = "-"; - item[ 3 ] = "Create Shape" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"Shape\", AssetBrowser.selectedModule);"; - item[ 4 ] = "Create Shape Animation" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ShapeAnimationAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewShapeAnimationAsset(\"NewShapeAnimation\", AssetBrowser.selectedModule);"; - item[ 5 ] = "-"; - item[ 6 ] = "Create GUI" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"GUIAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewGUIAsset(\"NewGUI\", AssetBrowser.selectedModule);"; - item[ 7 ] = "-"; - item[ 8 ] = "Create Post Effect" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"PostEffectAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewPostEffectAsset(\"NewPostEffect\", AssetBrowser.selectedModule);"; - item[ 9 ] = "-"; - item[ 10 ] = "Create Sound" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"SoundAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewSoundAsset(\"NewSound\", AssetBrowser.selectedModule);"; - item[ 11 ] = "-"; - item[ 12 ] = "Create Particle Effect" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ParticleEffectAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewParticleEffectAsset(\"NewParticleEffect\", AssetBrowser.selectedModule);"; - item[ 13 ] = "-"; - item[ 14 ] = "Create Cubemap" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"CubemapAsset\", AssetBrowser.selectedModule);"; + item[ 1 ] = "Create Terrain Material" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"TerrainMaterialAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewImageAsset(\"NewImage\", AssetBrowser.selectedModule);"; + item[ 2 ] = "Create Image" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ImageAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewImageAsset(\"NewImage\", AssetBrowser.selectedModule);"; + item[ 3 ] = "-"; + item[ 4 ] = "Create Terrain Data" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"TerrainAsset\", AssetBrowser.selectedModule);"; + item[ 5 ] = "-"; + item[ 6 ] = "Create Shape" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"Shape\", AssetBrowser.selectedModule);"; + item[ 7 ] = "Create Shape Animation" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ShapeAnimationAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewShapeAnimationAsset(\"NewShapeAnimation\", AssetBrowser.selectedModule);"; + item[ 8 ] = "-"; + item[ 9 ] = "Create GUI" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"GUIAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewGUIAsset(\"NewGUI\", AssetBrowser.selectedModule);"; + item[ 10 ] = "-"; + item[ 11 ] = "Create Post Effect" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"PostEffectAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewPostEffectAsset(\"NewPostEffect\", AssetBrowser.selectedModule);"; + item[ 12 ] = "-"; + item[ 13 ] = "Create Sound" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"SoundAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewSoundAsset(\"NewSound\", AssetBrowser.selectedModule);"; + item[ 14 ] = "-"; + item[ 15 ] = "Create Particle Effect" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"ParticleEffectAsset\", AssetBrowser.selectedModule);";//"AssetBrowser.createNewParticleEffectAsset(\"NewParticleEffect\", AssetBrowser.selectedModule);"; + item[ 16 ] = "-"; + item[ 17 ] = "Create Cubemap" TAB "" TAB "AssetBrowser.setupCreateNewAsset(\"CubemapAsset\", AssetBrowser.selectedModule);"; }; } @@ -199,10 +187,27 @@ function AssetBrowser::buildPopupMenus(%this) } //Some assets are not yet ready/implemented, so disable their creation here - AddNewArtAssetPopup.enableItem(3, false); //shape - AddNewArtAssetPopup.enableItem(4, false); //shape animation - AddNewArtAssetPopup.enableItem(10, false); //sound asset - AddNewArtAssetPopup.enableItem(12, false); //particle effect + AddNewArtAssetPopup.enableItem(6, false); //shape + AddNewArtAssetPopup.enableItem(7, false); //shape animation + AddNewArtAssetPopup.enableItem(13, false); //sound asset + AddNewArtAssetPopup.enableItem(15, false); //particle effect + + if( !isObject( EditFolderPopup ) ) + { + new PopupMenu( EditFolderPopup ) + { + superClass = "MenuBuilder"; + class = "EditorWorldMenu"; + //isPopup = true; + + Item[ 0 ] = "Create in Folder" TAB AddNewAssetPopup; + item[ 1 ] = "-"; + item[ 2 ] = "Rename Folder" TAB "" TAB "AssetBrowser.renameAsset();"; + Item[ 3 ] = "Duplicate Folder" TAB "" TAB "AssetBrowser.duplicateAsset();"; + item[ 4 ] = "-"; + item[ 5 ] = "Delete Folder" TAB "" TAB "AssetBrowser.deleteAsset();"; + }; + } if( !isObject( EditAssetCategoryPopup ) ) { diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/terrainMaterial.cs.template b/Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/terrainMaterial.cs.template new file mode 100644 index 000000000..ef614edaf --- /dev/null +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/terrainMaterial.cs.template @@ -0,0 +1,24 @@ +singleton Material(TerrainFX_@) +{ + mapTo = "@"; + footstepSoundId = 0; + terrainMaterials = "1"; + ShowDust = "1"; + showFootprints = "1"; + materialTag0 = "Terrain"; + effectColor[0] = "0.42 0.42 0 1"; + effectColor[1] = "0.42 0.42 0 1"; + impactSoundId = "0"; +}; + +new TerrainMaterial(@) +{ + internalName = "@"; + diffuseMap = ""; + detailMap = ""; + detailSize = "10"; + isManaged = "1"; + detailBrightness = "1"; + Enabled = "1"; + diffuseSize = "200"; +}; \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/gui/EditorLoadingGui.gui b/Templates/BaseGame/game/tools/gui/EditorLoadingGui.gui index a7b497108..8b627a1d8 100644 --- a/Templates/BaseGame/game/tools/gui/EditorLoadingGui.gui +++ b/Templates/BaseGame/game/tools/gui/EditorLoadingGui.gui @@ -20,7 +20,7 @@ minExtent = "8 2"; horizSizing = "center"; vertSizing = "center"; - profile = "ToolsGuiDefaultProfile"; + profile = "ToolsGuiSolidDefaultProfile"; visible = "1"; active = "1"; tooltipProfile = "ToolsGuiToolTipProfile"; diff --git a/Templates/BaseGame/game/tools/gui/images/folderDown.png b/Templates/BaseGame/game/tools/gui/images/folderDown.png new file mode 100644 index 000000000..b2dcbed2d Binary files /dev/null and b/Templates/BaseGame/game/tools/gui/images/folderDown.png differ diff --git a/Templates/BaseGame/game/tools/gui/images/rightArrowWhite.png b/Templates/BaseGame/game/tools/gui/images/rightArrowWhite.png new file mode 100644 index 000000000..16c0a1e6a Binary files /dev/null and b/Templates/BaseGame/game/tools/gui/images/rightArrowWhite.png differ diff --git a/Templates/BaseGame/game/tools/gui/profiles.ed.cs b/Templates/BaseGame/game/tools/gui/profiles.ed.cs index b14de3db0..313f0a70d 100644 --- a/Templates/BaseGame/game/tools/gui/profiles.ed.cs +++ b/Templates/BaseGame/game/tools/gui/profiles.ed.cs @@ -37,7 +37,7 @@ new GuiControlProfile (ToolsGuiDefaultProfile) mouseOverSelected = false; // fill color - opaque = true; + opaque = false; fillColor = EditorSettings.value("Theme/tabsColor"); fillColorHL = EditorSettings.value("Theme/tabsGLColor"); fillColorSEL = EditorSettings.value("Theme/tabsSELColor"); @@ -79,7 +79,7 @@ new GuiControlProfile (ToolsGuiDefaultProfile) }; if( !isObject( ToolsGuiSolidDefaultProfile ) ) -new GuiControlProfile (ToolsGuiSolidDefaultProfile) +new GuiControlProfile (ToolsGuiSolidDefaultProfile : ToolsGuiDefaultProfile) { opaque = true; border = true; @@ -1123,6 +1123,8 @@ singleton GuiControlProfile( ToolsMenubarProfile : ToolsGuiDefaultProfile ) bitmap = "./menubar"; category = "Editor"; + opaque = true; + fillColor = EditorSettings.value("Theme/headerColor"); fontColor = EditorSettings.value("Theme/headerTextColor"); fontColorHL = EditorSettings.value("Theme/fieldTextHLColor"); diff --git a/Templates/BaseGame/game/tools/settings.xml b/Templates/BaseGame/game/tools/settings.xml index 73307a503..fd6ac7bb7 100644 --- a/Templates/BaseGame/game/tools/settings.xml +++ b/Templates/BaseGame/game/tools/settings.xml @@ -2,212 +2,202 @@ 255 0 0 255 + 0 255 0 255 + DefaultRoadMaterialOther 10 DefaultRoadMaterialTop 0 0 1 - DefaultRoadMaterialOther - 0 255 0 255 + + + lowerHeight + + 50 + 1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000 + 100 + 1 + 1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000 + 90 + 0 + 0.1 + 1 + 10 + + + 40 40 + 40 40 + 1 + 1 + ellipse + - 72 70 68 255 - 59 58 57 255 - 255 255 255 255 - 43 43 43 255 17 16 15 255 - 37 36 35 255 - 32 31 30 255 - 50 49 48 255 - 255 255 255 255 - 236 234 232 255 + 234 232 230 255 178 175 172 255 + 255 255 255 255 72 70 68 255 50 49 48 255 - 100 98 96 255 + 43 43 43 255 + 32 31 30 255 59 58 57 255 - 96 94 92 255 - 234 232 230 255 - 77 77 77 255 + 100 98 96 255 + 37 36 35 255 50 49 48 255 - - - 1 - 1 - 0 0 0 100 - 1 - 0 - 255 255 255 255 - 135 - 180 180 180 255 - 1 - 1 - 1 - 40 40 - 0 - 45 - 0.1 + 50 49 48 255 + 77 77 77 255 + 255 255 255 255 + 236 234 232 255 + 72 70 68 255 + 59 58 57 255 + 96 94 92 255 - tools/gui + tools/worldEditor/gui 1024 768 - - 0 - 0 - 0 + + Categorized + + + 1 + 1 + 2 + 0 + 8 + 1 + 1 + 1 + + + 1 + 1 + + + http://www.garagegames.com/products/torque-3d/documentation/user + ../../../Documentation/Torque 3D - Script Manual.chm + ../../../Documentation/Official Documentation.html 0 - - 1 - 2 - 1 - 8 - 1 - 1 - 0 - 1 - - - http://www.garagegames.com/products/torque-3d/documentation/user - ../../../Documentation/Official Documentation.html - ../../../Documentation/Torque 3D - Script Manual.chm - - - 1 - 1 - - - Categorized + + 0 + 0 + 0 - - 0.8 - 0.8 - 0 - 15 - 0 - 1 - 100 - - 0 - 1 - 0 - 1 1 1 - 255 255 255 20 - 500 - + + 135 + 40 40 + 0.1 + 1 + 1 + 1 + 1 + 255 255 255 255 + 45 + 1 + 0 0 0 100 + 1 + 0 + 0 + 180 180 180 255 - AssetWork_Debug.exe - 40 - screenCenter - 6 0 + AssetWork_Debug.exe 50 + 40 Modern + screenCenter 1 - WorldEditorInspectorPlugin - - 51 51 51 100 - 102 102 102 100 - 1 - 255 255 255 100 - 1 - - - 1 - 1 - 1 - 1 - 1 - - - 8 - 255 - 20 - 0 - 1 - - - 255 255 0 255 - 255 255 0 255 - 0 0 255 255 - 255 0 0 255 - 255 255 255 255 - 100 100 100 255 - 0 255 0 255 - - - 255 255 255 255 - 215 215 215 255 - 48 48 48 255 - 180 180 180 255 - 50 50 50 255 - - - 0 - 2 - 0 - 1 - 100 - 0 - 1 + 6 + TerrainPainterPlugin + + tools/worldEditor/images/SelectHandle + tools/worldEditor/images/LockedHandle + tools/worldEditor/images/DefaultHandle http://www.garagegames.com/products/torque-3d/documentation/user http://www.garagegames.com/products/torque-3d/forums - ../../../Documentation/Torque 3D - Script Manual.chm ../../../Documentation/Official Documentation.html + ../../../Documentation/Torque 3D - Script Manual.chm - - tools/worldEditor/images/DefaultHandle - tools/worldEditor/images/LockedHandle - tools/worldEditor/images/SelectHandle + + 215 215 215 255 + 255 255 255 255 + 50 50 50 255 + 48 48 48 255 + 180 180 180 255 + + + 102 102 102 100 + 255 255 255 100 + 51 51 51 100 + 1 + 1 + + + 1 + 8 + 20 + 0 + 255 + + + 1 + 0 + 0.01 + 1 + 0 + 100 + 0 + 0 + 2 + + + 1 + 1 + 1 + 1 + 1 + + + 0 0 255 255 + 255 0 0 255 + 0 255 0 255 + 255 255 0 255 + 255 255 255 255 + 255 255 0 255 + 100 100 100 255 Classic - <AssetType>/<SpecialAssetTag>/ - 1 - <AssetType>/ - <AssetType>/OtherFolder/ - <AssetType>/ + <AssetType>/ <AssetType>/<AssetName>/ TestConfig - <AssetType>/ - <AssetType>/ <AssetType>/ <AssetType>/<SpecialAssetTag>/ + <AssetType>/ + <AssetType>/ + <AssetType>/<SpecialAssetTag>/ + 1 + <AssetType>/ + <AssetType>/OtherFolder/ - - lowerHeight - - 1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000 - 1 - 90 - 50 - 0 - 1.000000 0.833333 0.666667 0.500000 0.333333 0.166667 0.000000 - 0.1 - 10 - 100 - 1 + + data/FPSGameplay/levels + + + 25 + + + 5 + - - 1 - ellipse - 40 40 - 40 40 - 1 - - - - 0 255 0 255 - 255 255 255 255 - DefaultDecalRoadMaterial - 10 TestConfig @@ -217,32 +207,44 @@ - DefaultPlayerData 1 + DefaultPlayerData AIPlayer + 0 0 1 255 0 0 255 10 - 0 0 1 - 0 255 0 255 - 255 255 255 255 5 + 255 255 255 255 + 0 255 0 255 - - data/FPSGameplay/levels - - - 5 - - - 25 - + + 15 + 0.8 + 0 + 0.8 + 1 + 0 + 100 + + 1 1 1 + 500 + 255 255 255 20 + 0 + 1 + 0 Small + + DefaultDecalRoadMaterial + 10 + 0 255 0 255 + 255 255 255 255 + Grid_512_Orange diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/guiCreateNewTerrainGui.gui b/Templates/BaseGame/game/tools/worldEditor/gui/guiCreateNewTerrainGui.gui index 23d65e24a..943e85185 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/guiCreateNewTerrainGui.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/guiCreateNewTerrainGui.gui @@ -299,6 +299,20 @@ function CreateNewTerrainGui::onWake( %this ) { %this-->theName.setText( "" ); + + //Run through and grab any TerrainMaterialAssets + %assetQuery = new AssetQuery(); + AssetDatabase.findAssetType(%assetQuery, "TerrainMaterialAsset"); + + %count = %assetQuery.getCount(); + + for(%i=0; %i < %count; %i++) + { + %assetId = %assetQuery.getAsset(%i); + + AssetDatabase.acquireAsset(%assetId); + } + %assetQuery.delete(); %matList = %this-->theMaterialList; %matList.clear(); @@ -313,8 +327,8 @@ function CreateNewTerrainGui::onWake( %this ) %rezList.add( "512", 512 ); %rezList.add( "1024", 1024 ); %rezList.add( "2048", 2048 ); - //%rezList.add( "4096", 4096 ); - %rezList.setSelected( 256 ); + %rezList.add( "4096", 4096 ); + %rezList.setSelected( 512 ); %this-->flatRadio.setStateOn( true ); } diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainMaterialDlg.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainMaterialDlg.ed.gui index 09a90ef26..5c39cbbf5 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainMaterialDlg.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/guiTerrainMaterialDlg.ed.gui @@ -1,632 +1,495 @@ //--- OBJECT WRITE BEGIN --- -%guiContent = new GuiControl(TerrainMaterialDlg, EditorGuiGroup) { - canSaveDynamicFields = "0"; - isContainer = "1"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; +%guiContent = new GuiControl(TerrainMaterialDlg,EditorGuiGroup) { position = "0 0"; - Extent = "800 768"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; + extent = "1024 768"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "1"; new GuiWindowCtrl() { - canSaveDynamicFields = "0"; - isContainer = "1"; - Profile = "ToolsGuiWindowProfile"; - HorizSizing = "center"; - VertSizing = "center"; - position = "221 151"; - Extent = "394 432"; - MinExtent = "358 432"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Docking = "None"; - Margin = "4 4 4 4"; - Padding = "0 0 0 0"; - AnchorTop = "0"; - AnchorBottom = "0"; - AnchorLeft = "0"; - AnchorRight = "0"; + text = "Terrain Materials Editor"; resizeWidth = "1"; resizeHeight = "1"; canMove = "1"; canClose = "1"; canMinimize = "0"; canMaximize = "0"; - minSize = "50 50"; + canCollapse = "0"; closeCommand = "TerrainMaterialDlg.dialogCancel();"; - EdgeSnap = "0"; - text = "Terrain Materials Editor"; - new GuiContainer(){ //Node Properties + edgeSnap = "0"; + docking = "None"; + margin = "4 4 4 4"; + padding = "0 0 0 0"; + anchorTop = "0"; + anchorBottom = "0"; + anchorLeft = "0"; + anchorRight = "0"; + position = "315 168"; + extent = "394 494"; + minExtent = "358 432"; + horizSizing = "center"; + vertSizing = "center"; + profile = "ToolsGuiWindowProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiContainer() { + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "6 25"; + extent = "189 64"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "inspectorStyleRolloutDarkProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; isContainer = "1"; - Profile = "inspectorStyleRolloutDarkProfile"; - HorizSizing = "width"; - VertSizing = "bottom"; - Position = "6 25"; - Extent = "189 64"; - - new GuiTextCtrl(){ - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - Position = "5 0"; - Extent = "91 18"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiTextCtrl() { text = "Terrain Materials"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "5 0"; + extent = "91 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiBitmapButtonCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiButtonProfile"; - HorizSizing = "left"; - VertSizing = "top"; - position = "160 2"; - Extent = "15 15"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "TerrainMaterialDlg.newMat();"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; bitmap = "tools/gui/images/new"; - }; - new GuiBitmapButtonCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiButtonProfile"; - HorizSizing = "left"; - VertSizing = "top"; - position = "173 2"; - Extent = "15 15"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "TerrainMaterialDlg.deleteMat();"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; + bitmapMode = "Stretched"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; + position = "160 2"; + extent = "15 15"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "top"; + profile = "ToolsGuiButtonProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg.newMat();"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiBitmapButtonCtrl() { bitmap = "tools/gui/images/delete"; + bitmapMode = "Stretched"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "173 2"; + extent = "15 15"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "top"; + profile = "ToolsGuiButtonProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg.deleteMat();"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; }; }; new GuiContainer() { - canSaveDynamicFields = "0"; - internalName = "matSettingsParent"; - isContainer = "1"; - Profile = "inspectorStyleRolloutProfile"; - HorizSizing = "left"; - VertSizing = "height"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; position = "202 26"; - Extent = "185 363"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; + extent = "185 425"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "height"; + profile = "inspectorStyleRolloutProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; + isContainer = "1"; + internalName = "matSettingsParent"; + canSave = "1"; + canSaveDynamicFields = "0"; new GuiBitmapCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "width"; - VertSizing = "bottom"; - position = "1 0"; - Extent = "183 2"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; bitmap = "core/art/gui/images/separator-v"; + color = "255 255 255 255"; wrap = "0"; + position = "1 0"; + extent = "183 2"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiTextCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "8 22"; - Extent = "44 17"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiDefaultProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; text = "Name"; maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "8 22"; + extent = "44 17"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiDefaultProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiTextEditCtrl() { - internalName = "matNameCtrl"; - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextEditProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "39 21"; - Extent = "143 18"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; - maxLength = "1024"; historySize = "0"; - password = "0"; tabComplete = "0"; sinkAllKeyEvents = "0"; + password = "0"; passwordMask = "*"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "39 21"; + extent = "143 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextEditProfile"; + visible = "1"; + active = "1"; altCommand = "TerrainMaterialDlg.setMaterialName( $ThisControl.getText() );"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "matNameCtrl"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiTextCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiInspectorTitleTextProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "8 0"; - Extent = "117 16"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; text = "Material Properties"; maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "8 0"; + extent = "117 16"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiInspectorTitleTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiContainer() { - canSaveDynamicFields = "0"; - isContainer = "1"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "width"; - VertSizing = "bottom"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; position = "6 43"; - Extent = "185 75"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; + extent = "185 75"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; new GuiCheckBoxCtrl() { - internalName = "sideProjectionCtrl"; - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiCheckBoxProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "55 54"; - Extent = "119 16"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; text = " Use Side Projection"; groupNum = "-1"; buttonType = "ToggleButton"; useMouseEvents = "0"; - useInactiveState = "0"; + position = "55 54"; + extent = "119 16"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiCheckBoxProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "sideProjectionCtrl"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiBitmapCtrl() { - internalName = "baseTexCtrl"; - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "1 1"; - Extent = "47 47"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; bitmap = "tools/materialEditor/gui/unknownImage"; + color = "255 255 255 255"; wrap = "0"; + position = "1 1"; + extent = "47 47"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "baseTexCtrl"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiBitmapButtonCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "1 1"; - Extent = "48 48"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "TerrainMaterialDlg.changeBase();"; - tooltipprofile = "ToolsGuiDefaultProfile"; - ToolTip = "Change the Active Diffuse Map for this layer"; - hovertime = "1000"; + bitmap = "tools/materialEditor/gui/cubemapBtnBorder"; + bitmapMode = "Stretched"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; - bitmap = "tools/materialEditor/gui/cubemapBtnBorder"; + position = "1 1"; + extent = "48 48"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg.changeBase();"; + tooltipProfile = "ToolsGuiDefaultProfile"; + tooltip = "Change the Active Diffuse Map for this layer"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiTextCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "EditorTextProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "56 -3"; - Extent = "39 18"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; text = "Diffuse"; maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "56 -3"; + extent = "39 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "EditorTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiTextCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextProfile"; - HorizSizing = "width"; - VertSizing = "bottom"; - position = "56 16"; - Extent = "116 17"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; text = "None"; maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "56 16"; + extent = "116 17"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiButtonCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiButtonProfile"; - HorizSizing = "left"; - VertSizing = "bottom"; - position = "116 0"; - Extent = "40 16"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "TerrainMaterialDlg.changeBase();"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; text = "Edit"; groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; + position = "116 0"; + extent = "40 16"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "ToolsGuiButtonProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg.changeBase();"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiBitmapButtonCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "left"; - VertSizing = "bottom"; - position = "159 0"; - Extent = "16 16"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "TerrainMaterialDlg-->baseTexCtrl.setBitmap(\"tools/materialEditor/gui/unknownImage\");"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; + bitmap = "tools/gui/images/delete"; + bitmapMode = "Stretched"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; - bitmap = "tools/gui/images/delete"; + position = "159 0"; + extent = "16 16"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg-->baseTexCtrl.setBitmap(\"tools/materialEditor/gui/unknownImage\");"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiTextCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "132 35"; - Extent = "39 16"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "0"; - AnchorBottom = "0"; - AnchorLeft = "0"; - AnchorRight = "0"; text = "Size"; maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "0"; + anchorBottom = "0"; + anchorLeft = "0"; + anchorRight = "0"; + position = "132 35"; + extent = "39 16"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiTextEditCtrl() { - internalName = "baseSizeCtrl"; - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextEditProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; + historySize = "0"; + tabComplete = "0"; + sinkAllKeyEvents = "0"; + password = "0"; + passwordMask = "*"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "0"; + anchorBottom = "0"; + anchorLeft = "0"; + anchorRight = "0"; position = "94 34"; - Extent = "34 18"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; + extent = "34 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextEditProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "0"; - AnchorBottom = "0"; - AnchorLeft = "0"; - AnchorRight = "0"; - maxLength = "1024"; - historySize = "0"; - password = "0"; - tabComplete = "0"; - sinkAllKeyEvents = "0"; - passwordMask = "*"; + isContainer = "0"; + internalName = "baseSizeCtrl"; + canSave = "1"; + canSaveDynamicFields = "0"; }; }; new GuiBitmapCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "width"; - VertSizing = "bottom"; + bitmap = "tools/gui/images/separator-v"; + color = "255 255 255 255"; + wrap = "0"; position = "6 116"; - Extent = "175 2"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - bitmap = "tools/gui/images/separator-v"; - wrap = "0"; - }; - new GuiContainer() { - canSaveDynamicFields = "0"; - isContainer = "1"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "width"; - VertSizing = "bottom"; - position = "6 295"; - Extent = "185 50"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; - - new GuiBitmapCtrl() { - internalName = "normTexCtrl"; - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "1 1"; - Extent = "47 47"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - bitmap = "tools/materialEditor/gui/unknownImage"; - wrap = "0"; - }; - new GuiTextCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "EditorTextProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "56 -3"; - Extent = "39 18"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; - text = "Normal"; - maxLength = "1024"; - }; - new GuiBitmapButtonCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "1 1"; - Extent = "48 48"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "TerrainMaterialDlg.changeNormal();"; - tooltipprofile = "ToolsGuiDefaultProfile"; - ToolTip = "Change the active Normal Map for this layer."; - hovertime = "1000"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - bitmap = "tools/materialEditor/gui/cubemapBtnBorder"; - }; - new GuiTextCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextProfile"; - HorizSizing = "width"; - VertSizing = "bottom"; - position = "56 15"; - Extent = "116 17"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; - text = "None"; - maxLength = "1024"; - }; - new GuiButtonCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiButtonProfile"; - HorizSizing = "left"; - VertSizing = "bottom"; - position = "116 0"; - Extent = "40 16"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "TerrainMaterialDlg.changeNormal();"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - text = "Edit"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - }; - new GuiBitmapButtonCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "left"; - VertSizing = "bottom"; - position = "159 0"; - Extent = "16 16"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "TerrainMaterialDlg-->normTexCtrl.setBitmap(\"tools/materialEditor/gui/unknownImage\");"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - bitmap = "tools/gui/images/delete"; - }; - new GuiTextCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "92 34"; - Extent = "77 16"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; - text = "Parallax Scale"; - maxLength = "1024"; - }; - new GuiTextEditCtrl() { - internalName = "parallaxScaleCtrl"; - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextEditProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "55 33"; - Extent = "34 18"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "0"; - AnchorBottom = "0"; - AnchorLeft = "0"; - AnchorRight = "0"; - text = "0.00"; - maxLength = "1024"; - historySize = "0"; - password = "0"; - tabComplete = "0"; - sinkAllKeyEvents = "0"; - passwordMask = "*"; - }; - }; - - new GuiBitmapCtrl() { - bitmap = "tools/gui/images/separator-v"; - wrap = "0"; - position = "6 288"; extent = "175 2"; minExtent = "8 2"; horizSizing = "width"; @@ -648,6 +511,410 @@ anchorLeft = "1"; anchorRight = "0"; position = "6 122"; + extent = "185 50"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiBitmapCtrl() { + bitmap = "tools/materialEditor/gui/unknownImage"; + color = "255 255 255 255"; + wrap = "0"; + position = "1 1"; + extent = "47 47"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "normTexCtrl"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Normal"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "56 -3"; + extent = "39 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "EditorTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiBitmapButtonCtrl() { + bitmap = "tools/materialEditor/gui/cubemapBtnBorder"; + bitmapMode = "Stretched"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "1 1"; + extent = "48 48"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg.changeNormal();"; + tooltipProfile = "ToolsGuiDefaultProfile"; + tooltip = "Change the active Normal Map for this layer."; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "None"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "56 15"; + extent = "116 17"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl() { + text = "Edit"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "116 0"; + extent = "40 16"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "ToolsGuiButtonProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg.changeNormal();"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiBitmapButtonCtrl() { + bitmap = "tools/gui/images/delete"; + bitmapMode = "Stretched"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "159 0"; + extent = "16 16"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg-->normTexCtrl.setBitmap(\"tools/materialEditor/gui/unknownImage\");"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Parallax Scale"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "92 34"; + extent = "77 16"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextEditCtrl() { + historySize = "0"; + tabComplete = "0"; + sinkAllKeyEvents = "0"; + password = "0"; + passwordMask = "*"; + text = "0.00"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "0"; + anchorBottom = "0"; + anchorLeft = "0"; + anchorRight = "0"; + position = "55 33"; + extent = "34 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextEditProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "parallaxScaleCtrl"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; + new GuiBitmapCtrl() { + bitmap = "tools/gui/images/separator-v"; + color = "255 255 255 255"; + wrap = "0"; + position = "6 177"; + extent = "175 2"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiContainer() { + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "6 184"; + extent = "185 50"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiBitmapCtrl() { + bitmap = "tools/materialEditor/gui/unknownImage"; + color = "255 255 255 255"; + wrap = "0"; + position = "1 1"; + extent = "47 47"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "pbrConfigTexCtrl"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "PBR Config"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "56 -3"; + extent = "60 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "EditorTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiBitmapButtonCtrl() { + bitmap = "tools/materialEditor/gui/cubemapBtnBorder"; + bitmapMode = "Stretched"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "1 1"; + extent = "48 48"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg.changePBRConfig();"; + tooltipProfile = "ToolsGuiDefaultProfile"; + tooltip = "Change the active PBR Config Map for this layer."; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "None"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "56 15"; + extent = "116 17"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl() { + text = "Edit"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "116 0"; + extent = "40 16"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "ToolsGuiButtonProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg.changePBRConfig();"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiBitmapButtonCtrl() { + bitmap = "tools/gui/images/delete"; + bitmapMode = "Stretched"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "159 0"; + extent = "16 16"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg-->pbrConfigTexCtrl.setBitmap(\"tools/materialEditor/gui/unknownImage\");"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; + new GuiBitmapCtrl() { + bitmap = "tools/gui/images/separator-v"; + color = "255 255 255 255"; + wrap = "0"; + position = "6 238"; + extent = "175 2"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiContainer() { + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "6 245"; extent = "185 72"; minExtent = "8 2"; horizSizing = "width"; @@ -663,6 +930,336 @@ new GuiBitmapCtrl() { bitmap = "tools/materialEditor/gui/unknownImage"; + color = "255 255 255 255"; + wrap = "0"; + position = "1 1"; + extent = "47 47"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "detailTexCtrl"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiBitmapButtonCtrl() { + bitmap = "tools/materialEditor/gui/cubemapBtnBorder"; + bitmapMode = "Stretched"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "1 1"; + extent = "48 48"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg.changeDetail();"; + tooltipProfile = "ToolsGuiDefaultProfile"; + tooltip = "Change the active Detail Map for this layer."; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Detail"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "56 -3"; + extent = "30 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "EditorTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "None"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "56 16"; + extent = "116 17"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl() { + text = "Edit"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "116 0"; + extent = "40 16"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "ToolsGuiButtonProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg.changeDetail();"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiBitmapButtonCtrl() { + bitmap = "tools/gui/images/delete"; + bitmapMode = "Stretched"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "159 0"; + extent = "16 16"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg-->detailTexCtrl.setBitmap(\"tools/materialEditor/gui/unknownImage\");"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Size"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "0"; + anchorBottom = "0"; + anchorLeft = "0"; + anchorRight = "0"; + position = "132 33"; + extent = "39 16"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextEditCtrl() { + historySize = "0"; + tabComplete = "0"; + sinkAllKeyEvents = "0"; + password = "0"; + passwordMask = "*"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "0"; + anchorBottom = "0"; + anchorLeft = "0"; + anchorRight = "0"; + position = "94 32"; + extent = "34 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextEditProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "detSizeCtrl"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Strength"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "0"; + anchorBottom = "0"; + anchorLeft = "0"; + anchorRight = "0"; + position = "39 54"; + extent = "46 16"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextEditCtrl() { + historySize = "0"; + tabComplete = "0"; + sinkAllKeyEvents = "0"; + password = "0"; + passwordMask = "*"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "0"; + anchorBottom = "0"; + anchorLeft = "0"; + anchorRight = "0"; + position = "1 53"; + extent = "34 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextEditProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "detStrengthCtrl"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Distance"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "0"; + anchorBottom = "0"; + anchorLeft = "0"; + anchorRight = "0"; + position = "132 54"; + extent = "45 16"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextEditCtrl() { + historySize = "0"; + tabComplete = "0"; + sinkAllKeyEvents = "0"; + password = "0"; + passwordMask = "*"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "0"; + anchorBottom = "0"; + anchorLeft = "0"; + anchorRight = "0"; + position = "94 53"; + extent = "34 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTextEditProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "detDistanceCtrl"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; + new GuiBitmapCtrl() { + bitmap = "tools/gui/images/separator-v"; + color = "255 255 255 255"; + wrap = "0"; + position = "6 320"; + extent = "175 2"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiContainer() { + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "6 327"; + extent = "185 72"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiBitmapCtrl() { + bitmap = "tools/materialEditor/gui/unknownImage"; + color = "255 255 255 255"; wrap = "0"; position = "1 1"; extent = "47 47"; @@ -685,6 +1282,7 @@ autoFitExtents = "0"; useModifiers = "0"; useStates = "1"; + masked = "0"; groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; @@ -776,6 +1374,7 @@ autoFitExtents = "0"; useModifiers = "0"; useStates = "1"; + masked = "0"; groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; @@ -948,443 +1547,174 @@ canSaveDynamicFields = "0"; }; }; - - new GuiBitmapCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "width"; - VertSizing = "bottom"; - position = "6 200"; - Extent = "175 2"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - bitmap = "tools/gui/images/separator-v"; - wrap = "0"; - }; - new GuiContainer() { - canSaveDynamicFields = "0"; - isContainer = "1"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "width"; - VertSizing = "bottom"; - position = "6 206"; - Extent = "185 72"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; - - new GuiBitmapCtrl() { - internalName = "detailTexCtrl"; - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "1 1"; - Extent = "47 47"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - bitmap = "tools/materialEditor/gui/unknownImage"; - wrap = "0"; - }; - new GuiBitmapButtonCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "1 1"; - Extent = "48 48"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "TerrainMaterialDlg.changeDetail();"; - tooltipprofile = "ToolsGuiDefaultProfile"; - ToolTip = "Change the active Detail Map for this layer."; - hovertime = "1000"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - bitmap = "tools/materialEditor/gui/cubemapBtnBorder"; - }; - new GuiTextCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "EditorTextProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "56 -3"; - Extent = "30 18"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; - text = "Detail"; - maxLength = "1024"; - }; - new GuiTextCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextProfile"; - HorizSizing = "width"; - VertSizing = "bottom"; - position = "56 16"; - Extent = "116 17"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; - text = "None"; - maxLength = "1024"; - }; - new GuiButtonCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiButtonProfile"; - HorizSizing = "left"; - VertSizing = "bottom"; - position = "116 0"; - Extent = "40 16"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "TerrainMaterialDlg.changeDetail();"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - text = "Edit"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - }; - new GuiBitmapButtonCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "left"; - VertSizing = "bottom"; - position = "159 0"; - Extent = "16 16"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "TerrainMaterialDlg-->detailTexCtrl.setBitmap(\"tools/materialEditor/gui/unknownImage\");"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - groupNum = "-1"; - buttonType = "PushButton"; - useMouseEvents = "0"; - bitmap = "tools/gui/images/delete"; - }; - new GuiTextCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "132 33"; - Extent = "39 16"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "0"; - AnchorBottom = "0"; - AnchorLeft = "0"; - AnchorRight = "0"; - text = "Size"; - maxLength = "1024"; - }; - new GuiTextEditCtrl() { - internalName = "detSizeCtrl"; - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextEditProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "94 32"; - Extent = "34 18"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "0"; - AnchorBottom = "0"; - AnchorLeft = "0"; - AnchorRight = "0"; - maxLength = "1024"; - historySize = "0"; - password = "0"; - tabComplete = "0"; - sinkAllKeyEvents = "0"; - passwordMask = "*"; - }; - new GuiTextCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "39 54"; - Extent = "46 16"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "0"; - AnchorBottom = "0"; - AnchorLeft = "0"; - AnchorRight = "0"; - text = "Strength"; - maxLength = "1024"; - }; - new GuiTextEditCtrl() { - internalName = "detStrengthCtrl"; - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextEditProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "1 53"; - Extent = "34 18"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "0"; - AnchorBottom = "0"; - AnchorLeft = "0"; - AnchorRight = "0"; - maxLength = "1024"; - historySize = "0"; - password = "0"; - tabComplete = "0"; - sinkAllKeyEvents = "0"; - passwordMask = "*"; - }; - new GuiTextCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "132 54"; - Extent = "45 16"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "0"; - AnchorBottom = "0"; - AnchorLeft = "0"; - AnchorRight = "0"; - text = "Distance"; - maxLength = "1024"; - }; - new GuiTextEditCtrl() { - internalName = "detDistanceCtrl"; - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiTextEditProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "94 53"; - Extent = "34 18"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "0"; - AnchorBottom = "0"; - AnchorLeft = "0"; - AnchorRight = "0"; - maxLength = "1024"; - historySize = "0"; - password = "0"; - tabComplete = "0"; - sinkAllKeyEvents = "0"; - passwordMask = "*"; - }; - }; }; new GuiControl() { - canSaveDynamicFields = "0"; - isContainer = "1"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "width"; - VertSizing = "height"; position = "6 42"; - Extent = "189 373"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; + extent = "189 435"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "height"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; new GuiScrollCtrl() { - canSaveDynamicFields = "0"; - isContainer = "1"; - Profile = "ToolsGuiScrollProfile"; - HorizSizing = "width"; - VertSizing = "height"; - position = "0 0"; - Extent = "189 374"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; - Margin = "0 0 0 0"; - Padding = "0 0 0 0"; - AnchorTop = "1"; - AnchorBottom = "0"; - AnchorLeft = "1"; - AnchorRight = "0"; willFirstRespond = "1"; hScrollBar = "dynamic"; vScrollBar = "dynamic"; - lockHorizScroll = "false"; - lockVertScroll = "false"; + lockHorizScroll = "0"; + lockVertScroll = "0"; constantThumbHeight = "0"; childMargin = "0 0"; mouseWheelScrollSpeed = "-1"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "0 0"; + extent = "189 436"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "height"; + profile = "ToolsGuiScrollProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; new GuiTreeViewCtrl() { - internalName = "matLibTree"; - canSaveDynamicFields = "0"; - class = "TerrainMaterialTreeCtrl"; - className = "TerrainMaterialTreeCtrl"; - isContainer = "1"; - Profile = "ToolsGuiTreeViewProfile"; - HorizSizing = "right"; - VertSizing = "bottom"; - position = "1 1"; - Extent = "125 84"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; tabSize = "16"; textOffset = "2"; fullRowSelect = "0"; itemHeight = "21"; destroyTreeOnSleep = "1"; - MouseDragging = "0"; - MultipleSelections = "0"; - DeleteObjectAllowed = "0"; - DragToItemAllowed = "0"; - ClearAllOnSingleSelection = "1"; + mouseDragging = "0"; + multipleSelections = "0"; + deleteObjectAllowed = "0"; + dragToItemAllowed = "0"; + clearAllOnSingleSelection = "1"; showRoot = "0"; - internalNamesOnly = "1"; - objectNamesOnly = "0"; + useInspectorTooltips = "0"; + tooltipOnWidthOnly = "0"; + showObjectIds = "0"; + showClassNames = "0"; + showObjectNames = "0"; + showInternalNames = "1"; + showClassNameForUnnamedObjects = "0"; + compareToObjectID = "1"; + canRenameObjects = "1"; + renameInternal = "0"; + position = "1 1"; + extent = "8 2"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiTreeViewProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + internalName = "matLibTree"; + class = "TerrainMaterialTreeCtrl"; + canSave = "1"; + canSaveDynamicFields = "0"; }; }; }; new GuiButtonCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiButtonProfile"; - HorizSizing = "left"; - VertSizing = "top"; - position = "202 394"; - Extent = "98 22"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "TerrainMaterialDlg.dialogApply();"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; text = "Apply&Select"; groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; + position = "202 456"; + extent = "98 22"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "top"; + profile = "ToolsGuiButtonProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg.dialogApply();"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; }; new GuiButtonCtrl() { - canSaveDynamicFields = "0"; - isContainer = "0"; - Profile = "ToolsGuiButtonProfile"; - HorizSizing = "left"; - VertSizing = "top"; - position = "307 394"; - Extent = "80 22"; - MinExtent = "8 2"; - canSave = "1"; - Visible = "1"; - Command = "TerrainMaterialDlg.dialogCancel();"; - tooltipprofile = "ToolsGuiToolTipProfile"; - hovertime = "1000"; text = "Cancel"; groupNum = "-1"; buttonType = "PushButton"; useMouseEvents = "0"; + position = "307 456"; + extent = "80 22"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "top"; + profile = "ToolsGuiButtonProfile"; + visible = "1"; + active = "1"; + command = "TerrainMaterialDlg.dialogCancel();"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; }; - - new GuiBitmapCtrl() { // inactive overlay - internalName = "inactiveOverlay"; - Profile = "ToolsGuiDefaultProfile"; - HorizSizing = "left"; - VertSizing = "height"; - position = "199 23"; - Extent = "190 267"; - isContainer = true; - Visible = false; + new GuiBitmapCtrl() { bitmap = "tools/gui/images/inactive-overlay"; - - new GuiTextCtrl(){ - internalName = "inactiveOverlayDlg"; - Profile = "ToolsGuiTextCenterProfile"; - HorizSizing = "width"; - VertSizing = "center"; - position = "0 104"; - Extent = "190 64"; + color = "255 255 255 255"; + wrap = "0"; + position = "199 23"; + extent = "190 329"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "height"; + profile = "ToolsGuiDefaultProfile"; + visible = "0"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + internalName = "inactiveOverlay"; + hidden = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiTextCtrl() { text = "Inactive"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "0 132"; + extent = "190 64"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "center"; + profile = "ToolsGuiTextCenterProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + internalName = "inactiveOverlayDlg"; + canSave = "1"; + canSaveDynamicFields = "0"; }; }; }; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/objectBuilderGui.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/objectBuilderGui.ed.gui index f7ccd33c4..95ed67f52 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/objectBuilderGui.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/objectBuilderGui.ed.gui @@ -227,6 +227,77 @@ function ObjectBuilderGui::gotFileName(%this, %name) //%this.controls[%this.currentControl].setValue(%name); } +//------------------------------------------------------------------------------ +function ObjectBuilderGui::createTerrainAssetType(%this, %index) +{ + if(%index >= %this.numFields || %this.field[%index, name] $= "") + { + error("ObjectBuilderGui::createTerrainAssetType: invalid field"); + return; + } + + // + if(%this.field[%index, text] $= "") + %name = %this.field[%index, name]; + else + %name = %this.field[%index, text]; + + // + %this.textControls[%this.numControls] = new GuiTextCtrl() { + profile = "ToolsGuiTextRightProfile"; + text = %name; + extent = %this.fieldNameExtent; + position = %this.curXPos @ " " @ %this.curYPos; + modal = "1"; + }; + + // + %this.controls[%this.numControls] = new GuiButtonCtrl() { + HorizSizing = "width"; + profile = "ToolsGuiButtonProfile"; + extent = %this.fileButtonExtent; + position = %this.curXPos + %this.columnOffset @ " " @ %this.curYPos; + modal = "1"; + command = %this @ ".getTerrainAsset(" @ %index @ ");"; + }; + + %val = %this.field[%index, value]; + %this.controls[%this.numControls].setValue(fileBase(%val) @ fileExt(%val)); + + %this.numControls++; + %this.curYPos += %this.defaultFieldStep; +} + +function ObjectBuilderGui::getTerrainAsset(%this, %index) +{ + if(%index >= %this.numFields || %this.field[%index, name] $= "") + { + error("ObjectBuilderGui::getTerrainAsset: invalid field"); + return; + } + + %val = %this.field[%index, ext]; + + //%path = filePath(%val); + //%ext = fileExt(%val); + + %this.currentControl = %index; + AssetBrowser.showDialog("TerrainAsset", %this @ ".gotTerrainAsset", "", "", ""); + //getLoadFilename( %val @ "|" @ %val, %this @ ".gotFileName", %this.lastPath ); +} + +function ObjectBuilderGui::gotTerrainAsset(%this, %name) +{ + %index = %this.currentControl; + + %this.field[%index, value] = %name; + %this.controls[%this.currentControl].setText(fileBase(%name) @ fileExt(%name)); + + %this.lastPath = %name; + + // This doesn't work for button controls as getValue returns their state! + //%this.controls[%this.currentControl].setValue(%name); +} //------------------------------------------------------------------------------ function ObjectBuilderGui::createMaterialNameType(%this, %index) @@ -489,6 +560,9 @@ function ObjectBuilderGui::process(%this) case "TypeFile": %this.createFileType(%i); + + case "TypeTerrainAsset": + %this.createTerrainAssetType(%i); case "TypeMaterialName": %this.createMaterialNameType(%i); @@ -830,6 +904,7 @@ function ObjectBuilderGui::buildTerrainBlock(%this) %this.createCallback = "ETerrainEditor.attachTerrain();"; %this.addField("terrainFile", "TypeFile", "Terrain file", "", "*.ter"); + %this.addField("terrainAsset", "TypeTerrainAsset", "Terrain Asset", "", ""); %this.addField("squareSize", "TypeInt", "Square size", "8"); %this.process(); diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/interfaces/terrainMaterialDlg.ed.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/interfaces/terrainMaterialDlg.ed.cs index 2ec8e17f3..5cd3e38d3 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/interfaces/terrainMaterialDlg.ed.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/interfaces/terrainMaterialDlg.ed.cs @@ -83,6 +83,20 @@ function TerrainMaterialDlg::onWake( %this ) if( !isObject( TerrainMaterialDlgDeleteGroup ) ) new SimGroup( TerrainMaterialDlgDeleteGroup ); + //Run through and grab any TerrainMaterialAssets + %assetQuery = new AssetQuery(); + AssetDatabase.findAssetType(%assetQuery, "TerrainMaterialAsset"); + + %count = %assetQuery.getCount(); + + for(%i=0; %i < %count; %i++) + { + %assetId = %assetQuery.getAsset(%i); + + AssetDatabase.acquireAsset(%assetId); + } + %assetQuery.delete(); + // Snapshot the materials. %this.snapshotMaterials(); @@ -292,12 +306,33 @@ function TerrainMaterialDlg::changeNormal( %this ) %ctrl.setBitmap( %file ); } +//----------------------------------------------------------------------------- +function TerrainMaterialDlg::changePBRConfig( %this ) +{ + %ctrl = %this-->pbrConfigTexCtrl; + %file = %ctrl.bitmap; + if( getSubStr( %file, 0 , 6 ) $= "tools/" ) + %file = ""; + + %file = TerrainMaterialDlg._selectTextureFileDialog( %file ); + if( %file $= "" ) + { + if( %ctrl.bitmap !$= "" ) + %file = %ctrl.bitmap; + else + %file = "tools/materialEditor/gui/unknownImage"; + } + + %file = makeRelativePath( %file, getMainDotCsDir() ); + %ctrl.setBitmap( %file ); +} + //----------------------------------------------------------------------------- function TerrainMaterialDlg::newMat( %this ) { // Create a unique material name. - %matName = getUniqueInternalName( "newMaterial", TerrainMaterialSet, true ); + /*%matName = getUniqueInternalName( "newMaterial", TerrainMaterialSet, true ); // Create the new material. %newMat = new TerrainMaterial() @@ -308,12 +343,16 @@ function TerrainMaterialDlg::newMat( %this ) %newMat.setFileName( "art/terrains/materials.cs" ); // Mark it as dirty and to be saved in the default location. - ETerrainMaterialPersistMan.setDirty( %newMat, "art/terrains/materials.cs" ); - - %matLibTree = %this-->matLibTree; - %matLibTree.buildVisibleTree( true ); - %item = %matLibTree.findItemByObjectId( %newMat ); - %matLibTree.selectItem( %item ); + ETerrainMaterialPersistMan.setDirty( %newMat, "art/terrains/materials.cs" );*/ + + %scene = getRootScene(); + %path = filePath(%scene.getFilename()); + %module = AssetBrowser.getModuleFromAddress(%path); + AssetBrowser.selectedModule = %module.moduleID; + + AssetBrowser.currentAddress = "data/" @ %module.moduleID; + + AssetBrowser.setupCreateNewAsset("TerrainMaterialAsset", AssetBrowser.selectedModule); } //----------------------------------------------------------------------------- @@ -380,6 +419,11 @@ function TerrainMaterialDlg::setActiveMaterial( %this, %mat ) }else{ %this-->baseTexCtrl.setBitmap( %mat.diffuseMap ); } + if (%mat.pbrConfigMap $= ""){ + %this-->pbrConfigTexCtrl.setBitmap( "tools/materialEditor/gui/unknownImage" ); + }else{ + %this-->pbrConfigTexCtrl.setBitmap( %mat.pbrConfigMap ); + } if (%mat.detailMap $= ""){ %this-->detailTexCtrl.setBitmap( "tools/materialEditor/gui/unknownImage" ); }else{ @@ -438,6 +482,11 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat ) }else{ %newNormal = %this-->normTexCtrl.bitmap; } + if (%this-->pbrConfigTexCtrl.bitmap $= "tools/materialEditor/gui/unknownImage"){ + %newPBRConfig = ""; + }else{ + %newPBRConfig = %this-->pbrConfigTexCtrl.bitmap; + } if (%this-->detailTexCtrl.bitmap $= "tools/materialEditor/gui/unknownImage"){ %newDetail = ""; }else{ @@ -466,6 +515,7 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat ) %mat.diffuseMap $= %newDiffuse && %mat.normalMap $= %newNormal && %mat.detailMap $= %newDetail && + %mat.pbrConfigMap $= %newPBRConfig && %mat.macroMap $= %newMacro && %mat.detailSize == %detailSize && %mat.diffuseSize == %diffuseSize && @@ -497,7 +547,8 @@ function TerrainMaterialDlg::saveDirtyMaterial( %this, %mat ) } %mat.diffuseMap = %newDiffuse; - %mat.normalMap = %newNormal; + %mat.normalMap = %newNormal; + %mat.pbrConfigMap = %newPBRConfig; %mat.detailMap = %newDetail; %mat.macroMap = %newMacro; %mat.detailSize = %detailSize; @@ -543,6 +594,7 @@ function TerrainMaterialDlg::snapshotMaterials( %this ) internalName = %mat.internalName; diffuseMap = %mat.diffuseMap; normalMap = %mat.normalMap; + pbrConfigMap = %mat.pbrConfigMap; detailMap = %mat.detailMap; macroMap = %mat.macroMap; detailSize = %mat.detailSize; @@ -577,6 +629,7 @@ function TerrainMaterialDlg::restoreMaterials( %this ) %mat.setInternalName( %obj.internalName ); %mat.diffuseMap = %obj.diffuseMap; %mat.normalMap = %obj.normalMap; + %mat.pbrConfigMap = %obj.pbrConfigMap; %mat.detailMap = %obj.detailMap; %mat.macroMap = %obj.macroMap; %mat.detailSize = %obj.detailSize; diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.cs index 384517223..221af7944 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/menuHandlers.ed.cs @@ -280,7 +280,17 @@ function EditorSaveMission() initContainerTypeSearch($TypeMasks::TerrainObjectType); while ((%terrainObject = containerSearchNext()) != 0) - %terrainObject.save(%terrainObject.terrainFile); + { + if(%terrainObject.terrainAsset !$= "") + { + //we utilize a terrain asset, so we'll update our dependencies while we're at it + %terrainObject.saveAsset(); + } + else + { + %terrainObject.save(%terrainObject.terrainFile); + } + } } ETerrainPersistMan.saveDirty();