mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 05:17:08 +02:00
Merge branch 'tablet-ui' into 21197
This commit is contained in:
commit
2e96b8a59b
18 changed files with 221 additions and 65 deletions
|
@ -36,7 +36,7 @@ Slider {
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width: parent.height - 2
|
width: parent.height - 2
|
||||||
height: slider.value * slider.width - 1
|
height: slider.value * (slider.width/(slider.maximumValue - slider.minimumValue)) - 1
|
||||||
radius: height / 2
|
radius: height / 2
|
||||||
anchors {
|
anchors {
|
||||||
top: parent.top
|
top: parent.top
|
||||||
|
|
119
interface/resources/qml/hifi/dialogs/TabletLODTools.qml
Normal file
119
interface/resources/qml/hifi/dialogs/TabletLODTools.qml
Normal file
|
@ -0,0 +1,119 @@
|
||||||
|
//
|
||||||
|
// TabletLODTools.qml
|
||||||
|
//
|
||||||
|
// Created by Vlad Stelmahovsky on 3/11/17
|
||||||
|
// Copyright 2017 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
import QtQuick 2.5
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
|
import Qt.labs.settings 1.0
|
||||||
|
|
||||||
|
import "../../styles-uit"
|
||||||
|
import "../../controls-uit" as HifiControls
|
||||||
|
import "../../windows"
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: root
|
||||||
|
objectName: "LODTools"
|
||||||
|
|
||||||
|
property var eventBridge;
|
||||||
|
signal sendToScript(var message);
|
||||||
|
property bool isHMD: false
|
||||||
|
|
||||||
|
color: hifi.colors.baseGray
|
||||||
|
|
||||||
|
property int colorScheme: hifi.colorSchemes.dark
|
||||||
|
|
||||||
|
HifiConstants { id: hifi }
|
||||||
|
|
||||||
|
readonly property real treeScale: 32768; // ~20 miles.. This is the number of meters of the 0.0 to 1.0 voxel universe
|
||||||
|
readonly property real halfTreeScale: treeScale / 2;
|
||||||
|
|
||||||
|
// This controls the LOD. Larger number will make smaller voxels visible at greater distance.
|
||||||
|
readonly property real defaultOctreeSizeScale: treeScale * 400.0
|
||||||
|
|
||||||
|
Column {
|
||||||
|
anchors.margins: 10
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
y: hifi.dimensions.tabletMenuHeader //-bgNavBar
|
||||||
|
spacing: 20
|
||||||
|
|
||||||
|
HifiControls.Label {
|
||||||
|
size: 20
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
text: qsTr("You can see...")
|
||||||
|
colorScheme: root.colorScheme
|
||||||
|
}
|
||||||
|
HifiControls.Label {
|
||||||
|
id: whatYouCanSeeLabel
|
||||||
|
color: "red"
|
||||||
|
size: 20
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
colorScheme: root.colorScheme
|
||||||
|
}
|
||||||
|
Row {
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
spacing: 10
|
||||||
|
|
||||||
|
HifiControls.Label {
|
||||||
|
size: 20
|
||||||
|
text: qsTr("Manually Adjust Level of Detail:")
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
colorScheme: root.colorScheme
|
||||||
|
}
|
||||||
|
|
||||||
|
HifiControls.CheckBox {
|
||||||
|
id: adjustCheckbox
|
||||||
|
boxSize: 20
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
onCheckedChanged: LODManager.setAutomaticLODAdjust(!checked);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HifiControls.Label {
|
||||||
|
size: 20
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
text: qsTr("Level of Detail:")
|
||||||
|
colorScheme: root.colorScheme
|
||||||
|
}
|
||||||
|
HifiControls.Slider {
|
||||||
|
id: slider
|
||||||
|
enabled: adjustCheckbox.checked
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
minimumValue: 5
|
||||||
|
maximumValue: 2000
|
||||||
|
value: LODManager.getOctreeSizeScale() / treeScale
|
||||||
|
tickmarksEnabled: false
|
||||||
|
onValueChanged: {
|
||||||
|
LODManager.setOctreeSizeScale(value * treeScale);
|
||||||
|
whatYouCanSeeLabel.text = LODManager.getLODFeedbackText()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HifiControls.Button {
|
||||||
|
id: uploadButton
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
text: qsTr("Reset")
|
||||||
|
color: hifi.buttons.blue
|
||||||
|
colorScheme: root.colorScheme
|
||||||
|
height: 30
|
||||||
|
onClicked: {
|
||||||
|
slider.value = defaultOctreeSizeScale/treeScale
|
||||||
|
adjustCheckbox.checked = false
|
||||||
|
LODManager.setAutomaticLODAdjust(adjustCheckbox.checked);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ import "../../windows"
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
objectName: "RunningScripts"
|
objectName: "RunningScripts"
|
||||||
|
property var title: "Running Scripts"
|
||||||
HifiConstants { id: hifi }
|
HifiConstants { id: hifi }
|
||||||
signal sendToScript(var message);
|
signal sendToScript(var message);
|
||||||
property var eventBridge;
|
property var eventBridge;
|
||||||
|
|
|
@ -19,7 +19,7 @@ StackView {
|
||||||
id: profileRoot
|
id: profileRoot
|
||||||
initialItem: root
|
initialItem: root
|
||||||
objectName: "stack"
|
objectName: "stack"
|
||||||
|
property var title: "Audio Preferences"
|
||||||
property var eventBridge;
|
property var eventBridge;
|
||||||
signal sendToScript(var message);
|
signal sendToScript(var message);
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ StackView {
|
||||||
id: profileRoot
|
id: profileRoot
|
||||||
initialItem: root
|
initialItem: root
|
||||||
objectName: "stack"
|
objectName: "stack"
|
||||||
|
property var title: "Avatar Preferences"
|
||||||
property var eventBridge;
|
property var eventBridge;
|
||||||
signal sendToScript(var message);
|
signal sendToScript(var message);
|
||||||
|
|
||||||
|
|
|
@ -19,10 +19,11 @@ StackView {
|
||||||
id: profileRoot
|
id: profileRoot
|
||||||
initialItem: root
|
initialItem: root
|
||||||
objectName: "stack"
|
objectName: "stack"
|
||||||
|
property var title: "General Prefernces"
|
||||||
|
|
||||||
property var eventBridge;
|
property var eventBridge;
|
||||||
signal sendToScript(var message);
|
signal sendToScript(var message);
|
||||||
|
|
||||||
function pushSource(path) {
|
function pushSource(path) {
|
||||||
editRoot.push(Qt.reslovedUrl(path));
|
editRoot.push(Qt.reslovedUrl(path));
|
||||||
}
|
}
|
||||||
|
|
34
interface/resources/qml/hifi/tablet/TabletLodPreferences.qml
Normal file
34
interface/resources/qml/hifi/tablet/TabletLodPreferences.qml
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
import QtQuick 2.5
|
||||||
|
import Qt.labs.settings 1.0
|
||||||
|
|
||||||
|
import "tabletWindows"
|
||||||
|
import "../../dialogs"
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
|
import QtQuick.Controls.Styles 1.4
|
||||||
|
import QtGraphicalEffects 1.0
|
||||||
|
|
||||||
|
StackView {
|
||||||
|
id: profileRoot
|
||||||
|
initialItem: root
|
||||||
|
objectName: "stack"
|
||||||
|
|
||||||
|
property var eventBridge;
|
||||||
|
signal sendToScript(var message);
|
||||||
|
|
||||||
|
function pushSource(path) {
|
||||||
|
editRoot.push(Qt.reslovedUrl(path));
|
||||||
|
}
|
||||||
|
|
||||||
|
function popSource() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
TabletPreferencesDialog {
|
||||||
|
id: root
|
||||||
|
property string title: "LOD Settings"
|
||||||
|
objectName: "TabletLodPreferences"
|
||||||
|
width: parent.width
|
||||||
|
height: parent.height
|
||||||
|
showCategories: ["Level of Detail Tuning"]
|
||||||
|
}
|
||||||
|
}
|
|
@ -51,7 +51,7 @@ Item {
|
||||||
d.push(Qt.resolvedUrl(path));
|
d.push(Qt.resolvedUrl(path));
|
||||||
d.currentItem.eventBridge = tabletMenu.eventBridge
|
d.currentItem.eventBridge = tabletMenu.eventBridge
|
||||||
d.currentItem.sendToScript.connect(tabletMenu.sendToScript);
|
d.currentItem.sendToScript.connect(tabletMenu.sendToScript);
|
||||||
breadcrumbText.text = d.currentItem.objectName;
|
breadcrumbText.text = d.currentItem.title;
|
||||||
}
|
}
|
||||||
|
|
||||||
function popSource() {
|
function popSource() {
|
||||||
|
|
|
@ -19,7 +19,7 @@ StackView {
|
||||||
id: profileRoot
|
id: profileRoot
|
||||||
initialItem: root
|
initialItem: root
|
||||||
objectName: "stack"
|
objectName: "stack"
|
||||||
|
property var title: "Network Preferences"
|
||||||
property var eventBridge;
|
property var eventBridge;
|
||||||
signal sendToScript(var message);
|
signal sendToScript(var message);
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,8 @@ import "../../../controls-uit" as HifiControls
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: dialog
|
id: dialog
|
||||||
width: 480
|
width: parent.width
|
||||||
height: 720
|
height: parent.height
|
||||||
|
|
||||||
HifiConstants { id: hifi }
|
HifiConstants { id: hifi }
|
||||||
property var sections: []
|
property var sections: []
|
||||||
|
@ -31,6 +31,7 @@ Item {
|
||||||
property bool keyboardEnabled: false
|
property bool keyboardEnabled: false
|
||||||
property bool keyboardRaised: false
|
property bool keyboardRaised: false
|
||||||
property bool punctuationMode: false
|
property bool punctuationMode: false
|
||||||
|
|
||||||
|
|
||||||
property var tablet;
|
property var tablet;
|
||||||
|
|
||||||
|
@ -68,22 +69,11 @@ Item {
|
||||||
}
|
}
|
||||||
z: 100
|
z: 100
|
||||||
|
|
||||||
gradient: Gradient {
|
color: hifi.colors.darkGray
|
||||||
GradientStop {
|
|
||||||
position: 0
|
|
||||||
color: "#2b2b2b"
|
|
||||||
}
|
|
||||||
|
|
||||||
GradientStop {
|
|
||||||
position: 1
|
|
||||||
color: "#1e1e1e"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RalewayBold {
|
RalewayBold {
|
||||||
text: title
|
text: title
|
||||||
size: 26
|
size: 26
|
||||||
color: "#34a2c7"
|
color: hifi.colors.white
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: hifi.dimensions.contentMargin.x
|
anchors.leftMargin: hifi.dimensions.contentMargin.x
|
||||||
|
@ -99,17 +89,8 @@ Item {
|
||||||
right: parent.right
|
right: parent.right
|
||||||
}
|
}
|
||||||
|
|
||||||
gradient: Gradient {
|
color: hifi.colors.baseGray
|
||||||
GradientStop {
|
|
||||||
position: 0
|
|
||||||
color: "#2b2b2b"
|
|
||||||
}
|
|
||||||
|
|
||||||
GradientStop {
|
|
||||||
position: 1
|
|
||||||
color: "#0f212e"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Flickable {
|
Flickable {
|
||||||
id: scrollView
|
id: scrollView
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
@ -203,17 +184,8 @@ Item {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
}
|
}
|
||||||
gradient: Gradient {
|
|
||||||
GradientStop {
|
color: hifi.colors.baseGray
|
||||||
position: 0
|
|
||||||
color: "#2b2b2b"
|
|
||||||
}
|
|
||||||
|
|
||||||
GradientStop {
|
|
||||||
position: 1
|
|
||||||
color: "#0f212e"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
anchors {
|
anchors {
|
||||||
|
|
|
@ -5795,12 +5795,12 @@ void Application::toggleRunningScriptsWidget() const {
|
||||||
|
|
||||||
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
|
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
|
||||||
auto tablet = dynamic_cast<TabletProxy*>(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));
|
auto tablet = dynamic_cast<TabletProxy*>(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));
|
||||||
|
auto hmd = DependencyManager::get<HMDScriptingInterface>();
|
||||||
if (tablet->getToolbarMode()) {
|
if (tablet->getToolbarMode()) {
|
||||||
static const QUrl url("hifi/dialogs/RunningScripts.qml");
|
static const QUrl url("hifi/dialogs/RunningScripts.qml");
|
||||||
DependencyManager::get<OffscreenUi>()->show(url, "RunningScripts");
|
DependencyManager::get<OffscreenUi>()->show(url, "RunningScripts");
|
||||||
} else {
|
} else {
|
||||||
QQuickItem* tabletRoot = tablet->getTabletRoot();
|
if (!hmd->getShouldShowTablet() && !isHMDMode()) {
|
||||||
if (!tabletRoot && !isHMDMode()) {
|
|
||||||
static const QUrl url("hifi/dialogs/RunningScripts.qml");
|
static const QUrl url("hifi/dialogs/RunningScripts.qml");
|
||||||
DependencyManager::get<OffscreenUi>()->show(url, "RunningScripts");
|
DependencyManager::get<OffscreenUi>()->show(url, "RunningScripts");
|
||||||
} else {
|
} else {
|
||||||
|
@ -5837,12 +5837,11 @@ void Application::showAssetServerWidget(QString filePath) {
|
||||||
};
|
};
|
||||||
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
|
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
|
||||||
auto tablet = dynamic_cast<TabletProxy*>(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));
|
auto tablet = dynamic_cast<TabletProxy*>(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));
|
||||||
|
auto hmd = DependencyManager::get<HMDScriptingInterface>();
|
||||||
if (tablet->getToolbarMode()) {
|
if (tablet->getToolbarMode()) {
|
||||||
DependencyManager::get<OffscreenUi>()->show(url, "AssetServer", startUpload);
|
DependencyManager::get<OffscreenUi>()->show(url, "AssetServer", startUpload);
|
||||||
} else {
|
} else {
|
||||||
QQuickItem* tabletRoot = tablet->getTabletRoot();
|
if (!hmd->getShouldShowTablet() && !isHMDMode()) {
|
||||||
if (!tabletRoot && !isHMDMode()) {
|
|
||||||
DependencyManager::get<OffscreenUi>()->show(url, "AssetServer", startUpload);
|
DependencyManager::get<OffscreenUi>()->show(url, "AssetServer", startUpload);
|
||||||
} else {
|
} else {
|
||||||
static const QUrl url("../../hifi/dialogs/TabletAssetServer.qml");
|
static const QUrl url("../../hifi/dialogs/TabletAssetServer.qml");
|
||||||
|
@ -5875,10 +5874,11 @@ void Application::addAssetToWorldFromURL(QString url) {
|
||||||
void Application::showDialog(const QString& desktopURL, const QString& tabletURL, const QString& name) const {
|
void Application::showDialog(const QString& desktopURL, const QString& tabletURL, const QString& name) const {
|
||||||
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
|
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
|
||||||
auto tablet = dynamic_cast<TabletProxy*>(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));
|
auto tablet = dynamic_cast<TabletProxy*>(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));
|
||||||
if (tablet->getToolbarMode() || (!tablet->getTabletRoot() && !isHMDMode())) {
|
auto hmd = DependencyManager::get<HMDScriptingInterface>();
|
||||||
|
if (tablet->getToolbarMode() || (!hmd->getShouldShowTablet() && !isHMDMode())) {
|
||||||
DependencyManager::get<OffscreenUi>()->show(desktopURL, name);
|
DependencyManager::get<OffscreenUi>()->show(desktopURL, name);
|
||||||
} else {
|
} else {
|
||||||
tablet->loadQMLSource(tabletURL);
|
tablet->pushOntoStack(tabletURL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6363,6 +6363,18 @@ void Application::loadScriptURLDialog() const {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Application::loadLODToolsDialog() {
|
||||||
|
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
|
||||||
|
auto tablet = dynamic_cast<TabletProxy*>(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));
|
||||||
|
if (tablet->getToolbarMode() || (!tablet->getTabletRoot() && !isHMDMode())) {
|
||||||
|
auto dialogsManager = DependencyManager::get<DialogsManager>();
|
||||||
|
dialogsManager->lodTools();
|
||||||
|
} else {
|
||||||
|
tablet->pushOntoStack("../../hifi/dialogs/TabletLODTools.qml");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void Application::toggleLogDialog() {
|
void Application::toggleLogDialog() {
|
||||||
if (! _logDialog) {
|
if (! _logDialog) {
|
||||||
_logDialog = new LogDialog(nullptr, getLogger());
|
_logDialog = new LogDialog(nullptr, getLogger());
|
||||||
|
|
|
@ -403,6 +403,7 @@ public slots:
|
||||||
void addAssetToWorldMessageClose();
|
void addAssetToWorldMessageClose();
|
||||||
|
|
||||||
Q_INVOKABLE void toggleMuteAudio();
|
Q_INVOKABLE void toggleMuteAudio();
|
||||||
|
void loadLODToolsDialog();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void showDesktop();
|
void showDesktop();
|
||||||
|
|
|
@ -308,7 +308,8 @@ Menu::Menu() {
|
||||||
// Settings > LOD...
|
// Settings > LOD...
|
||||||
action = addActionToQMenuAndActionHash(settingsMenu, "LOD...");
|
action = addActionToQMenuAndActionHash(settingsMenu, "LOD...");
|
||||||
connect(action, &QAction::triggered, [] {
|
connect(action, &QAction::triggered, [] {
|
||||||
DependencyManager::get<OffscreenUi>()->toggle(QString("hifi/dialogs/LodPreferencesDialog.qml"), "LodPreferencesDialog");
|
qApp->showDialog(QString("hifi/dialogs/LodPreferencesDialog.qml"),
|
||||||
|
QString("../../hifi/tablet/TabletLodPreferences.qml"), "LodPreferencesDialog");
|
||||||
});
|
});
|
||||||
|
|
||||||
// Settings > Control with Speech [advanced]
|
// Settings > Control with Speech [advanced]
|
||||||
|
@ -408,7 +409,8 @@ Menu::Menu() {
|
||||||
|
|
||||||
|
|
||||||
// Developer > Render > LOD Tools
|
// Developer > Render > LOD Tools
|
||||||
addActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::LodTools, 0, dialogsManager.data(), SLOT(lodTools()));
|
addActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::LodTools, 0,
|
||||||
|
qApp, SLOT(loadLODToolsDialog()));
|
||||||
|
|
||||||
// HACK enable texture decimation
|
// HACK enable texture decimation
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,6 +43,7 @@
|
||||||
#include "FileDialogHelper.h"
|
#include "FileDialogHelper.h"
|
||||||
#include "avatar/AvatarManager.h"
|
#include "avatar/AvatarManager.h"
|
||||||
#include "AudioClient.h"
|
#include "AudioClient.h"
|
||||||
|
#include "LODManager.h"
|
||||||
|
|
||||||
static const float DPI = 30.47f;
|
static const float DPI = 30.47f;
|
||||||
static const float INCHES_TO_METERS = 1.0f / 39.3701f;
|
static const float INCHES_TO_METERS = 1.0f / 39.3701f;
|
||||||
|
@ -182,6 +183,7 @@ void Web3DOverlay::loadSourceURL() {
|
||||||
_webSurface->getRootContext()->setContextProperty("ScriptDiscoveryService", DependencyManager::get<ScriptEngines>().data());
|
_webSurface->getRootContext()->setContextProperty("ScriptDiscoveryService", DependencyManager::get<ScriptEngines>().data());
|
||||||
_webSurface->getRootContext()->setContextProperty("Tablet", DependencyManager::get<TabletScriptingInterface>().data());
|
_webSurface->getRootContext()->setContextProperty("Tablet", DependencyManager::get<TabletScriptingInterface>().data());
|
||||||
_webSurface->getRootContext()->setContextProperty("Assets", DependencyManager::get<AssetMappingsScriptingInterface>().data());
|
_webSurface->getRootContext()->setContextProperty("Assets", DependencyManager::get<AssetMappingsScriptingInterface>().data());
|
||||||
|
_webSurface->getRootContext()->setContextProperty("LODManager", DependencyManager::get<LODManager>().data());
|
||||||
_webSurface->getRootContext()->setContextProperty("pathToFonts", "../../");
|
_webSurface->getRootContext()->setContextProperty("pathToFonts", "../../");
|
||||||
tabletScriptingInterface->setQmlTabletRoot("com.highfidelity.interface.tablet.system", _webSurface->getRootItem(), _webSurface.data());
|
tabletScriptingInterface->setQmlTabletRoot("com.highfidelity.interface.tablet.system", _webSurface->getRootItem(), _webSurface.data());
|
||||||
|
|
||||||
|
|
|
@ -1310,17 +1310,18 @@ void Rig::copyJointsFromJointData(const QVector<JointData>& jointDataVec) {
|
||||||
if (!_animSkeleton) {
|
if (!_animSkeleton) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (jointDataVec.size() != (int)_internalPoseSet._relativePoses.size()) {
|
int numJoints = jointDataVec.size();
|
||||||
// animations haven't fully loaded yet.
|
const AnimPoseVec& absoluteDefaultPoses = _animSkeleton->getAbsoluteDefaultPoses();
|
||||||
_internalPoseSet._relativePoses = _animSkeleton->getRelativeDefaultPoses();
|
if (numJoints != (int)absoluteDefaultPoses.size()) {
|
||||||
|
// jointData is incompatible
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// make a vector of rotations in absolute-geometry-frame
|
// make a vector of rotations in absolute-geometry-frame
|
||||||
const AnimPoseVec& absoluteDefaultPoses = _animSkeleton->getAbsoluteDefaultPoses();
|
|
||||||
std::vector<glm::quat> rotations;
|
std::vector<glm::quat> rotations;
|
||||||
rotations.reserve(absoluteDefaultPoses.size());
|
rotations.reserve(numJoints);
|
||||||
const glm::quat rigToGeometryRot(glmExtractRotation(_rigToGeometryTransform));
|
const glm::quat rigToGeometryRot(glmExtractRotation(_rigToGeometryTransform));
|
||||||
for (int i = 0; i < jointDataVec.size(); i++) {
|
for (int i = 0; i < numJoints; i++) {
|
||||||
const JointData& data = jointDataVec.at(i);
|
const JointData& data = jointDataVec.at(i);
|
||||||
if (data.rotationSet) {
|
if (data.rotationSet) {
|
||||||
// JointData rotations are in absolute rig-frame so we rotate them to absolute geometry-frame
|
// JointData rotations are in absolute rig-frame so we rotate them to absolute geometry-frame
|
||||||
|
@ -1334,8 +1335,11 @@ void Rig::copyJointsFromJointData(const QVector<JointData>& jointDataVec) {
|
||||||
_animSkeleton->convertAbsoluteRotationsToRelative(rotations);
|
_animSkeleton->convertAbsoluteRotationsToRelative(rotations);
|
||||||
|
|
||||||
// store new relative poses
|
// store new relative poses
|
||||||
|
if (numJoints != (int)_internalPoseSet._relativePoses.size()) {
|
||||||
|
_internalPoseSet._relativePoses = _animSkeleton->getRelativeDefaultPoses();
|
||||||
|
}
|
||||||
const AnimPoseVec& relativeDefaultPoses = _animSkeleton->getRelativeDefaultPoses();
|
const AnimPoseVec& relativeDefaultPoses = _animSkeleton->getRelativeDefaultPoses();
|
||||||
for (int i = 0; i < jointDataVec.size(); i++) {
|
for (int i = 0; i < numJoints; i++) {
|
||||||
const JointData& data = jointDataVec.at(i);
|
const JointData& data = jointDataVec.at(i);
|
||||||
_internalPoseSet._relativePoses[i].scale() = Vectors::ONE;
|
_internalPoseSet._relativePoses[i].scale() = Vectors::ONE;
|
||||||
_internalPoseSet._relativePoses[i].rot() = rotations[i];
|
_internalPoseSet._relativePoses[i].rot() = rotations[i];
|
||||||
|
|
|
@ -1548,7 +1548,7 @@ var PropertiesTool = function (opts) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
selectionManager.addEventListener(function (selectionUpdated) {
|
function updateSelections(selectionUpdated) {
|
||||||
var data = {
|
var data = {
|
||||||
type: 'update'
|
type: 'update'
|
||||||
};
|
};
|
||||||
|
@ -1589,7 +1589,8 @@ var PropertiesTool = function (opts) {
|
||||||
}
|
}
|
||||||
data.selections = selections;
|
data.selections = selections;
|
||||||
webView.emitScriptEvent(JSON.stringify(data));
|
webView.emitScriptEvent(JSON.stringify(data));
|
||||||
});
|
}
|
||||||
|
selectionManager.addEventListener(updateSelections);
|
||||||
|
|
||||||
webView.webEventReceived.connect(function (data) {
|
webView.webEventReceived.connect(function (data) {
|
||||||
try {
|
try {
|
||||||
|
@ -1751,6 +1752,8 @@ var PropertiesTool = function (opts) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (data.type === "propertiesPageReady") {
|
||||||
|
updateSelections(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1704,4 +1704,8 @@ function loaded() {
|
||||||
document.addEventListener("contextmenu", function(event) {
|
document.addEventListener("contextmenu", function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
|
setTimeout(function() {
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({ type: 'propertiesPageReady' }));
|
||||||
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,8 +75,9 @@
|
||||||
function showTabletUI() {
|
function showTabletUI() {
|
||||||
tabletShown = true;
|
tabletShown = true;
|
||||||
|
|
||||||
if (!tabletRezzed) {
|
if (!tabletRezzed || !tabletIsValid()) {
|
||||||
rezTablet(false);
|
closeTabletUI()
|
||||||
|
rezTablet();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UIWebTablet && tabletRezzed) {
|
if (UIWebTablet && tabletRezzed) {
|
||||||
|
@ -199,7 +200,7 @@
|
||||||
preMakeTime = now;
|
preMakeTime = now;
|
||||||
if (!tabletIsValid()) {
|
if (!tabletIsValid()) {
|
||||||
closeTabletUI();
|
closeTabletUI();
|
||||||
rezTablet(false);
|
rezTablet();
|
||||||
tabletShown = false;
|
tabletShown = false;
|
||||||
} else if (!tabletShown) {
|
} else if (!tabletShown) {
|
||||||
hideTabletUI();
|
hideTabletUI();
|
||||||
|
|
Loading…
Reference in a new issue