Material: Material appearance
Uses new material system for appearance Each feature object now has a property called ShapeMaterial that describes its physical properties. If it has a shape, it has a material. The ShapeColor attribute is replaced by a ShapeAppearance attribute. This is a material list that describes all appearance properties, not just diffuse color. As a list in can be used for all elements of a shape, such as edges and faces. A new widget is provided to allow the user to select materials in a consistent fashion. It can also launch the material editor with its more advanced capabilities.
This commit is contained in:
committed by
Chris Hennes
parent
37c38acd19
commit
ba20441935
@@ -25,8 +25,12 @@
|
||||
#endif
|
||||
|
||||
#include <Gui/Command.h>
|
||||
#include <Gui/Control.h>
|
||||
#include <Gui/MainWindow.h>
|
||||
#include <Gui/Selection.h>
|
||||
|
||||
#include "DlgDisplayPropertiesImp.h"
|
||||
#include "DlgMaterialImp.h"
|
||||
#include "MaterialSave.h"
|
||||
#include "MaterialsEditor.h"
|
||||
#include "ModelSelect.h"
|
||||
@@ -71,6 +75,64 @@ bool CmdMaterialsEdit::isActive()
|
||||
return true;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
// Std_SetAppearance
|
||||
//===========================================================================
|
||||
DEF_STD_CMD_A(StdCmdSetAppearance)
|
||||
|
||||
StdCmdSetAppearance::StdCmdSetAppearance()
|
||||
: Command("Std_SetAppearance")
|
||||
{
|
||||
sGroup = "Standard-View";
|
||||
sMenuText = QT_TR_NOOP("Appearance...");
|
||||
sToolTipText = QT_TR_NOOP("Sets the display properties of the selected object");
|
||||
sWhatsThis = "Std_SetAppearance";
|
||||
sStatusTip = QT_TR_NOOP("Sets the display properties of the selected object");
|
||||
sPixmap = "Std_SetAppearance";
|
||||
sAccel = "Ctrl+D";
|
||||
eType = Alter3DView;
|
||||
}
|
||||
|
||||
void StdCmdSetAppearance::activated(int iMsg)
|
||||
{
|
||||
Q_UNUSED(iMsg);
|
||||
Gui::Control().showDialog(new MatGui::TaskDisplayProperties());
|
||||
}
|
||||
|
||||
bool StdCmdSetAppearance::isActive()
|
||||
{
|
||||
return (Gui::Control().activeDialog() == nullptr) && (Gui::Selection().size() != 0);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
// Std_SetMaterial
|
||||
//===========================================================================
|
||||
DEF_STD_CMD_A(StdCmdSetMaterial)
|
||||
|
||||
StdCmdSetMaterial::StdCmdSetMaterial()
|
||||
: Command("Std_SetMaterial")
|
||||
{
|
||||
sGroup = "Standard-View";
|
||||
sMenuText = QT_TR_NOOP("Material...");
|
||||
sToolTipText = QT_TR_NOOP("Sets the material of the selected object");
|
||||
sWhatsThis = "Std_SetMaterial";
|
||||
sStatusTip = QT_TR_NOOP("Sets the material of the selected object");
|
||||
sPixmap = "Materials_Edit";
|
||||
// sAccel = "Ctrl+D";
|
||||
// eType = Alter3DView;
|
||||
}
|
||||
|
||||
void StdCmdSetMaterial::activated(int iMsg)
|
||||
{
|
||||
Q_UNUSED(iMsg);
|
||||
Gui::Control().showDialog(new MatGui::TaskMaterial());
|
||||
}
|
||||
|
||||
bool StdCmdSetMaterial::isActive()
|
||||
{
|
||||
return (Gui::Control().activeDialog() == nullptr) && (Gui::Selection().size() != 0);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
|
||||
void CreateMaterialCommands()
|
||||
@@ -78,4 +140,6 @@ void CreateMaterialCommands()
|
||||
Gui::CommandManager& rcCmdMgr = Gui::Application::Instance->commandManager();
|
||||
|
||||
rcCmdMgr.addCommand(new CmdMaterialsEdit());
|
||||
rcCmdMgr.addCommand(new StdCmdSetAppearance());
|
||||
rcCmdMgr.addCommand(new StdCmdSetMaterial());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user