mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-26 23:05:38 +00:00
Implements a Material Instance viewer to the material editor to see a feature-filtered dump of the generated shaders for a given material.
This commit is contained in:
parent
13fb5cd5b9
commit
af14de2bb7
19 changed files with 626 additions and 12 deletions
|
|
@ -2116,6 +2116,32 @@ function MaterialEditorGui::refreshMaterial(%this)
|
|||
MaterialEditorGui.setMaterialNotDirty();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
// Looking up material instances/getting mat info
|
||||
function MaterialEditorGui::lookupMaterialInstances( %this )
|
||||
{
|
||||
if( MaterialEditorGui.currentMaterial.getName() $= "" )
|
||||
{
|
||||
MessageBoxOK("Cannot perform operation", "Unable to look up a material with a blank name" );
|
||||
return;
|
||||
}
|
||||
|
||||
MaterialInstanceViewTree.clear();
|
||||
MaterialInstanceViewTree.setFilterChildren(false);
|
||||
MaterialInstanceViewTree.setItemFilterException(1, true);
|
||||
|
||||
MaterialEditorGui.currentMaterial.getMaterialInstances(MaterialInstanceViewTree);
|
||||
|
||||
if(MaterialInstanceFilter.Text !$= "\c2Filter...")
|
||||
{
|
||||
MaterialInstanceViewTree.setFilterText(MaterialInstanceFilter.Text);
|
||||
}
|
||||
|
||||
MaterialInstanceViewTree.buildVisibleTree(true);
|
||||
|
||||
Canvas.pushDialog(MaterialInstanceViewCtrl);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
// Switching and Changing Materials
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
function MaterialInstanceFilter::onGainFirstResponder( %this )
|
||||
{
|
||||
%this.selectAllText();
|
||||
}
|
||||
|
||||
function MaterialInstanceFilter::onReturn( %this )
|
||||
{
|
||||
%text = %this.getText();
|
||||
if( %text $= "" )
|
||||
{
|
||||
%this.reset();
|
||||
MaterialInstanceViewTree.clearFilterText();
|
||||
}
|
||||
else
|
||||
{
|
||||
MaterialInstanceViewTree.setFilterText(%text);
|
||||
}
|
||||
|
||||
MaterialInstanceViewTree.buildVisibleTree(true);
|
||||
}
|
||||
|
||||
function MaterialInstanceFilterBtn::onClick(%this)
|
||||
{
|
||||
MaterialInstanceFilter.reset();
|
||||
MaterialInstanceViewTree.clearFilterText();
|
||||
MaterialInstanceViewTree.buildVisibleTree(true);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue