mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 15:14:35 +00:00
Implements misc fixes for the particle editor and particlesList inspector field
- Clicking the [...] button from the Particle Emitter tab now opens to the Particle tab *and* properly selects the particle data to be edited - Selecting an emitter object in the map and opening the particle editor now selects the Particle Data to be edited - Selecting a new Particle Data for a particles slot on a Particle Emitter in the editor now correctly updates the values and updates the field display - Made it so if clicking [...] button on the ParticleEmitterData or other similar fields for objects, it will now open to the Particle editor instead of the Datablock editor
This commit is contained in:
parent
12dddd07b5
commit
defbaea2fe
7 changed files with 145 additions and 45 deletions
|
|
@ -113,6 +113,19 @@ function ParticleEditorPlugin::onActivated( %this )
|
|||
EditorGuiStatusBar.setInfo( "Particle editor." );
|
||||
EditorGuiStatusBar.setSelection( "" );
|
||||
|
||||
// Try to start with the object selected in the world editor
|
||||
%count = EWorldEditor.getSelectionSize();
|
||||
for (%i = 0; %i < %count; %i++)
|
||||
{
|
||||
%obj = EWorldEditor.getSelectedObject(%i);
|
||||
%datablock = ParticleEditor.getObjectParticleData(%obj);
|
||||
if (%datablock !$= "" && isObject(%datablock))
|
||||
{
|
||||
ParticleEditor.open(%datablock);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Parent::onActivated( %this );
|
||||
}
|
||||
|
||||
|
|
@ -213,3 +226,12 @@ function ParticleEditor::registerParticleEdType(%this, %groupName, %typesList, %
|
|||
PE_ParticleDataTypes.add(%groupName, %typesList TAB %editorName);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function ParticleEditor::getObjectParticleData( %this, %obj )
|
||||
{
|
||||
%datablock = "";
|
||||
if ( %obj.isMemberOfClass( "ParticleEmitterNode" ) )
|
||||
%datablock = %obj.emitter;
|
||||
|
||||
return %datablock;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue