Only allow heightfield brushes on heightfield attributes.

This commit is contained in:
Andrzej Kapolka 2014-08-18 18:29:19 -07:00
parent 5b8ff07449
commit 23a4c21ce1
2 changed files with 6 additions and 0 deletions

View file

@ -1101,6 +1101,10 @@ HeightfieldBrushTool::HeightfieldBrushTool(MetavoxelEditor* editor, const QStrin
_radius->setValue(1.0);
}
bool HeightfieldBrushTool::appliesTo(const AttributePointer& attribute) const {
return attribute->inherits("HeightfieldAttribute");
}
void HeightfieldBrushTool::render() {
if (Application::getInstance()->isMouseHidden()) {
return;

View file

@ -312,6 +312,8 @@ public:
HeightfieldBrushTool(MetavoxelEditor* editor, const QString& name);
virtual bool appliesTo(const AttributePointer& attribute) const;
virtual void render();
virtual bool eventFilter(QObject* watched, QEvent* event);