mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Fixed uninitialized values for renderMeshExample and renderShapeExample which would cause a crash on creation
Added utility method to prefab to be able to get the internal simGroup that contains it's children Adjusted logic for mounting items in GuiShapeEdPreview to utilize assetIds for the shapes Moved the Asset and AssetBrowser editor settings populate functions to the AssetBrowser script to better organize things Fixed command usage for General, Player and Observer spawn point creator entries to use the correct callback commands Fixed logic for creator callback commands that don't just route through the class name based structure Added RMB context menu actions for opening asset file or folder locations in OS file explorer Fixed lookup of animation assets when editing a shape's animations in the shape editor so it provides the assetId of the anim if it exists Fixes handling of mounting in the shape editor so it utilizes assets and the asset browser like everything else
This commit is contained in:
parent
42e2eecee7
commit
976c0bca79
12 changed files with 207 additions and 111 deletions
|
|
@ -557,16 +557,20 @@ void GuiShapeEdPreview::refreshThreadSequences()
|
|||
//-----------------------------------------------------------------------------
|
||||
// MOUNTING
|
||||
|
||||
bool GuiShapeEdPreview::mountShape(const char* modelName, const char* nodeName, const char* mountType, S32 slot)
|
||||
bool GuiShapeEdPreview::mountShape(const char* shapeAssetId, const char* nodeName, const char* mountType, S32 slot)
|
||||
{
|
||||
if ( !modelName || !modelName[0] )
|
||||
if ( !shapeAssetId || !shapeAssetId[0] )
|
||||
return false;
|
||||
|
||||
Resource<TSShape> model = ResourceManager::get().load( modelName );
|
||||
if ( !bool( model ) )
|
||||
if (!AssetDatabase.isDeclaredAsset(shapeAssetId))
|
||||
return false;
|
||||
|
||||
TSShapeInstance* tsi = new TSShapeInstance( model, true );
|
||||
ShapeAsset* model = AssetDatabase.acquireAsset<ShapeAsset>(shapeAssetId);
|
||||
|
||||
if (model == nullptr || !model->getShapeResource())
|
||||
return false;
|
||||
|
||||
TSShapeInstance* tsi = new TSShapeInstance(model->getShapeResource(), true );
|
||||
|
||||
if ( slot == -1 )
|
||||
{
|
||||
|
|
@ -1864,14 +1868,14 @@ DefineEngineMethod( GuiShapeEdPreview, refreshThreadSequences, void, (),,
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Mounting
|
||||
DefineEngineMethod( GuiShapeEdPreview, mountShape, bool, ( const char* shapePath, const char* nodeName, const char* type, S32 slot ),,
|
||||
DefineEngineMethod( GuiShapeEdPreview, mountShape, bool, ( const char* shapeAssetId, const char* nodeName, const char* type, S32 slot ),,
|
||||
"Mount a shape onto the main shape at the specified node\n\n"
|
||||
"@param shapePath path to the shape to mount\n"
|
||||
"@param shapeAssetId AssetId of the shape to mount\n"
|
||||
"@param nodeName name of the node on the main shape to mount to\n"
|
||||
"@param type type of mounting to use (Object, Image or Wheel)\n"
|
||||
"@param slot mount slot\n" )
|
||||
{
|
||||
return object->mountShape( shapePath, nodeName, type, slot );
|
||||
return object->mountShape(shapeAssetId, nodeName, type, slot );
|
||||
}
|
||||
|
||||
DefineEngineMethod( GuiShapeEdPreview, setMountNode, void, ( S32 slot, const char* nodeName ),,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue