diff options
author | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2019-06-03 14:00:07 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2019-06-03 14:01:18 +0300 |
commit | 32edde39e5b0e4fa15eda28b7b69c1f713b27850 (patch) | |
tree | c41480bbb06377f3a79d13c465a53435cccb9de4 /src/Authoring/Studio | |
parent | c36739204786bd90df6e2ef5a8be78c980240bdd (diff) | |
parent | 01cfc8025119609803b3fc00b1e8ca5bc56e84d0 (diff) |
Merge "Merge branch '2.4'"
Diffstat (limited to 'src/Authoring/Studio')
7 files changed, 51 insertions, 54 deletions
diff --git a/src/Authoring/Studio/Palettes/Action/HandlerPropertyBaseSlider.qml b/src/Authoring/Studio/Palettes/Action/HandlerPropertyBaseSlider.qml index 13e36516..7019dff2 100644 --- a/src/Authoring/Studio/Palettes/Action/HandlerPropertyBaseSlider.qml +++ b/src/Authoring/Studio/Palettes/Action/HandlerPropertyBaseSlider.qml @@ -43,8 +43,10 @@ Row { property alias desiredValue: slider.value // This is value adjusted by user property alias sliderMin: slider.from property alias sliderMax: slider.to + property real sliderDecimals: -1 property bool intSlider: false - property int decimalSlider: Math.min(precision(slider.stepSize), 3) + property int decimalSlider: sliderDecimals >= 0 ? sliderDecimals + : Math.min(precision(slider.stepSize), 3) property Item tabItem1: textField signal previewValue // Indicates desiredValue contains a preview value @@ -226,7 +228,6 @@ Row { text = sliderMin slider.value = text root.doCommitValue(); - } function setTextFieldValue() { diff --git a/src/Authoring/Studio/Palettes/Action/PropertyModel.cpp b/src/Authoring/Studio/Palettes/Action/PropertyModel.cpp index b19e2117..8024204d 100644 --- a/src/Authoring/Studio/Palettes/Action/PropertyModel.cpp +++ b/src/Authoring/Studio/Palettes/Action/PropertyModel.cpp @@ -89,8 +89,8 @@ void PropertyModel::setAction(const qt3dsdm::Qt3DSDMActionHandle &action) property.m_handle); qt3dsdm::SMetaDataRange minMax = qt3dsdm::get<qt3dsdm::SMetaDataRange>(metaDataData); - property.m_min = minMax.m_Min; - property.m_max = minMax.m_Max; + property.m_min = minMax.m_min; + property.m_max = minMax.m_max; break; } case qt3dsdm::AdditionalMetaDataType::StringList: { diff --git a/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp b/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp index 7fb01bc2..53519573 100644 --- a/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp +++ b/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp @@ -52,6 +52,7 @@ #include "Dispatch.h" #include "VariantsGroupModel.h" #include "StudioProjectSettings.h" +#include "Literals.h" #include <QtCore/qfileinfo.h> @@ -92,8 +93,8 @@ static std::pair<bool, bool> getSlideCharacteristics(qt3dsdm::Qt3DSDMInstanceHan // Get the slide from the instance. qt3dsdm::Qt3DSDMSlideHandle slide = slideCore.GetSlideByInstance(instance); qt3dsdm::Qt3DSDMSlideHandle master = slideSystem.GetMasterSlide(slide); - int index = (int)slideSystem.GetSlideIndex(slide); - int count = (int)slideSystem.GetSlideCount(master); + int index = int(slideSystem.GetSlideIndex(slide)); + int count = int(slideSystem.GetSlideCount(master)); bool hasNextSlide = index > 0 && index < count - 1; bool hasPreviousSlide = index > 1; return std::make_pair(hasNextSlide, hasPreviousSlide); @@ -127,27 +128,15 @@ CInspectableBase *InspectorControlModel::inspectable() const return m_inspectableBase; } -qt3dsdm::Qt3DSDMInstanceHandle getReferenceMaterial(CInspectableBase *inspectable) +qt3dsdm::Qt3DSDMInstanceHandle InspectorControlModel::getReferenceMaterial( + CInspectableBase *inspectable) const { - const auto bridge = g_StudioApp.GetCore()->GetDoc()->GetStudioSystem() - ->GetClientDataModelBridge(); - if (inspectable) - return bridge->getMaterialReference(inspectable->getInstance()); + return getBridge()->getMaterialReference(inspectable->getInstance()); return 0; } -CInspectableBase *getReferenceMaterialInspectable(CInspectableBase *inspectable) -{ - auto refMaterial = getReferenceMaterial(inspectable); - - if (refMaterial.Valid()) - return g_StudioApp.getInspectableFromInstance(refMaterial); - - return nullptr; -} - void InspectorControlModel::notifyPropertyChanged(qt3dsdm::Qt3DSDMInstanceHandle inInstance, qt3dsdm::Qt3DSDMPropertyHandle inProperty) { @@ -1136,7 +1125,9 @@ void InspectorControlModel::updatePropertyValue(InspectorControlBase *element) c } element->m_value = stringValue; - } // intentional fall-through for other String-derived datatypes + } + Q_FALLTHROUGH(); // fall-through for other String-derived datatypes + case qt3dsdm::DataModelDataType::StringOrInt: if (element->m_propertyType == qt3dsdm::AdditionalMetaDataType::StringList) { QStringList stringlist; @@ -1186,7 +1177,7 @@ void InspectorControlModel::updatePropertyValue(InspectorControlBase *element) c // Add the slide names (exclude the master slide) auto slideHandle = slideSystem->GetSlideByInstance(instance); auto masterSlide = slideSystem->GetMasterSlide(slideHandle); - long slideCount = (long)slideSystem->GetSlideCount(masterSlide); + long slideCount = long(slideSystem->GetSlideCount(masterSlide)); for (long slideIndex = 1; slideIndex < slideCount; ++slideIndex) { auto currentSlide = slideSystem->GetSlideByIndex(masterSlide, slideIndex); auto currentInstance = slideSystem->GetSlideInstance(currentSlide); @@ -1219,14 +1210,8 @@ void InspectorControlModel::updatePropertyValue(InspectorControlBase *element) c updateFontValues(element); skipEmits = true; // updateFontValues handles emits in correct order } else if (element->m_propertyType == qt3dsdm::AdditionalMetaDataType::Mesh) { - QString meshValue = qt3dsdm::get<QString>(value); - Q3DStudio::CFilePath theSelectionItem(Q3DStudio::CString::fromQString(meshValue)); - Q3DStudio::CFilePath theSelectionWithoutId(theSelectionItem.filePath()); - QString theSelectionWithoutIdName = theSelectionWithoutId.GetFileName().toQString(); - if (theSelectionWithoutIdName.size()) - element->m_value = theSelectionWithoutIdName; - else - element->m_value = theSelectionItem.GetIdentifier().toQString(); + QString meshValue = QFileInfo(qt3dsdm::get<QString>(value)).fileName(); + element->m_value = meshValue.startsWith('#'_L1) ? meshValue.mid(1) : meshValue; } else if (element->m_propertyType == qt3dsdm::AdditionalMetaDataType::Texture) { QFileInfo fileInfo(qt3dsdm::get<QString>(value)); element->m_value = fileInfo.fileName(); @@ -1241,14 +1226,17 @@ void InspectorControlModel::updatePropertyValue(InspectorControlBase *element) c << element->m_propertyType; } break; + case qt3dsdm::DataModelDataType::StringRef: if (element->m_propertyType == qt3dsdm::AdditionalMetaDataType::None) { element->m_value = qt3dsdm::get<QString>(value); } break; + case qt3dsdm::DataModelDataType::Bool: element->m_value = qt3dsdm::get<bool>(value); break; + case qt3dsdm::DataModelDataType::Long4: if (element->m_propertyType == qt3dsdm::AdditionalMetaDataType::Image) { qt3dsdm::Option<qt3dsdm::SLong4> guid = qt3dsdm::get<qt3dsdm::SLong4>(value); @@ -1266,6 +1254,7 @@ void InspectorControlModel::updatePropertyValue(InspectorControlBase *element) c << element->m_dataType << " " << element->m_title; } break; + case qt3dsdm::DataModelDataType::Long: if (element->m_propertyType == qt3dsdm::AdditionalMetaDataType::Range) { element->m_value = qt3dsdm::get<int>(value); @@ -1273,12 +1262,12 @@ void InspectorControlModel::updatePropertyValue(InspectorControlBase *element) c if (m_guideInspectable) { const auto prop = m_guideInspectable->properties() [handleToGuidePropIndex(element->m_property)]; - ranges.m_Min = prop->GetInspectableMin(); - ranges.m_Max = prop->GetInspectableMax(); + ranges.m_min = prop->GetInspectableMin(); + ranges.m_max = prop->GetInspectableMax(); } else { ranges = qt3dsdm::get<qt3dsdm::SMetaDataRange>(info->m_MetaDataData); } - const QList<double> rangesValues{ranges.m_Min, ranges.m_Max}; + const QList<double> rangesValues{ranges.m_min, ranges.m_max, double(ranges.m_decimals)}; element->m_values = QVariant::fromValue<QList<double> >(rangesValues); } else if (element->m_propertyType == qt3dsdm::AdditionalMetaDataType::ShadowMapResolution) { @@ -1288,6 +1277,7 @@ void InspectorControlModel::updatePropertyValue(InspectorControlBase *element) c << element->m_dataType; } break; + case qt3dsdm::DataModelDataType::Float3: if (element->m_propertyType == qt3dsdm::AdditionalMetaDataType::Color) { element->m_value = qt3dsdm::get<QColor>(value); @@ -1301,11 +1291,13 @@ void InspectorControlModel::updatePropertyValue(InspectorControlBase *element) c element->m_values = QVariant::fromValue<QList<double> >(float3Values); } break; + case qt3dsdm::DataModelDataType::Float4: if (element->m_propertyType == qt3dsdm::AdditionalMetaDataType::Color) { element->m_value = qt3dsdm::get<QColor>(value); } break; + case qt3dsdm::DataModelDataType::Float2: if (element->m_propertyType == qt3dsdm::AdditionalMetaDataType::None) { const QVector2D theFloat2 = qt3dsdm::get<QVector2D>(value); @@ -1316,18 +1308,20 @@ void InspectorControlModel::updatePropertyValue(InspectorControlBase *element) c << element->m_dataType << element->m_propertyType; } break; + case qt3dsdm::DataModelDataType::Float: if (element->m_propertyType == qt3dsdm::AdditionalMetaDataType::None) { element->m_value = qt3dsdm::get<float>(value); } else if (element->m_propertyType == qt3dsdm::AdditionalMetaDataType::Range) { element->m_value = qt3dsdm::get<float>(value); const qt3dsdm::SMetaDataRange ranges = qt3dsdm::get<qt3dsdm::SMetaDataRange>(info->m_MetaDataData); - const QList<double> rangesValues{ranges.m_Min, ranges.m_Max}; + const QList<double> rangesValues{ranges.m_min, ranges.m_max, double(ranges.m_decimals)}; element->m_values = QVariant::fromValue<QList<double> >(rangesValues); } else if (element->m_propertyType == qt3dsdm::AdditionalMetaDataType::FontSize) { element->m_value = qt3dsdm::get<float>(value); } break; + case qt3dsdm::DataModelDataType::ObjectRef: if (element->m_propertyType == qt3dsdm::AdditionalMetaDataType::ObjectRef) { IObjectReferenceHelper *objRefHelper = doc->GetDataModelObjectReferenceHelper(); @@ -1347,6 +1341,7 @@ void InspectorControlModel::updatePropertyValue(InspectorControlBase *element) c } } break; + default: qWarning() << "TODO: InspectorControlModel::updatePropertyValue: I've no idea how to handle this datatype" << element->m_dataType; diff --git a/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.h b/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.h index e2f12831..3063f047 100644 --- a/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.h +++ b/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.h @@ -219,6 +219,7 @@ private: bool isBasicMaterial(CInspectableBase *inspectable) const; void updateMaterialValues(const QStringList &values, int elementIndex, bool updatingShaders = false); + qt3dsdm::Qt3DSDMInstanceHandle getReferenceMaterial(CInspectableBase *inspectable) const; void updateShaderValues(); void updateMatDataValues(); void updatePropertyValue(InspectorControlBase *element) const; diff --git a/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.qml b/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.qml index ebb56023..c291de7b 100644 --- a/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.qml +++ b/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.qml @@ -777,6 +777,7 @@ Rectangle { value: parent.modelData.value sliderMin: values[0] sliderMax: values[1] + sliderDecimals: values[2] onCommitValue: _inspectorModel.setPropertyValue(instance, handle, desiredValue, true) onPreviewValue: _inspectorModel.setPropertyValue(instance, handle, desiredValue, false) diff --git a/src/Authoring/Studio/Qt3DStudio.pro b/src/Authoring/Studio/Qt3DStudio.pro index 160647c9..3a80df6d 100644 --- a/src/Authoring/Studio/Qt3DStudio.pro +++ b/src/Authoring/Studio/Qt3DStudio.pro @@ -54,7 +54,6 @@ INCLUDEPATH += \ .. \ ../QT3DSIMP/Qt3DSImportLib \ ../QT3DSIMP/Qt3DSImportSGTranslation \ - ../QT3DSDM/Systems \ ../Common/Code/Thread \ ../Common/Code/IO \ ../Common/Code \ @@ -73,15 +72,17 @@ INCLUDEPATH += \ ../Client/Code/Core/Doc/ClientDataModelBridge \ ../Client/Code/Shared \ ../Client/Code/Shared/Log \ - ../../Runtime/Source/render \ - ../../Runtime/Source/foundation \ - ../../Runtime/Source/runtimerender \ - ../../Runtime/Source/runtimerender/graphobjects \ - ../../Runtime/Source/runtimerender/resourcemanager \ - ../../Runtime/Source/event \ - ../../3rdparty/EASTL/UnknownVersion/include \ - ../../3rdparty/color \ - ../../QtExtras/qmlstreamer + ../../Runtime/ogl-runtime/src/importlib \ + ../../Runtime/ogl-runtime/src/dm/systems \ + ../../Runtime/ogl-runtime/src/render \ + ../../Runtime/ogl-runtime/src/foundation \ + ../../Runtime/ogl-runtime/src/runtimerender \ + ../../Runtime/ogl-runtime/src/runtimerender/graphobjects \ + ../../Runtime/ogl-runtime/src/runtimerender/resourcemanager \ + ../../Runtime/ogl-runtime/src/event \ + ../../Runtime/ogl-runtime/src/3rdparty/EASTL/UnknownVersion/include \ + ../../Runtime/ogl-runtime/src/3rdparty/color \ + ../../Runtime/ogl-runtime/src/qmlstreamer linux { BEGIN_ARCHIVE = -Wl,--whole-archive @@ -176,7 +177,6 @@ HEADERS += \ Palettes/TimelineGraphicsView/KeyframeManager.h \ Palettes/TimelineGraphicsView/RowManager.h \ Palettes/TimelineGraphicsView/RowMover.h \ - Palettes/TimelineGraphicsView/rowtypes.h \ Palettes/TimelineGraphicsView/SelectionRect.h \ Palettes/TimelineGraphicsView/TimelineConstants.h \ Palettes/TimelineGraphicsView/TimelineControl.h \ @@ -470,6 +470,13 @@ CONFIG += exceptions target.path = $$[QT_INSTALL_BINS] INSTALLS += target +# Install FBX SDK library for Linux +linux:!isEmpty(QMAKE_LIBS_FBX) { + fbxsdk.files = $$str_member($$last(QMAKE_LIBS_FBX), 2, -1)/libfbxsdk.so + fbxsdk.path = $$[QT_INSTALL_LIBS] + INSTALLS += fbxsdk +} + RC_ICONS = images/3D-studio.ico ICON = images/studio.icns diff --git a/src/Authoring/Studio/Render/StudioSubPresentationRenderer.cpp b/src/Authoring/Studio/Render/StudioSubPresentationRenderer.cpp index 4e09dbf9..76e5f3c3 100644 --- a/src/Authoring/Studio/Render/StudioSubPresentationRenderer.cpp +++ b/src/Authoring/Studio/Render/StudioSubPresentationRenderer.cpp @@ -115,11 +115,7 @@ public: m_surfaceViewer->setUpdateInterval(-1); m_surfaceViewer->presentation()->setSource(QUrl::fromLocalFile(info.absoluteFilePath())); m_surfaceViewer->settings()->setMatteColor(Qt::transparent); -#ifdef Q3DS_PREVIEW_SUBPRESENTATION_RT2 m_surfaceViewer->create(m_surface.data(), m_context.data(), m_fbo->handle()); -#else - m_surfaceViewer->initialize(m_surface.data(), m_context.data(), m_fbo->handle()); -#endif m_running = true; m_semaphore.release(); @@ -157,11 +153,7 @@ public: m_context->doneCurrent(); m_context.reset(); #endif -#ifdef Q3DS_PREVIEW_SUBPRESENTATION_RT2 m_surfaceViewer->destroy(); -#else - m_surfaceViewer->shutdown(); -#endif m_surfaceViewer.reset(); m_surface->moveToThread(m_mainThread); m_semaphore.release(); |