2018-01-28 20:48:02 +00:00
//-----------------------------------------------------------------------------
// Copyright (c) 2013 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
# ifndef LEVEL_ASSET_H
# include "LevelAsset.h"
# endif
# ifndef _ASSET_MANAGER_H_
# include "assets/assetManager.h"
# endif
# ifndef _CONSOLETYPES_H_
# include "console/consoleTypes.h"
# endif
# ifndef _TAML_
# include "persistence/taml/taml.h"
# endif
# ifndef _ASSET_PTR_H_
# include "assets/assetPtr.h"
# endif
// Debug Profiling.
# include "platform/profiler.h"
2024-09-01 21:39:00 +00:00
# include "gfx/gfxDrawUtil.h"
2025-02-06 04:51:43 +00:00
# include "T3D/SubScene.h"
2024-09-01 21:39:00 +00:00
2018-01-28 20:48:02 +00:00
//-----------------------------------------------------------------------------
IMPLEMENT_CONOBJECT ( LevelAsset ) ;
2024-09-01 21:39:00 +00:00
ConsoleType ( LevelAssetPtr , TypeLevelAssetPtr , const char * , " " )
2018-01-28 20:48:02 +00:00
//-----------------------------------------------------------------------------
ConsoleGetType ( TypeLevelAssetPtr )
{
// Fetch asset Id.
2021-07-19 06:07:08 +00:00
return * ( ( const char * * ) ( dptr ) ) ;
2018-01-28 20:48:02 +00:00
}
//-----------------------------------------------------------------------------
ConsoleSetType ( TypeLevelAssetPtr )
{
// Was a single argument specified?
if ( argc = = 1 )
{
// Yes, so fetch field value.
2021-07-19 06:07:08 +00:00
* ( ( const char * * ) dptr ) = StringTable - > insert ( argv [ 0 ] ) ;
2018-01-28 20:48:02 +00:00
return ;
}
// Warn.
Con : : warnf ( " (TypeLevelAssetPtr) - Cannot set multiple args to a single asset. " ) ;
}
2024-09-01 21:39:00 +00:00
//-----------------------------------------------------------------------------
ConsoleType ( assetIdString , TypeLevelAssetId , const char * , " " )
ConsoleGetType ( TypeLevelAssetId )
{
// Fetch asset Id.
return * ( ( const char * * ) ( dptr ) ) ;
}
ConsoleSetType ( TypeLevelAssetId )
{
// Was a single argument specified?
if ( argc = = 1 )
{
* ( ( const char * * ) dptr ) = StringTable - > insert ( argv [ 0 ] ) ;
return ;
}
// Warn.
Con : : warnf ( " (TypeLevelAssetId) - Cannot set multiple args to a single asset. " ) ;
}
2018-01-28 20:48:02 +00:00
//-----------------------------------------------------------------------------
2025-03-30 21:36:15 +00:00
LevelAsset : : LevelAsset ( ) : AssetBase ( )
2018-01-28 20:48:02 +00:00
{
2019-05-04 16:49:42 +00:00
mLevelName = StringTable - > EmptyString ( ) ;
2018-01-28 20:48:02 +00:00
mLevelFile = StringTable - > EmptyString ( ) ;
2019-10-20 07:47:15 +00:00
mPostFXPresetFile = StringTable - > EmptyString ( ) ;
mDecalsFile = StringTable - > EmptyString ( ) ;
mForestFile = StringTable - > EmptyString ( ) ;
mNavmeshFile = StringTable - > EmptyString ( ) ;
2018-02-04 22:21:07 +00:00
2020-08-09 06:32:27 +00:00
mLevelPath = StringTable - > EmptyString ( ) ;
mPostFXPresetPath = StringTable - > EmptyString ( ) ;
mDecalsPath = StringTable - > EmptyString ( ) ;
mForestPath = StringTable - > EmptyString ( ) ;
mNavmeshPath = StringTable - > EmptyString ( ) ;
2024-09-01 21:39:00 +00:00
mGameModesNames = StringTable - > EmptyString ( ) ;
2019-11-18 09:30:04 +00:00
mEditorFile = StringTable - > EmptyString ( ) ;
mBakedSceneFile = StringTable - > EmptyString ( ) ;
2021-07-19 06:07:08 +00:00
mPreviewImageAssetId = StringTable - > EmptyString ( ) ;
mPreviewImageAsset = StringTable - > EmptyString ( ) ;
2018-01-28 20:48:02 +00:00
}
//-----------------------------------------------------------------------------
LevelAsset : : ~ LevelAsset ( )
{
}
//-----------------------------------------------------------------------------
void LevelAsset : : initPersistFields ( )
{
2023-01-27 07:13:15 +00:00
docsURL ;
2018-01-28 20:48:02 +00:00
// Call parent.
Parent : : initPersistFields ( ) ;
2019-05-04 16:49:42 +00:00
addProtectedField ( " LevelFile " , TypeAssetLooseFilePath , Offset ( mLevelFile , LevelAsset ) ,
& setLevelFile , & getLevelFile , " Path to the actual level file. " ) ;
addField ( " LevelName " , TypeString , Offset ( mLevelName , LevelAsset ) , " Human-friendly name for the level. " ) ;
2019-06-03 07:47:30 +00:00
2019-10-20 07:47:15 +00:00
addProtectedField ( " PostFXPresetFile " , TypeAssetLooseFilePath , Offset ( mPostFXPresetFile , LevelAsset ) ,
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path
Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc
Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector
Adjusted expand behavior of guiTree to be more reliable
Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields
Removed redundant PreMult translucency type code
Added setting of feature so probes work when in forward/basic lit mode
Corrected indexing error in SQLiteObject class so it properly parses with the updated console API
Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy
Fixed var when trying to bind the camera to the client
Added project setting field to dictate the default render mode between Forward or Deferred
Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field
Integrated DOF PostFX into updated PostFX Editor paradigm
Updated setting group name for vignette postFX
Shifted shaderCache to be in data/cache along with other cached files
Added helper function to replace strings in a file
Fixed ExampleCppObject asset to have correct loose file references
Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default
Fixed verve reference to root scene group
Adjusted location of a nonmodal gui profile so it loads at the correct time
Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag
Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful
Initial work into zip and folder drag-and-drop asset importing support
Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions
Updated example asset type file
Ensured all asset types have proper handling for move, rename and delete actions
Fixed double-click behavior on folders in the AB
Fixed CPP asset preview
Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser
Added ability to convert a non-module top-level folder in the AB into a module
Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules
Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake
Fixed convex editor's material handling to work with AB and reference back properly
Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow
Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open
Added some additional common text gui profiles
Disabled calls to old editor settings logic in various editors to remove spam
Added callOnModules call so tools can initialize properly when the world editor is opened
Fixed logic test for visualizers
Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
& setPostFXPresetFile , & getPostFXPresetFile , " Path to the level's postFXPreset. " ) ;
2019-10-20 07:47:15 +00:00
addProtectedField ( " DecalsFile " , TypeAssetLooseFilePath , Offset ( mDecalsFile , LevelAsset ) ,
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path
Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc
Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector
Adjusted expand behavior of guiTree to be more reliable
Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields
Removed redundant PreMult translucency type code
Added setting of feature so probes work when in forward/basic lit mode
Corrected indexing error in SQLiteObject class so it properly parses with the updated console API
Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy
Fixed var when trying to bind the camera to the client
Added project setting field to dictate the default render mode between Forward or Deferred
Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field
Integrated DOF PostFX into updated PostFX Editor paradigm
Updated setting group name for vignette postFX
Shifted shaderCache to be in data/cache along with other cached files
Added helper function to replace strings in a file
Fixed ExampleCppObject asset to have correct loose file references
Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default
Fixed verve reference to root scene group
Adjusted location of a nonmodal gui profile so it loads at the correct time
Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag
Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful
Initial work into zip and folder drag-and-drop asset importing support
Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions
Updated example asset type file
Ensured all asset types have proper handling for move, rename and delete actions
Fixed double-click behavior on folders in the AB
Fixed CPP asset preview
Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser
Added ability to convert a non-module top-level folder in the AB into a module
Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules
Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake
Fixed convex editor's material handling to work with AB and reference back properly
Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow
Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open
Added some additional common text gui profiles
Disabled calls to old editor settings logic in various editors to remove spam
Added callOnModules call so tools can initialize properly when the world editor is opened
Fixed logic test for visualizers
Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
& setDecalsFile , & getDecalsFile , " Path to the decals cache file. " ) ;
2019-10-20 07:47:15 +00:00
addProtectedField ( " ForestFile " , TypeAssetLooseFilePath , Offset ( mForestFile , LevelAsset ) ,
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path
Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc
Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector
Adjusted expand behavior of guiTree to be more reliable
Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields
Removed redundant PreMult translucency type code
Added setting of feature so probes work when in forward/basic lit mode
Corrected indexing error in SQLiteObject class so it properly parses with the updated console API
Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy
Fixed var when trying to bind the camera to the client
Added project setting field to dictate the default render mode between Forward or Deferred
Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field
Integrated DOF PostFX into updated PostFX Editor paradigm
Updated setting group name for vignette postFX
Shifted shaderCache to be in data/cache along with other cached files
Added helper function to replace strings in a file
Fixed ExampleCppObject asset to have correct loose file references
Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default
Fixed verve reference to root scene group
Adjusted location of a nonmodal gui profile so it loads at the correct time
Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag
Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful
Initial work into zip and folder drag-and-drop asset importing support
Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions
Updated example asset type file
Ensured all asset types have proper handling for move, rename and delete actions
Fixed double-click behavior on folders in the AB
Fixed CPP asset preview
Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser
Added ability to convert a non-module top-level folder in the AB into a module
Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules
Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake
Fixed convex editor's material handling to work with AB and reference back properly
Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow
Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open
Added some additional common text gui profiles
Disabled calls to old editor settings logic in various editors to remove spam
Added callOnModules call so tools can initialize properly when the world editor is opened
Fixed logic test for visualizers
Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
& setForestFile , & getForestFile , " Path to the Forest cache file. " ) ;
2019-10-20 07:47:15 +00:00
addProtectedField ( " NavmeshFile " , TypeAssetLooseFilePath , Offset ( mNavmeshFile , LevelAsset ) ,
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path
Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc
Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector
Adjusted expand behavior of guiTree to be more reliable
Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields
Removed redundant PreMult translucency type code
Added setting of feature so probes work when in forward/basic lit mode
Corrected indexing error in SQLiteObject class so it properly parses with the updated console API
Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy
Fixed var when trying to bind the camera to the client
Added project setting field to dictate the default render mode between Forward or Deferred
Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field
Integrated DOF PostFX into updated PostFX Editor paradigm
Updated setting group name for vignette postFX
Shifted shaderCache to be in data/cache along with other cached files
Added helper function to replace strings in a file
Fixed ExampleCppObject asset to have correct loose file references
Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default
Fixed verve reference to root scene group
Adjusted location of a nonmodal gui profile so it loads at the correct time
Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag
Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful
Initial work into zip and folder drag-and-drop asset importing support
Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions
Updated example asset type file
Ensured all asset types have proper handling for move, rename and delete actions
Fixed double-click behavior on folders in the AB
Fixed CPP asset preview
Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser
Added ability to convert a non-module top-level folder in the AB into a module
Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules
Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake
Fixed convex editor's material handling to work with AB and reference back properly
Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow
Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open
Added some additional common text gui profiles
Disabled calls to old editor settings logic in various editors to remove spam
Added callOnModules call so tools can initialize properly when the world editor is opened
Fixed logic test for visualizers
Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
& setNavmeshFile , & getNavmeshFile , " Path to the navmesh file. " ) ;
2019-10-20 07:47:15 +00:00
2019-11-18 09:30:04 +00:00
addProtectedField ( " EditorFile " , TypeAssetLooseFilePath , Offset ( mEditorFile , LevelAsset ) ,
& setEditorFile , & getEditorFile , " Path to the level file with objects that were removed as part of the baking process. Loaded when the editor is loaded for ease of editing. " ) ;
addProtectedField ( " BakedSceneFile " , TypeAssetLooseFilePath , Offset ( mBakedSceneFile , LevelAsset ) ,
& setBakedSceneFile , & getBakedSceneFile , " Path to the level file with the objects generated as part of the baking process " ) ;
2024-09-01 21:39:00 +00:00
addField ( " gameModesNames " , TypeString , Offset ( mGameModesNames , LevelAsset ) , " Name of the Game Mode to be used with this level " ) ;
2018-01-28 20:48:02 +00:00
}
//------------------------------------------------------------------------------
void LevelAsset : : copyTo ( SimObject * object )
{
// Call to parent.
Parent : : copyTo ( object ) ;
2019-05-04 16:49:42 +00:00
}
//
void LevelAsset : : initializeAsset ( )
{
// Call parent.
Parent : : initializeAsset ( ) ;
2021-07-19 06:07:08 +00:00
loadAsset ( ) ;
2020-08-09 06:32:27 +00:00
}
void LevelAsset : : onAssetRefresh ( void )
2021-07-19 06:07:08 +00:00
{
loadAsset ( ) ;
}
void LevelAsset : : loadAsset ( )
2020-08-09 06:32:27 +00:00
{
// Ensure the image-file is expanded.
2021-08-22 04:12:37 +00:00
mLevelPath = getOwned ( ) ? expandAssetFilePath ( mLevelFile ) : mLevelPath ;
mPostFXPresetPath = getOwned ( ) ? expandAssetFilePath ( mPostFXPresetFile ) : mPostFXPresetPath ;
mDecalsPath = getOwned ( ) ? expandAssetFilePath ( mDecalsFile ) : mDecalsPath ;
mForestPath = getOwned ( ) ? expandAssetFilePath ( mForestFile ) : mForestPath ;
mNavmeshPath = getOwned ( ) ? expandAssetFilePath ( mNavmeshFile ) : mNavmeshPath ;
2021-07-19 06:07:08 +00:00
StringTableEntry previewImageAssetId = getAssetDependencyField ( " previewImageAsset " ) ;
if ( previewImageAssetId ! = StringTable - > EmptyString ( ) )
{
mPreviewImageAssetId = previewImageAssetId ;
2021-08-17 20:32:05 +00:00
mPreviewImageAsset = mPreviewImageAssetId ;
2021-07-19 06:07:08 +00:00
}
2019-05-04 16:49:42 +00:00
}
//
void LevelAsset : : setLevelFile ( const char * pLevelFile )
{
// Sanity!
AssertFatal ( pLevelFile ! = NULL , " Cannot use a NULL level file. " ) ;
// Fetch image file.
2021-08-22 04:12:37 +00:00
pLevelFile = StringTable - > insert ( pLevelFile , true ) ;
2019-05-04 16:49:42 +00:00
// Ignore no change,
if ( pLevelFile = = mLevelFile )
return ;
// Update.
2021-08-22 04:12:37 +00:00
mLevelFile = getOwned ( ) ? expandAssetFilePath ( pLevelFile ) : pLevelFile ;
2019-05-04 16:49:42 +00:00
// Refresh the asset.
refreshAsset ( ) ;
}
2021-07-19 06:07:08 +00:00
StringTableEntry LevelAsset : : getPreviewImageAsset ( ) const
2019-05-04 16:49:42 +00:00
{
2021-07-19 06:07:08 +00:00
return mPreviewImageAssetId ;
}
2019-05-04 16:49:42 +00:00
2021-07-19 06:07:08 +00:00
StringTableEntry LevelAsset : : getPreviewImagePath ( void ) const
{
if ( mPreviewImageAsset . notNull ( ) & & mPreviewImageAsset - > isAssetValid ( ) )
{
2024-12-21 11:16:55 +00:00
return mPreviewImageAsset - > getImageFile ( ) ;
2021-07-19 06:07:08 +00:00
}
2019-05-04 16:49:42 +00:00
2021-07-19 06:07:08 +00:00
return StringTable - > EmptyString ( ) ;
2019-05-04 16:49:42 +00:00
}
2019-11-18 09:30:04 +00:00
void LevelAsset : : setEditorFile ( const char * pEditorFile )
{
// Sanity!
AssertFatal ( pEditorFile ! = NULL , " Cannot use a NULL level file. " ) ;
// Fetch image file.
2021-08-22 04:12:37 +00:00
pEditorFile = StringTable - > insert ( pEditorFile , true ) ;
2019-11-18 09:30:04 +00:00
// Ignore no change,
if ( pEditorFile = = mEditorFile )
return ;
// Update.
2021-08-22 04:12:37 +00:00
mEditorFile = getOwned ( ) ? expandAssetFilePath ( pEditorFile ) : pEditorFile ;
2019-11-18 09:30:04 +00:00
// Refresh the asset.
refreshAsset ( ) ;
}
void LevelAsset : : setBakedSceneFile ( const char * pBakedSceneFile )
{
// Sanity!
AssertFatal ( pBakedSceneFile ! = NULL , " Cannot use a NULL level file. " ) ;
// Fetch image file.
2021-08-22 04:12:37 +00:00
pBakedSceneFile = StringTable - > insert ( pBakedSceneFile , true ) ;
2019-11-18 09:30:04 +00:00
// Ignore no change,
if ( pBakedSceneFile = = mBakedSceneFile )
return ;
// Update.
2021-08-22 04:12:37 +00:00
mBakedSceneFile = getOwned ( ) ? expandAssetFilePath ( pBakedSceneFile ) : pBakedSceneFile ;
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path
Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc
Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector
Adjusted expand behavior of guiTree to be more reliable
Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields
Removed redundant PreMult translucency type code
Added setting of feature so probes work when in forward/basic lit mode
Corrected indexing error in SQLiteObject class so it properly parses with the updated console API
Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy
Fixed var when trying to bind the camera to the client
Added project setting field to dictate the default render mode between Forward or Deferred
Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field
Integrated DOF PostFX into updated PostFX Editor paradigm
Updated setting group name for vignette postFX
Shifted shaderCache to be in data/cache along with other cached files
Added helper function to replace strings in a file
Fixed ExampleCppObject asset to have correct loose file references
Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default
Fixed verve reference to root scene group
Adjusted location of a nonmodal gui profile so it loads at the correct time
Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag
Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful
Initial work into zip and folder drag-and-drop asset importing support
Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions
Updated example asset type file
Ensured all asset types have proper handling for move, rename and delete actions
Fixed double-click behavior on folders in the AB
Fixed CPP asset preview
Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser
Added ability to convert a non-module top-level folder in the AB into a module
Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules
Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake
Fixed convex editor's material handling to work with AB and reference back properly
Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow
Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open
Added some additional common text gui profiles
Disabled calls to old editor settings logic in various editors to remove spam
Added callOnModules call so tools can initialize properly when the world editor is opened
Fixed logic test for visualizers
Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
// Refresh the asset.
refreshAsset ( ) ;
}
void LevelAsset : : setPostFXPresetFile ( const char * pPostFXPresetFile )
{
// Sanity!
AssertFatal ( pPostFXPresetFile ! = NULL , " Cannot use a NULL postFX preset file. " ) ;
// Fetch file.
2021-08-22 04:12:37 +00:00
pPostFXPresetFile = StringTable - > insert ( pPostFXPresetFile , true ) ;
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path
Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc
Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector
Adjusted expand behavior of guiTree to be more reliable
Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields
Removed redundant PreMult translucency type code
Added setting of feature so probes work when in forward/basic lit mode
Corrected indexing error in SQLiteObject class so it properly parses with the updated console API
Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy
Fixed var when trying to bind the camera to the client
Added project setting field to dictate the default render mode between Forward or Deferred
Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field
Integrated DOF PostFX into updated PostFX Editor paradigm
Updated setting group name for vignette postFX
Shifted shaderCache to be in data/cache along with other cached files
Added helper function to replace strings in a file
Fixed ExampleCppObject asset to have correct loose file references
Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default
Fixed verve reference to root scene group
Adjusted location of a nonmodal gui profile so it loads at the correct time
Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag
Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful
Initial work into zip and folder drag-and-drop asset importing support
Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions
Updated example asset type file
Ensured all asset types have proper handling for move, rename and delete actions
Fixed double-click behavior on folders in the AB
Fixed CPP asset preview
Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser
Added ability to convert a non-module top-level folder in the AB into a module
Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules
Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake
Fixed convex editor's material handling to work with AB and reference back properly
Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow
Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open
Added some additional common text gui profiles
Disabled calls to old editor settings logic in various editors to remove spam
Added callOnModules call so tools can initialize properly when the world editor is opened
Fixed logic test for visualizers
Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
// Ignore no change,
if ( pPostFXPresetFile = = mPostFXPresetFile )
return ;
// Update.
2021-08-22 04:12:37 +00:00
mPostFXPresetFile = getOwned ( ) ? expandAssetFilePath ( pPostFXPresetFile ) : pPostFXPresetFile ;
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path
Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc
Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector
Adjusted expand behavior of guiTree to be more reliable
Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields
Removed redundant PreMult translucency type code
Added setting of feature so probes work when in forward/basic lit mode
Corrected indexing error in SQLiteObject class so it properly parses with the updated console API
Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy
Fixed var when trying to bind the camera to the client
Added project setting field to dictate the default render mode between Forward or Deferred
Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field
Integrated DOF PostFX into updated PostFX Editor paradigm
Updated setting group name for vignette postFX
Shifted shaderCache to be in data/cache along with other cached files
Added helper function to replace strings in a file
Fixed ExampleCppObject asset to have correct loose file references
Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default
Fixed verve reference to root scene group
Adjusted location of a nonmodal gui profile so it loads at the correct time
Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag
Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful
Initial work into zip and folder drag-and-drop asset importing support
Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions
Updated example asset type file
Ensured all asset types have proper handling for move, rename and delete actions
Fixed double-click behavior on folders in the AB
Fixed CPP asset preview
Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser
Added ability to convert a non-module top-level folder in the AB into a module
Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules
Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake
Fixed convex editor's material handling to work with AB and reference back properly
Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow
Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open
Added some additional common text gui profiles
Disabled calls to old editor settings logic in various editors to remove spam
Added callOnModules call so tools can initialize properly when the world editor is opened
Fixed logic test for visualizers
Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
// Refresh the asset.
refreshAsset ( ) ;
}
void LevelAsset : : setDecalsFile ( const char * pDecalsFile )
{
// Sanity!
AssertFatal ( pDecalsFile ! = NULL , " Cannot use a NULL decals file. " ) ;
// Fetch file.
2021-08-22 04:12:37 +00:00
pDecalsFile = StringTable - > insert ( pDecalsFile , true ) ;
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path
Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc
Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector
Adjusted expand behavior of guiTree to be more reliable
Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields
Removed redundant PreMult translucency type code
Added setting of feature so probes work when in forward/basic lit mode
Corrected indexing error in SQLiteObject class so it properly parses with the updated console API
Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy
Fixed var when trying to bind the camera to the client
Added project setting field to dictate the default render mode between Forward or Deferred
Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field
Integrated DOF PostFX into updated PostFX Editor paradigm
Updated setting group name for vignette postFX
Shifted shaderCache to be in data/cache along with other cached files
Added helper function to replace strings in a file
Fixed ExampleCppObject asset to have correct loose file references
Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default
Fixed verve reference to root scene group
Adjusted location of a nonmodal gui profile so it loads at the correct time
Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag
Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful
Initial work into zip and folder drag-and-drop asset importing support
Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions
Updated example asset type file
Ensured all asset types have proper handling for move, rename and delete actions
Fixed double-click behavior on folders in the AB
Fixed CPP asset preview
Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser
Added ability to convert a non-module top-level folder in the AB into a module
Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules
Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake
Fixed convex editor's material handling to work with AB and reference back properly
Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow
Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open
Added some additional common text gui profiles
Disabled calls to old editor settings logic in various editors to remove spam
Added callOnModules call so tools can initialize properly when the world editor is opened
Fixed logic test for visualizers
Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
// Ignore no change,
if ( pDecalsFile = = mDecalsFile )
return ;
// Update.
2021-08-22 04:12:37 +00:00
mDecalsFile = getOwned ( ) ? expandAssetFilePath ( pDecalsFile ) : pDecalsFile ;
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path
Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc
Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector
Adjusted expand behavior of guiTree to be more reliable
Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields
Removed redundant PreMult translucency type code
Added setting of feature so probes work when in forward/basic lit mode
Corrected indexing error in SQLiteObject class so it properly parses with the updated console API
Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy
Fixed var when trying to bind the camera to the client
Added project setting field to dictate the default render mode between Forward or Deferred
Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field
Integrated DOF PostFX into updated PostFX Editor paradigm
Updated setting group name for vignette postFX
Shifted shaderCache to be in data/cache along with other cached files
Added helper function to replace strings in a file
Fixed ExampleCppObject asset to have correct loose file references
Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default
Fixed verve reference to root scene group
Adjusted location of a nonmodal gui profile so it loads at the correct time
Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag
Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful
Initial work into zip and folder drag-and-drop asset importing support
Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions
Updated example asset type file
Ensured all asset types have proper handling for move, rename and delete actions
Fixed double-click behavior on folders in the AB
Fixed CPP asset preview
Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser
Added ability to convert a non-module top-level folder in the AB into a module
Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules
Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake
Fixed convex editor's material handling to work with AB and reference back properly
Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow
Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open
Added some additional common text gui profiles
Disabled calls to old editor settings logic in various editors to remove spam
Added callOnModules call so tools can initialize properly when the world editor is opened
Fixed logic test for visualizers
Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
// Refresh the asset.
refreshAsset ( ) ;
}
void LevelAsset : : setForestFile ( const char * pForestFile )
{
// Sanity!
AssertFatal ( pForestFile ! = NULL , " Cannot use a NULL decals file. " ) ;
// Fetch file.
2021-08-22 04:12:37 +00:00
pForestFile = StringTable - > insert ( pForestFile , true ) ;
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path
Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc
Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector
Adjusted expand behavior of guiTree to be more reliable
Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields
Removed redundant PreMult translucency type code
Added setting of feature so probes work when in forward/basic lit mode
Corrected indexing error in SQLiteObject class so it properly parses with the updated console API
Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy
Fixed var when trying to bind the camera to the client
Added project setting field to dictate the default render mode between Forward or Deferred
Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field
Integrated DOF PostFX into updated PostFX Editor paradigm
Updated setting group name for vignette postFX
Shifted shaderCache to be in data/cache along with other cached files
Added helper function to replace strings in a file
Fixed ExampleCppObject asset to have correct loose file references
Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default
Fixed verve reference to root scene group
Adjusted location of a nonmodal gui profile so it loads at the correct time
Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag
Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful
Initial work into zip and folder drag-and-drop asset importing support
Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions
Updated example asset type file
Ensured all asset types have proper handling for move, rename and delete actions
Fixed double-click behavior on folders in the AB
Fixed CPP asset preview
Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser
Added ability to convert a non-module top-level folder in the AB into a module
Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules
Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake
Fixed convex editor's material handling to work with AB and reference back properly
Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow
Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open
Added some additional common text gui profiles
Disabled calls to old editor settings logic in various editors to remove spam
Added callOnModules call so tools can initialize properly when the world editor is opened
Fixed logic test for visualizers
Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
// Ignore no change,
if ( pForestFile = = mForestFile )
return ;
// Update.
2021-08-22 04:12:37 +00:00
mForestFile = getOwned ( ) ? expandAssetFilePath ( pForestFile ) : pForestFile ;
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path
Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc
Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector
Adjusted expand behavior of guiTree to be more reliable
Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields
Removed redundant PreMult translucency type code
Added setting of feature so probes work when in forward/basic lit mode
Corrected indexing error in SQLiteObject class so it properly parses with the updated console API
Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy
Fixed var when trying to bind the camera to the client
Added project setting field to dictate the default render mode between Forward or Deferred
Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field
Integrated DOF PostFX into updated PostFX Editor paradigm
Updated setting group name for vignette postFX
Shifted shaderCache to be in data/cache along with other cached files
Added helper function to replace strings in a file
Fixed ExampleCppObject asset to have correct loose file references
Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default
Fixed verve reference to root scene group
Adjusted location of a nonmodal gui profile so it loads at the correct time
Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag
Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful
Initial work into zip and folder drag-and-drop asset importing support
Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions
Updated example asset type file
Ensured all asset types have proper handling for move, rename and delete actions
Fixed double-click behavior on folders in the AB
Fixed CPP asset preview
Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser
Added ability to convert a non-module top-level folder in the AB into a module
Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules
Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake
Fixed convex editor's material handling to work with AB and reference back properly
Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow
Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open
Added some additional common text gui profiles
Disabled calls to old editor settings logic in various editors to remove spam
Added callOnModules call so tools can initialize properly when the world editor is opened
Fixed logic test for visualizers
Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
// Refresh the asset.
refreshAsset ( ) ;
}
void LevelAsset : : setNavmeshFile ( const char * pNavmeshFile )
{
// Sanity!
AssertFatal ( pNavmeshFile ! = NULL , " Cannot use a NULL Navmesh file. " ) ;
// Fetch file.
2021-08-22 04:12:37 +00:00
pNavmeshFile = StringTable - > insert ( pNavmeshFile , true ) ;
Updated path handling for loose asset files for CPP, Image, Level, Material, PostFX, Shape, Terrain, TerrainMat and StateMachine assets to be more predictable in when and how they expando the loose file path into a full, useable path
Fixed loose file bindings for all associated slots in level asset, such as postFX file, decals, etc
Expanded TSStatic onInspect testcase to parse materialSlots and hook-in a specialized material field for editing/quick reference from the inspector
Adjusted expand behavior of guiTree to be more reliable
Added internal name 'stack' to inspectorGroup's stack child objects for easier access to add programatic fields
Removed redundant PreMult translucency type code
Added setting of feature so probes work when in forward/basic lit mode
Corrected indexing error in SQLiteObject class so it properly parses with the updated console API
Tweaked the FOV setting logic in GameConnection::onControlObjectChange to not be spammy
Fixed var when trying to bind the camera to the client
Added project setting field to dictate the default render mode between Forward or Deferred
Integrated MotionBlur PostFX into updated PostFX Editor paradigm and exposed the samples uniform as an editable field
Integrated DOF PostFX into updated PostFX Editor paradigm
Updated setting group name for vignette postFX
Shifted shaderCache to be in data/cache along with other cached files
Added helper function to replace strings in a file
Fixed ExampleCppObject asset to have correct loose file references
Adjusted editor default level logic so it can be modifed and then stored, as well as reset back to the original default
Fixed verve reference to root scene group
Adjusted location of a nonmodal gui profile so it loads at the correct time
Reorganized AssetBrowser loading and refresh logic so it doesn't stack multiple refresh requests back-to-back causing lag
Updated the search behavior to search not just the current address, but all child folders as well, making it far more useful
Initial work into zip and folder drag-and-drop asset importing support
Removed the import config setting for 'always display material maps' as it is redundant with the new importer context menu actions
Updated example asset type file
Ensured all asset types have proper handling for move, rename and delete actions
Fixed double-click behavior on folders in the AB
Fixed CPP asset preview
Added better logic to discern if a top-level folder belongs to a module or not in the AB directory browser
Added ability to convert a non-module top-level folder in the AB into a module
Added initial hooks for being able to generate a new Editor Tool, similar to how the AB can generate modules
Renamed CPP asset template files to have the .template so they aren't accidentally picked up by cmake
Fixed convex editor's material handling to work with AB and reference back properly
Updated AB images for folder up/down navigation buttons, and the breadcrumb divider arrow
Made PostFX Editor properly allow for input pass-through so you can still edit the level with it open
Added some additional common text gui profiles
Disabled calls to old editor settings logic in various editors to remove spam
Added callOnModules call so tools can initialize properly when the world editor is opened
Fixed logic test for visualizers
Added ability for cmake to scan tools directory for any tools that add source files
2020-02-04 07:47:28 +00:00
// Ignore no change,
if ( pNavmeshFile = = mNavmeshFile )
return ;
// Update.
2021-08-22 04:12:37 +00:00
mNavmeshFile = getOwned ( ) ? expandAssetFilePath ( pNavmeshFile ) : pNavmeshFile ;
2019-11-18 09:30:04 +00:00
// Refresh the asset.
refreshAsset ( ) ;
}
2020-08-12 18:11:13 +00:00
2020-08-19 23:30:42 +00:00
void LevelAsset : : loadDependencies ( )
{
//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 )
{
//Force it to be loaded by acquiring it
StringTableEntry assetId = assetDependenciesItr - > value ;
mAssetDependencies . push_back ( AssetDatabase . acquireAsset < AssetBase > ( assetId ) ) ;
// Next dependency.
assetDependenciesItr + + ;
}
}
}
void LevelAsset : : unloadDependencies ( )
{
for ( U32 i = 0 ; i < mAssetDependencies . size ( ) ; i + + )
{
AssetBase * assetDef = mAssetDependencies [ i ] ;
AssetDatabase . releaseAsset ( assetDef - > getAssetId ( ) ) ;
}
}
2024-09-01 21:39:00 +00:00
DefineEngineMethod ( LevelAsset , getLevelPath , const char * , ( ) , ,
2020-10-13 23:44:42 +00:00
" Gets the full path of the asset's defined level file. \n "
" @return The string result of the level path " )
2020-08-12 18:11:13 +00:00
{
return object - > getLevelPath ( ) ;
}
2020-08-19 23:30:42 +00:00
2021-07-19 06:07:08 +00:00
DefineEngineMethod ( LevelAsset , getPreviewImageAsset , const char * , ( ) , ,
" Gets the full path of the asset's defined preview image file. \n "
" @return The string result of the level preview image path " )
{
return object - > getPreviewImageAsset ( ) ;
}
2020-10-13 23:44:42 +00:00
DefineEngineMethod ( LevelAsset , getPreviewImagePath , const char * , ( ) , ,
" Gets the full path of the asset's defined preview image file. \n "
" @return The string result of the level preview image path " )
{
2021-07-19 06:07:08 +00:00
return object - > getPreviewImagePath ( ) ;
2020-10-13 23:44:42 +00:00
}
2020-09-11 07:28:15 +00:00
DefineEngineMethod ( LevelAsset , getPostFXPresetPath , const char * , ( ) , ,
2020-10-13 23:44:42 +00:00
" Gets the full path of the asset's defined postFX preset file. \n "
" @return The string result of the postFX preset path " )
2020-09-11 07:28:15 +00:00
{
return object - > getPostFXPresetPath ( ) ;
}
DefineEngineMethod ( LevelAsset , getDecalsPath , const char * , ( ) , ,
2020-10-13 23:44:42 +00:00
" Gets the full path of the asset's defined decal file. \n "
" @return The string result of the decal path " )
2020-09-11 07:28:15 +00:00
{
return object - > getDecalsPath ( ) ;
}
2022-04-05 05:29:58 +00:00
DefineEngineMethod ( LevelAsset , getForestPath , const char * , ( ) , ,
" Gets the full path of the asset's defined forest file. \n "
" @return The string result of the forest path " )
{
return object - > getForestPath ( ) ;
}
DefineEngineMethod ( LevelAsset , getNavmeshPath , const char * , ( ) , ,
" Gets the full path of the asset's defined navmesh file. \n "
" @return The string result of the navmesh path " )
{
return object - > getNavmeshPath ( ) ;
}
2020-08-19 23:30:42 +00:00
DefineEngineMethod ( LevelAsset , loadDependencies , void , ( ) , ,
" Initiates the loading of asset dependencies for this level. " )
{
return object - > loadDependencies ( ) ;
}
DefineEngineMethod ( LevelAsset , unloadDependencies , void , ( ) , ,
" Initiates the unloading of previously loaded asset dependencies for this level. " )
{
return object - > unloadDependencies ( ) ;
}
2024-09-01 21:39:00 +00:00
2025-04-02 20:38:43 +00:00
# ifdef TORQUE_TOOLS
2024-09-01 21:39:00 +00:00
//-----------------------------------------------------------------------------
// GuiInspectorTypeAssetId
//-----------------------------------------------------------------------------
IMPLEMENT_CONOBJECT ( GuiInspectorTypeLevelAssetPtr ) ;
ConsoleDocClass ( GuiInspectorTypeLevelAssetPtr ,
" @brief Inspector field type for Shapes \n \n "
" Editor use only. \n \n "
" @internal "
) ;
void GuiInspectorTypeLevelAssetPtr : : consoleInit ( )
{
Parent : : consoleInit ( ) ;
ConsoleBaseType : : getType ( TypeLevelAssetPtr ) - > setInspectorFieldType ( " GuiInspectorTypeLevelAssetPtr " ) ;
}
GuiControl * GuiInspectorTypeLevelAssetPtr : : constructEditControl ( )
{
// Create base filename edit controls
GuiControl * retCtrl = Parent : : constructEditControl ( ) ;
if ( retCtrl = = NULL )
return retCtrl ;
// Change filespec
char szBuffer [ 512 ] ;
dSprintf ( szBuffer , sizeof ( szBuffer ) , " AssetBrowser.showDialog( \" LevelAsset \" , \" AssetBrowser.changeAsset \" , %s, \" \" ); " ,
getIdString ( ) ) ;
mBrowseButton - > setField ( " Command " , szBuffer ) ;
setDataField ( StringTable - > insert ( " targetObject " ) , NULL , mInspector - > getInspectObject ( ) - > getIdString ( ) ) ;
// Create "Open in Editor" button
mEditButton = new GuiBitmapButtonCtrl ( ) ;
2025-03-30 21:36:15 +00:00
dSprintf ( szBuffer , sizeof ( szBuffer ) , " $createAndAssignField = %s; AssetBrowser.setupCreateNewAsset( \" LevelAsset \" , AssetBrowser.selectedModule, \" createAndAssignLevelAsset \" ); " ,
getIdString ( ) ) ;
2024-09-01 21:39:00 +00:00
mEditButton - > setField ( " Command " , szBuffer ) ;
char bitmapName [ 512 ] = " ToolsModule:iconAdd_image " ;
mEditButton - > setBitmap ( StringTable - > insert ( bitmapName ) ) ;
mEditButton - > setDataField ( StringTable - > insert ( " Profile " ) , NULL , " GuiButtonProfile " ) ;
mEditButton - > setDataField ( StringTable - > insert ( " tooltipprofile " ) , NULL , " GuiToolTipProfile " ) ;
mEditButton - > setDataField ( StringTable - > insert ( " hovertime " ) , NULL , " 1000 " ) ;
mEditButton - > setDataField ( StringTable - > insert ( " tooltip " ) , NULL , " Test play this sound " ) ;
mEditButton - > registerObject ( ) ;
addObject ( mEditButton ) ;
return retCtrl ;
}
bool GuiInspectorTypeLevelAssetPtr : : updateRects ( )
{
S32 dividerPos , dividerMargin ;
mInspector - > getDivider ( dividerPos , dividerMargin ) ;
Point2I fieldExtent = getExtent ( ) ;
Point2I fieldPos = getPosition ( ) ;
mCaptionRect . set ( 0 , 0 , fieldExtent . x - dividerPos - dividerMargin , fieldExtent . y ) ;
mEditCtrlRect . set ( fieldExtent . x - dividerPos + dividerMargin , 1 , dividerPos - dividerMargin - 34 , fieldExtent . y ) ;
bool resized = mEdit - > resize ( mEditCtrlRect . point , mEditCtrlRect . extent ) ;
if ( mBrowseButton ! = NULL )
{
mBrowseRect . set ( fieldExtent . x - 32 , 2 , 14 , fieldExtent . y - 4 ) ;
resized | = mBrowseButton - > resize ( mBrowseRect . point , mBrowseRect . extent ) ;
}
if ( mEditButton ! = NULL )
{
RectI shapeEdRect ( fieldExtent . x - 16 , 2 , 14 , fieldExtent . y - 4 ) ;
resized | = mEditButton - > resize ( shapeEdRect . point , shapeEdRect . extent ) ;
}
return resized ;
}
IMPLEMENT_CONOBJECT ( GuiInspectorTypeLevelAssetId ) ;
ConsoleDocClass ( GuiInspectorTypeLevelAssetId ,
" @brief Inspector field type for Levels \n \n "
" Editor use only. \n \n "
" @internal "
) ;
void GuiInspectorTypeLevelAssetId : : consoleInit ( )
{
Parent : : consoleInit ( ) ;
ConsoleBaseType : : getType ( TypeLevelAssetId ) - > setInspectorFieldType ( " GuiInspectorTypeLevelAssetId " ) ;
}
2025-04-02 20:38:43 +00:00
# endif