Change background opacity of pose editor

When one pose consists of multiple frames, each frame will be hardly see when the opacity is 0.25, this commit change the opacity to 0.5 in pose editor, however, leave it as 0.25 in main modeling interface.
master
Jeremy Hu 2018-12-16 14:59:22 +09:30
parent ff65a24f32
commit ef82f2cc6f
4 changed files with 14 additions and 4 deletions

View File

@ -11,8 +11,8 @@
#include "snapshot.h"
#include "snapshotxml.h"
const float PoseDocument::m_nodeRadius = 0.01;
const float PoseDocument::m_groundPlaneHalfThickness = 0.01 / 4;
const float PoseDocument::m_nodeRadius = 0.005;
const float PoseDocument::m_groundPlaneHalfThickness = 0.005 / 4;
const bool PoseDocument::m_hideRootAndVirtual = true;
const float PoseDocument::m_outcomeScaleFactor = 0.5;

View File

@ -40,6 +40,7 @@ PoseEditWidget::PoseEditWidget(const Document *document, QWidget *parent) :
SkeletonGraphicsWidget *graphicsWidget = new SkeletonGraphicsWidget(m_poseDocument);
graphicsWidget->setNodePositionModifyOnly(true);
graphicsWidget->setBackgroundBlur(0.5);
m_poseGraphicsWidget = graphicsWidget;
initShortCuts(this, graphicsWidget);

View File

@ -46,7 +46,8 @@ SkeletonGraphicsWidget::SkeletonGraphicsWidget(const SkeletonDocument *document)
m_modelWidget(nullptr),
m_inTempDragMode(false),
m_modeBeforeEnterTempDragMode(SkeletonDocumentEditMode::Select),
m_nodePositionModifyOnly(false)
m_nodePositionModifyOnly(false),
m_turnaroundOpacity(0.25)
{
setRenderHint(QPainter::Antialiasing, false);
setBackgroundBrush(QBrush(QWidget::palette().color(QWidget::backgroundRole()), Qt::SolidPattern));
@ -98,7 +99,7 @@ void SkeletonGraphicsWidget::setModelWidget(ModelWidget *modelWidget)
void SkeletonGraphicsWidget::enableBackgroundBlur()
{
m_backgroundItem->setOpacity(0.25);
m_backgroundItem->setOpacity(m_turnaroundOpacity);
}
void SkeletonGraphicsWidget::disableBackgroundBlur()
@ -106,6 +107,12 @@ void SkeletonGraphicsWidget::disableBackgroundBlur()
m_backgroundItem->setOpacity(1);
}
void SkeletonGraphicsWidget::setBackgroundBlur(float turnaroundOpacity)
{
m_turnaroundOpacity = turnaroundOpacity;
m_backgroundItem->setOpacity(m_turnaroundOpacity);
}
void SkeletonGraphicsWidget::showContextMenu(const QPoint &pos)
{
if (SkeletonDocumentEditMode::Add == m_document->editMode) {

View File

@ -468,6 +468,7 @@ public slots:
void addSelectEdge(QUuid edgeId);
void enableBackgroundBlur();
void disableBackgroundBlur();
void setBackgroundBlur(float turnaroundOpacity);
void ikMove(QUuid endEffectorId, QVector3D target);
void ikMoveReady();
void setSelectedNodesBoneMark(BoneMark boneMark);
@ -563,6 +564,7 @@ private: //need initalize
bool m_inTempDragMode;
SkeletonDocumentEditMode m_modeBeforeEnterTempDragMode;
bool m_nodePositionModifyOnly;
float m_turnaroundOpacity;
private:
QVector3D m_ikMoveTarget;
QUuid m_ikMoveEndEffectorId;