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:
Areloch 2019-05-17 01:48:45 -05:00
parent 54b4d2eaaf
commit 2479d388f2
19 changed files with 626 additions and 12 deletions

View file

@ -36,7 +36,7 @@
#include "sfx/sfxTypes.h"
#include "core/util/safeDelete.h"
#include "T3D/accumulationVolume.h"
#include "gui/controls/guiTreeViewCtrl.h"
IMPLEMENT_CONOBJECT( Material );
@ -647,6 +647,12 @@ DefineEngineMethod( Material, dumpInstances, void, (),,
MATMGR->dumpMaterialInstances( object );
}
DefineEngineMethod(Material, getMaterialInstances, void, (GuiTreeViewCtrl* matTree), (nullAsType< GuiTreeViewCtrl*>()),
"Dumps a formatted list of the currently allocated material instances for this material to the console.")
{
MATMGR->getMaterialInstances(object, matTree);
}
DefineEngineMethod( Material, getAnimFlags, const char*, (U32 id), , "" )
{
char * animFlags = Con::getReturnBuffer(512);
@ -706,6 +712,13 @@ DefineEngineMethod( Material, setAutoGenerated, void, (bool isAutoGenerated), ,
object->setAutoGenerated(isAutoGenerated);
}
DefineEngineMethod(Material, getAutogeneratedFile, const char*, (), , "Get filename of autogenerated shader file")
{
SimObject *material = static_cast<SimObject *>(object);
return material->getFilename();
}
// Accumulation
bool Material::_setAccuEnabled( void *object, const char *index, const char *data )
{