diff --git a/src/meshgenerator.cpp b/src/meshgenerator.cpp index 0faf701f..693ce4ac 100644 --- a/src/meshgenerator.cpp +++ b/src/meshgenerator.cpp @@ -223,34 +223,18 @@ void MeshGenerator::process() zMirroredMeshId = meshlite_mirror_in_z(meshliteContext, meshId, 0); } } - //bool subdived = isTrueValueString(valueOfKeyInMapOrEmpty(part->second, "subdived")); - bool subdived = false; if (m_requirePartPreviewMap.find(partIdIt) != m_requirePartPreviewMap.end()) { ModelOfflineRender *render = m_partPreviewRenderMap[partIdIt]; int trimedMeshId = meshlite_trim(meshliteContext, meshId, 1); - if (subdived) { - int subdivedMeshId = subdivMesh(meshliteContext, trimedMeshId); - if (subdivedMeshId > 0) { - trimedMeshId = subdivedMeshId; - } - } render->updateMesh(new Mesh(meshliteContext, trimedMeshId)); QImage *image = new QImage(render->toImage(QSize(Theme::previewImageSize, Theme::previewImageSize))); m_partPreviewMap[partIdIt] = image; } - if (subdived) { - subdivMeshIds.push_back(meshId); - if (xMirroredMeshId) - subdivMeshIds.push_back(xMirroredMeshId); - if (zMirroredMeshId) - subdivMeshIds.push_back(zMirroredMeshId); - } else { - meshIds.push_back(meshId); - if (xMirroredMeshId) - meshIds.push_back(xMirroredMeshId); - if (zMirroredMeshId) - meshIds.push_back(zMirroredMeshId); - } + meshIds.push_back(meshId); + if (xMirroredMeshId) + meshIds.push_back(xMirroredMeshId); + if (zMirroredMeshId) + meshIds.push_back(zMirroredMeshId); } if (!subdivMeshIds.empty()) { diff --git a/src/modelofflinerender.cpp b/src/modelofflinerender.cpp index ff3ef06b..f820f983 100644 --- a/src/modelofflinerender.cpp +++ b/src/modelofflinerender.cpp @@ -54,8 +54,10 @@ QImage ModelOfflineRender::toImage(const QSize &size) m_context->functions()->glViewport(0, 0, size.width(), size.height()); if (nullptr != m_mesh) { - int xRot = -30 * 16; - int yRot = 45 * 16; + //int xRot = -30 * 16; + //int yRot = 45 * 16; + int xRot = 0; + int yRot = 0; int zRot = 0; QMatrix4x4 proj; QMatrix4x4 camera; @@ -74,7 +76,7 @@ QImage ModelOfflineRender::toImage(const QSize &size) m_context->functions()->glEnable(GL_LINE_SMOOTH); camera.setToIdentity(); - camera.translate(0, 0, -2.1); + camera.translate(0, 0, -3.0); world.setToIdentity(); world.rotate(180.0f - (xRot / 16.0f), 1, 0, 0); diff --git a/src/skeletondocument.h b/src/skeletondocument.h index 4af46f75..3b6242ee 100644 --- a/src/skeletondocument.h +++ b/src/skeletondocument.h @@ -82,6 +82,10 @@ public: { id = withId.isNull() ? QUuid::createUuid() : withId; } + bool isEditVisible() const + { + return visible && !disabled; + } void copyAttributes(const SkeletonPart &other) { visible = other.visible; diff --git a/src/skeletondocumentwindow.cpp b/src/skeletondocumentwindow.cpp index 5da26f16..e04dd966 100644 --- a/src/skeletondocumentwindow.cpp +++ b/src/skeletondocumentwindow.cpp @@ -385,6 +385,7 @@ SkeletonDocumentWindow::SkeletonDocumentWindow() : connect(m_document, &SkeletonDocument::nodeRadiusChanged, graphicsWidget, &SkeletonGraphicsWidget::nodeRadiusChanged); connect(m_document, &SkeletonDocument::nodeOriginChanged, graphicsWidget, &SkeletonGraphicsWidget::nodeOriginChanged); connect(m_document, &SkeletonDocument::partVisibleStateChanged, graphicsWidget, &SkeletonGraphicsWidget::partVisibleStateChanged); + connect(m_document, &SkeletonDocument::partDisableStateChanged, graphicsWidget, &SkeletonGraphicsWidget::partVisibleStateChanged); connect(m_document, &SkeletonDocument::cleanup, graphicsWidget, &SkeletonGraphicsWidget::removeAllContent); connect(m_document, &SkeletonDocument::originChanged, graphicsWidget, &SkeletonGraphicsWidget::originChanged); diff --git a/src/skeletongraphicswidget.cpp b/src/skeletongraphicswidget.cpp index 57cc87b0..23d4222e 100644 --- a/src/skeletongraphicswidget.cpp +++ b/src/skeletongraphicswidget.cpp @@ -1278,16 +1278,16 @@ void SkeletonGraphicsWidget::partVisibleStateChanged(QUuid partId) qDebug() << "Edge item not found:" << *edgeIt; continue; } - edgeItemIt->second.first->setVisible(part->visible); - edgeItemIt->second.second->setVisible(part->visible); + edgeItemIt->second.first->setVisible(part->isEditVisible()); + edgeItemIt->second.second->setVisible(part->isEditVisible()); } auto nodeItemIt = nodeItemMap.find(nodeId); if (nodeItemIt == nodeItemMap.end()) { qDebug() << "Node item not found:" << nodeId; continue; } - nodeItemIt->second.first->setVisible(part->visible); - nodeItemIt->second.second->setVisible(part->visible); + nodeItemIt->second.first->setVisible(part->isEditVisible()); + nodeItemIt->second.second->setVisible(part->isEditVisible()); } } diff --git a/src/skeletonpartlistwidget.cpp b/src/skeletonpartlistwidget.cpp index e90e061b..72f7f934 100644 --- a/src/skeletonpartlistwidget.cpp +++ b/src/skeletonpartlistwidget.cpp @@ -9,28 +9,28 @@ SkeletonPartWidget::SkeletonPartWidget(const SkeletonDocument *document, QUuid p m_partId(partId) { m_visibleButton = new QPushButton(); - updateButton(m_visibleButton, QChar(fa::eye), false); initButton(m_visibleButton); + updateVisibleButton(); m_lockButton = new QPushButton(); - updateButton(m_lockButton, QChar(fa::unlock), false); initButton(m_lockButton); + updateLockButton(); m_subdivButton = new QPushButton(); - updateButton(m_subdivButton, QChar(fa::cube), false); initButton(m_subdivButton); + updateSubdivButton(); m_disableButton = new QPushButton(); - updateButton(m_disableButton, QChar(fa::toggleon), false); initButton(m_disableButton); + updateDisableButton(); m_xMirrorButton = new QPushButton(); - updateButton(m_xMirrorButton, QChar(fa::quoteleft), false); initButton(m_xMirrorButton); + updateXmirrorButton(); m_zMirrorButton = new QPushButton(); - updateButton(m_zMirrorButton, QChar(fa::quoteright), false); initButton(m_zMirrorButton); + updateZmirrorButton(); m_previewLabel = new QLabel; @@ -139,7 +139,7 @@ void SkeletonPartWidget::updateButton(QPushButton *button, QChar icon, bool high { button->setText(icon); if (highlighted) - button->setStyleSheet("QPushButton {border: none; background: none; color: #f7d9c8;}"); + button->setStyleSheet("QPushButton {border: none; background: none; color: #925935;}"); else button->setStyleSheet("QPushButton {border: none; background: none; color: #252525;}"); } @@ -188,9 +188,9 @@ void SkeletonPartWidget::updateSubdivButton() return; } if (part->subdived) - updateButton(m_subdivButton, QChar(fa::connectdevelop), true); + updateButton(m_subdivButton, QChar(fa::circle), true); else - updateButton(m_subdivButton, QChar(fa::cube), false); + updateButton(m_subdivButton, QChar(fa::square), false); } void SkeletonPartWidget::updateDisableButton() @@ -214,9 +214,9 @@ void SkeletonPartWidget::updateXmirrorButton() return; } if (part->xMirrored) - updateButton(m_xMirrorButton, QChar(fa::quoteleft), true); + updateButton(m_xMirrorButton, QChar(fa::balancescale), true); else - updateButton(m_xMirrorButton, QChar(fa::quoteleft), false); + updateButton(m_xMirrorButton, QChar(fa::balancescale), false); } void SkeletonPartWidget::updateZmirrorButton() @@ -227,9 +227,9 @@ void SkeletonPartWidget::updateZmirrorButton() return; } if (part->zMirrored) - updateButton(m_zMirrorButton, QChar(fa::quoteright), true); + updateButton(m_zMirrorButton, QChar(fa::balancescale), true); else - updateButton(m_zMirrorButton, QChar(fa::quoteright), false); + updateButton(m_zMirrorButton, QChar(fa::balancescale), false); } void SkeletonPartWidget::reload()