Material: MaterialTreeWidget usability enhancements
Improves the MaterialTreeWidget beyond minimum viable product. - Filters can now be filter lists to allow a variety of filtering options. - User preferences allow the inclusion/exclusion of favorites and recents. - Widget state such as expansion, tree expansions, etc are saved and restored. - show current appearancee material when editing. - implements a python interface #fixes 13421: always opens full tree
This commit is contained in:
committed by
Chris Hennes
parent
9101454c4d
commit
9f43b0ff76
@@ -34,6 +34,8 @@
|
||||
#include "DlgSettingsMaterial.h"
|
||||
#include "Workbench.h"
|
||||
#include "WorkbenchManipulator.h"
|
||||
#include "MaterialTreeWidget.h"
|
||||
#include "MaterialTreeWidgetPy.h"
|
||||
|
||||
// use a different name to CreateCommand()
|
||||
void CreateMaterialCommands();
|
||||
@@ -78,7 +80,7 @@ PyMOD_INIT_FUNC(MatGui)
|
||||
|
||||
// load needed modules
|
||||
try {
|
||||
Base::Interpreter().runString("import Material");
|
||||
Base::Interpreter().runString("import Materials");
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
PyErr_SetString(PyExc_ImportError, e.what());
|
||||
@@ -107,5 +109,18 @@ PyMOD_INIT_FUNC(MatGui)
|
||||
// add resources and reloads the translators
|
||||
loadMaterialResource();
|
||||
|
||||
Base::Interpreter().addType(&MatGui::MaterialTreeWidgetPy::Type,
|
||||
matGuiModule,
|
||||
"MaterialTreeWidget");
|
||||
|
||||
|
||||
// Initialize types
|
||||
|
||||
MatGui::MaterialTreeWidget::init();
|
||||
|
||||
// Add custom widgets
|
||||
new Gui::WidgetProducer<MatGui::MaterialTreeWidget>;
|
||||
|
||||
|
||||
PyMOD_Return(matGuiModule);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user