mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-26 23:05:38 +00:00
Fixes various reported issues with the ShapeEd update
- Updates addSequence for the TSShapeConstructor so it can properly understand if it's handed an assetId or not, and if it is, stores that as the source data for use later - Has the added benefit of ensuring no erroneous double-ups of data causing accidental overwrites when saving the shapeConstructor because it thinks the data 'changed' - Fixed saving of new added sequences in shape constructor to properly trip whitespace - Adds ability to manually trigger a ShapeAsset to load the shape data - Adjusted the logic for getting a shape/animation asset's constructor when adding a new sequence to avoid false reporting of no constructor existing(by manually loading it) - Fixed formatting on ShapeEd Anim window to properly scale - Added onWake calls for the ShapeEd select and properties windows to better prep them position/extents-wise so they should behave more consistently - Fixed issue of Not closing material editor if it was opened via the Edit Selected Material button in the ShapeEd - Fixed issue of highlighting of material not going away when ShapeEditor is closed
This commit is contained in:
parent
7a0ae4c7af
commit
e02981c848
9 changed files with 91 additions and 50 deletions
|
|
@ -147,17 +147,20 @@ function ShapeEditor::getSequenceSource( %this, %seqName )
|
|||
if ( %src0 $= "" )
|
||||
%source = setField( %source, 0, %seqName );
|
||||
|
||||
%aq = new AssetQuery();
|
||||
%foundAssets = AssetDatabase.findAssetLooseFile(%aq, %src0);
|
||||
if(%foundAssets != 0)
|
||||
if(!AssetDatabase.isDeclaredAsset(%src0))
|
||||
{
|
||||
//if we have an assetId associated to the file, we're gunna just pass that
|
||||
//through for the edit actions
|
||||
%assetId = %aq.getAsset(0);
|
||||
|
||||
%source = setField( %source, 0, %assetId );
|
||||
%aq = new AssetQuery();
|
||||
%foundAssets = AssetDatabase.findAssetLooseFile(%aq, %src0);
|
||||
if(%foundAssets != 0)
|
||||
{
|
||||
//if we have an assetId associated to the file, we're gunna just pass that
|
||||
//through for the edit actions
|
||||
%assetId = %aq.getAsset(0);
|
||||
|
||||
%source = setField( %source, 0, %assetId );
|
||||
}
|
||||
%aq.delete();
|
||||
}
|
||||
%aq.delete();
|
||||
|
||||
return %source;
|
||||
}
|
||||
|
|
@ -1058,9 +1061,20 @@ function ShapeEdShapeView::onEditNodeTransform( %this, %node, %txfm, %gizmoID )
|
|||
//------------------------------------------------------------------------------
|
||||
// Sequence Editing
|
||||
//------------------------------------------------------------------------------
|
||||
function ShapeEdSelectWindow::onWake( %this )
|
||||
{
|
||||
%this.setPosition(Canvas.extent.x-%this.extent.x, %this.position.y);
|
||||
}
|
||||
|
||||
function ShapeEdAdvancedWindow::onWake( %this )
|
||||
{
|
||||
%this.setPosition(Canvas.extent.x-ShapeEdSelectWindow.extent.x-%this.extent.x, %this.position.y);
|
||||
}
|
||||
|
||||
function ShapeEdPropWindow::onWake( %this )
|
||||
{
|
||||
%this.setPosition(Canvas.extent.x-%this.extent.x, %this.position.y);
|
||||
|
||||
ShapeEdTriggerList.triggerId = 1;
|
||||
|
||||
ShapeEdTriggerList.addRow( -1, "-1" TAB "Frame" TAB "Trigger" TAB "State" );
|
||||
|
|
@ -1689,11 +1703,18 @@ function ShapeEdSeqNameFromMenu::onSelect( %this, %id, %text )
|
|||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function ShapeEdAnimWindow::onResize(%this)
|
||||
function ShapeEdAnimWindow::onWake(%this)
|
||||
{
|
||||
%this.doResize();
|
||||
}
|
||||
|
||||
function ShapeEdAnimWindow::doResize(%this)
|
||||
{
|
||||
if(GuiEditorGui.isAwake())
|
||||
return;
|
||||
|
||||
%animWindow = ShapeEdAnimWindow;
|
||||
%position = "1" SPC Canvas.extent.y - EditorGuiStatusBar.extent.y - %this.Extent.y;
|
||||
%position = "1" SPC Canvas.extent.y - EditorGuiStatusBar.extent.y - %this.Extent.y - 20;
|
||||
|
||||
if(isObject(ShapeEdPropWindow))
|
||||
{
|
||||
|
|
@ -1706,11 +1727,15 @@ function ShapeEdAnimWindow::onResize(%this)
|
|||
// (when the order of GUI loading has changed for example)
|
||||
%extent = Canvas.extent.x - 360 - 2 SPC %animWindow.extent.y;
|
||||
}
|
||||
|
||||
//echo("ShapeEdAnimWIndow::onWake() - " @ %position.x @ ", " @ %position.y @ ", " @ %extent.x @ ", " @ %extent.y);
|
||||
|
||||
|
||||
// resize and position accordingly
|
||||
%animWindow.resize(%position.x, %position.y, %extent.x, %extent.y);
|
||||
|
||||
}
|
||||
|
||||
function ShapeEdAnimWindow::onResize(%this)
|
||||
{
|
||||
%this.doResize();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
|
@ -2259,14 +2284,14 @@ function ShapeEdMaterials::updateSelectedMaterial( %this, %highlight )
|
|||
// Remove the highlight effect from the old selection
|
||||
if ( isObject( %this.selectedMaterial ) )
|
||||
{
|
||||
%this.selectedMaterial.diffuseMap[1] = %this.savedMap;
|
||||
%this.selectedMaterial.diffuseMapAsset[1] = %this.savedMap;
|
||||
%this.selectedMaterial.reload();
|
||||
}
|
||||
|
||||
// Apply the highlight effect to the new selected material
|
||||
%this.selectedMapTo = getField( ShapeEdMaterialList.getRowText( ShapeEdMaterialList.getSelectedRow() ), 0 );
|
||||
%this.selectedMaterial = ShapeEdMaterialList.getSelectedId();
|
||||
%this.savedMap = %this.selectedMaterial.diffuseMap[1];
|
||||
%this.savedMap = %this.selectedMaterial.diffuseMapAsset[1];
|
||||
if ( %highlight && isObject( %this.selectedMaterial ) )
|
||||
{
|
||||
%this.selectedMaterial.setDiffuseMap("ToolsModule:highlight_material_image", 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue