From 2db45b3ec9583c5c79dd9c1ac689b488eaedd8aa Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Mon, 28 Jan 2019 14:03:43 -0800 Subject: [PATCH] dante's keyboard changes + getProperty + some fixes --- interface/src/Application.cpp | 13 +- interface/src/ui/Keyboard.cpp | 100 ++++++------ interface/src/ui/Keyboard.h | 7 +- interface/src/ui/overlays/Overlays.cpp | 143 +++++++++++++++++- .../entities/src/EntityItemProperties.cpp | 5 +- 5 files changed, 211 insertions(+), 57 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 7e4afd1518..4bea8cabfb 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2361,6 +2361,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo }); // Preload Tablet sounds + DependencyManager::get()->setEntityTree(qApp->getEntities()->getTree()); DependencyManager::get()->preloadSounds(); DependencyManager::get()->createKeyboard(); @@ -8692,12 +8693,11 @@ void Application::createLoginDialog() { auto keyboard = DependencyManager::get().data(); if (!keyboard->getAnchorID().isNull() && !_loginDialogID.isNull()) { - const auto KEYBOARD_LOCAL_ORIENTATION = glm::quat(0.0f, 0.0, 1.0f, 0.25f); auto keyboardLocalOffset = cameraOrientation * glm::vec3(-0.4f * getMyAvatar()->getSensorToWorldScale(), -0.3f, 0.2f); EntityItemProperties properties; properties.setPosition(position + keyboardLocalOffset); - properties.setRotation(cameraOrientation * KEYBOARD_LOCAL_ORIENTATION); + properties.setRotation(cameraOrientation * Quaternions::Y_180); entityScriptingInterface->editEntity(keyboard->getAnchorID(), properties); keyboard->setResetKeyboardPositionOnRaise(false); @@ -8728,7 +8728,6 @@ void Application::updateLoginDialogPosition() { auto upVec = getMyAvatar()->getWorldOrientation() * Vectors::UNIT_Y; auto offset = headLookVec * OFFSET.x; auto newPositionVec = (cameraPositionVec + offset) + (upVec * OFFSET.y); - auto newOrientation = glm::inverse(glm::quat_cast(glm::lookAt(newPositionVec, cameraPositionVec, upVec))) * Quaternions::Y_180; bool outOfBounds = glm::distance(positionVec, cameraPositionVec) > 1.0f; @@ -8736,17 +8735,17 @@ void Application::updateLoginDialogPosition() { { EntityItemProperties properties; properties.setPosition(newPositionVec); - properties.setRotation(newOrientation); + properties.setRotation(cameraOrientation); entityScriptingInterface->editEntity(_loginDialogID, properties); } { - const auto KEYBOARD_LOCAL_ORIENTATION = glm::quat(0.0f, 0.0, 1.0f, 0.25f); - auto keyboardLocalOffset = newOrientation * glm::vec3(-0.4f * getMyAvatar()->getSensorToWorldScale(), -0.3f, 0.2f); + glm::vec3 keyboardLocalOffset = cameraOrientation * glm::vec3(-0.4f * getMyAvatar()->getSensorToWorldScale(), -0.3f, 0.2f); + glm::quat keyboardOrientation = cameraOrientation * glm::quat(glm::radians(glm::vec3(-30.0f, 180.0f, 0.0f))); EntityItemProperties properties; properties.setPosition(newPositionVec + keyboardLocalOffset); - properties.setRotation(newOrientation * KEYBOARD_LOCAL_ORIENTATION); + properties.setRotation(keyboardOrientation); entityScriptingInterface->editEntity(DependencyManager::get()->getAnchorID(), properties); } } diff --git a/interface/src/ui/Keyboard.cpp b/interface/src/ui/Keyboard.cpp index 54620e36ba..280c14167b 100644 --- a/interface/src/ui/Keyboard.cpp +++ b/interface/src/ui/Keyboard.cpp @@ -151,17 +151,20 @@ void Key::saveDimensionsAndLocalPosition() { _originalLocalPosition = properties.getLocalPosition(); _originalDimensions = properties.getDimensions(); _currentLocalPosition = _originalLocalPosition; + _originalDimensionsAndLocalPositionSaved = true; } void Key::scaleKey(float sensorToWorldScale) { - glm::vec3 scaledLocalPosition = _originalLocalPosition * sensorToWorldScale; - glm::vec3 scaledDimensions = _originalDimensions * sensorToWorldScale; - _currentLocalPosition = scaledLocalPosition; + if (_originalDimensionsAndLocalPositionSaved) { + glm::vec3 scaledLocalPosition = _originalLocalPosition * sensorToWorldScale; + glm::vec3 scaledDimensions = _originalDimensions * sensorToWorldScale; + _currentLocalPosition = scaledLocalPosition; - EntityItemProperties properties; - properties.setDimensions(scaledDimensions); - properties.setLocalPosition(scaledLocalPosition); - DependencyManager::get()->editEntity(_keyID, properties); + EntityItemProperties properties; + properties.setDimensions(scaledDimensions); + properties.setLocalPosition(scaledLocalPosition); + DependencyManager::get()->editEntity(_keyID, properties); + } } void Key::startTimer(int time) { @@ -229,6 +232,18 @@ void Keyboard::registerKeyboardHighlighting() { selection->enableListToScene(KEY_PRESSED_HIGHLIGHT); } +void Keyboard::disableSelectionLists() { + auto selection = DependencyManager::get(); + selection->disableListHighlight(KEY_HOVER_HIGHLIGHT); + selection->disableListHighlight(KEY_PRESSED_HIGHLIGHT); +} + +void Keyboard::enableSelectionLists() { + auto selection = DependencyManager::get(); + selection->enableListHighlight(KEY_HOVER_HIGHLIGHT, KEY_HOVERING_STYLE); + selection->enableListHighlight(KEY_PRESSED_HIGHLIGHT, KEY_PRESSING_STYLE); +} + bool Keyboard::getUse3DKeyboard() const { return _use3DKeyboardLock.resultWithReadLock([&] { return _use3DKeyboard.get(); @@ -288,6 +303,7 @@ void Keyboard::setRaised(bool raised) { raiseKeyboardAnchor(raised); raiseKeyboard(raised); raised ? enableStylus() : disableStylus(); + raised ? enableSelectionLists() : disableSelectionLists(); withWriteLock([&] { _raised = raised; _layerIndex = 0; @@ -340,8 +356,9 @@ void Keyboard::scaleKeyboard(float sensorToWorldScale) { { EntityItemProperties properties; - properties.setDimensions(_anchor.originalDimensions * sensorToWorldScale); - entityScriptingInterface->editEntity(_anchor.entityID, properties); + properties.setLocalPosition(_backPlate.localPosition * sensorToWorldScale); + properties.setDimensions(_backPlate.dimensions * sensorToWorldScale); + entityScriptingInterface->editEntity(_backPlate.entityID, properties); } for (auto& keyboardLayer : _keyboardLayers) { @@ -357,13 +374,6 @@ void Keyboard::scaleKeyboard(float sensorToWorldScale) { properties.setLineHeight(_textDisplay.lineHeight * sensorToWorldScale); entityScriptingInterface->editEntity(_textDisplay.entityID, properties); } - - { - EntityItemProperties properties; - properties.setLocalPosition(_backPlate.localPosition * sensorToWorldScale); - properties.setDimensions(_backPlate.dimensions * sensorToWorldScale); - entityScriptingInterface->editEntity(_backPlate.entityID, properties); - } } void Keyboard::startLayerSwitchTimer() { @@ -456,8 +466,8 @@ void Keyboard::switchToLayer(int layerIndex) { } } -bool Keyboard::shouldProcessEntityAndPointerEvent(const PointerEvent& event, const QUuid& id) const { - return (shouldProcessPointerEvent(event) && shouldProcessEntity(id)); +bool Keyboard::shouldProcessEntityAndPointerEvent(const PointerEvent& event) const { + return (shouldProcessPointerEvent(event) && shouldProcessEntity()); } bool Keyboard::shouldProcessPointerEvent(const PointerEvent& event) const { @@ -470,7 +480,7 @@ bool Keyboard::shouldProcessPointerEvent(const PointerEvent& event) const { void Keyboard::handleTriggerBegin(const QUuid& id, const PointerEvent& event) { auto buttonType = event.getButton(); - if (!shouldProcessEntityAndPointerEvent(event, id) || buttonType != PointerEvent::PrimaryButton) { + if (!shouldProcessEntityAndPointerEvent(event) || buttonType != PointerEvent::PrimaryButton) { return; } @@ -572,7 +582,7 @@ void Keyboard::setRightHandLaser(unsigned int rightHandLaser) { } void Keyboard::handleTriggerEnd(const QUuid& id, const PointerEvent& event) { - if (!shouldProcessEntityAndPointerEvent(event, id)) { + if (!shouldProcessEntityAndPointerEvent(event)) { return; } @@ -599,7 +609,7 @@ void Keyboard::handleTriggerEnd(const QUuid& id, const PointerEvent& event) { } void Keyboard::handleTriggerContinue(const QUuid& id, const PointerEvent& event) { - if (!shouldProcessEntityAndPointerEvent(event, id)) { + if (!shouldProcessEntityAndPointerEvent(event)) { return; } @@ -639,7 +649,7 @@ void Keyboard::handleTriggerContinue(const QUuid& id, const PointerEvent& event) } void Keyboard::handleHoverBegin(const QUuid& id, const PointerEvent& event) { - if (!shouldProcessEntityAndPointerEvent(event, id)) { + if (!shouldProcessEntityAndPointerEvent(event)) { return; } @@ -655,7 +665,7 @@ void Keyboard::handleHoverBegin(const QUuid& id, const PointerEvent& event) { } void Keyboard::handleHoverEnd(const QUuid& id, const PointerEvent& event) { - if (!shouldProcessEntityAndPointerEvent(event, id)) { + if (!shouldProcessEntityAndPointerEvent(event)) { return; } @@ -750,26 +760,28 @@ void Keyboard::loadKeyboardFile(const QString& keyboardFile) { { QJsonObject backPlateObject = jsonObject["backPlate"].toObject(); + glm::vec3 position = vec3FromVariant(backPlateObject["position"].toVariant()); glm::vec3 dimensions = vec3FromVariant(backPlateObject["dimensions"].toVariant()); + glm::quat rotation = quatFromVariant(backPlateObject["rotation"].toVariant()); EntityItemProperties properties; properties.setType(EntityTypes::Box); - properties.setName("BackPlate"); + properties.setName("Keyboard-BackPlate"); properties.setVisible(true); properties.getGrab().setGrabbable(false); properties.setAlpha(0.0f); properties.setIgnorePickIntersection(false); properties.setDimensions(dimensions); - properties.setPosition(vec3FromVariant(backPlateObject["position"].toVariant())); - properties.setRotation(quatFromVariant(backPlateObject["rotation"].toVariant())); + properties.setPosition(position); + properties.setRotation(rotation); properties.setParentID(_anchor.entityID); BackPlate backPlate; backPlate.entityID = entityScriptingInterface->addEntityInternal(properties, entity::HostType::LOCAL); backPlate.dimensions = dimensions; - EntityPropertyFlags desiredProperties; - desiredProperties += PROP_LOCAL_POSITION; - backPlate.localPosition = entityScriptingInterface->getEntityProperties(backPlate.entityID, desiredProperties).getLocalPosition(); + glm::quat anchorEntityInverseWorldOrientation = glm::inverse(rotation); + glm::vec3 anchorEntityLocalTranslation = anchorEntityInverseWorldOrientation * -position; + backPlate.localPosition = (anchorEntityInverseWorldOrientation * position) + anchorEntityLocalTranslation; _backPlate = backPlate; } @@ -797,6 +809,19 @@ void Keyboard::loadKeyboardFile(const QString& keyboardFile) { QString modelUrl = keyboardKeyValue["modelURL"].toString(); QString url = (useResourcePath ? (resourcePath + modelUrl) : modelUrl); + EntityItemProperties properties; + properties.setType(EntityTypes::Model); + properties.setDimensions(vec3FromVariant(keyboardKeyValue["dimensions"].toVariant())); + properties.setPosition(vec3FromVariant(keyboardKeyValue["position"].toVariant())); + properties.setVisible(false); + properties.setEmissive(true); + properties.setParentID(_anchor.entityID); + properties.setModelURL(url); + properties.setTextures(QVariant(textureMap).toString()); + properties.getGrab().setGrabbable(false); + properties.setLocalRotation(quatFromVariant(keyboardKeyValue["localOrientation"].toVariant())); + QUuid id = entityScriptingInterface->addEntityInternal(properties, entity::HostType::LOCAL); + QString keyType = keyboardKeyValue["type"].toString(); QString keyString = keyboardKeyValue["key"].toString(); @@ -810,19 +835,6 @@ void Keyboard::loadKeyboardFile(const QString& keyboardFile) { key.setSwitchToLayerIndex(switchToLayer); } } - - EntityItemProperties properties; - properties.setType(EntityTypes::Model); - properties.setDimensions(vec3FromVariant(keyboardKeyValue["dimensions"].toVariant())); - properties.setPosition(vec3FromVariant(keyboardKeyValue["position"].toVariant())); - properties.setVisible(false); - properties.setEmissive(true); - properties.setParentID(_anchor.entityID); - properties.setModelURL(url); - properties.setTextures(QVariant(textureMap).toString()); - properties.getGrab().setGrabbable(false); - properties.setLocalRotation(quatFromVariant(keyboardKeyValue["localOrientation"].toVariant())); - QUuid id = entityScriptingInterface->addEntityInternal(properties, entity::HostType::LOCAL); key.setID(id); key.setKeyString(keyString); key.saveDimensionsAndLocalPosition(); @@ -886,8 +898,8 @@ QUuid Keyboard::getAnchorID() { }); } -bool Keyboard::shouldProcessEntity(const QUuid& id) const { - return (!_keyboardLayers.empty() && isLayerSwitchTimerFinished() && id != _backPlate.entityID); +bool Keyboard::shouldProcessEntity() const { + return (!_keyboardLayers.empty() && isLayerSwitchTimerFinished()); } QVector Keyboard::getKeysID() { diff --git a/interface/src/ui/Keyboard.h b/interface/src/ui/Keyboard.h index dcb9deac4e..7056411578 100644 --- a/interface/src/ui/Keyboard.h +++ b/interface/src/ui/Keyboard.h @@ -81,6 +81,7 @@ private: glm::vec3 _originalLocalPosition; glm::vec3 _originalDimensions; glm::vec3 _currentLocalPosition; + bool _originalDimensionsAndLocalPositionSaved { false }; std::shared_ptr _timer { std::make_shared() }; }; @@ -146,14 +147,16 @@ private: void raiseKeyboardAnchor(bool raise) const; void enableStylus(); void disableStylus(); + void enableSelectionLists(); + void disableSelectionLists(); void setLayerIndex(int layerIndex); void clearKeyboardKeys(); void switchToLayer(int layerIndex); void updateTextDisplay(); - bool shouldProcessEntityAndPointerEvent(const PointerEvent& event, const QUuid& id) const; + bool shouldProcessEntityAndPointerEvent(const PointerEvent& event) const; bool shouldProcessPointerEvent(const PointerEvent& event) const; - bool shouldProcessEntity(const QUuid& id) const; + bool shouldProcessEntity() const; void startLayerSwitchTimer(); bool isLayerSwitchTimerFinished() const; diff --git a/interface/src/ui/overlays/Overlays.cpp b/interface/src/ui/overlays/Overlays.cpp index f5cc73aacd..61ae714445 100644 --- a/interface/src/ui/overlays/Overlays.cpp +++ b/interface/src/ui/overlays/Overlays.cpp @@ -264,6 +264,30 @@ QString Overlays::overlayToEntityType(const QString& type) { } \ } +#define GROUP_ENTITY_TO_OVERLAY_PROP(g, e, o) \ + { \ + auto iter = overlayProps.find(#g); \ + if (iter != overlayProps.end()) { \ + auto map = iter.value().toMap(); \ + auto iter2 = map.find(#e); \ + if (iter2 != map.end()) { \ + overlayProps[#o] = iter2.value(); \ + } \ + } \ + } + +#define GROUP_ENTITY_TO_OVERLAY_PROP_CONVERT(g, e, o, C) \ + { \ + auto iter = overlayProps.find(#g); \ + if (iter != overlayProps.end()) { \ + auto map = iter.value().toMap(); \ + auto iter2 = map.find(#e); \ + if (iter2 != map.end()) { \ + overlayProps[#o] = C(iter2.value()); \ + } \ + } \ + } + EntityItemProperties Overlays::convertOverlayToEntityProperties(QVariantMap& overlayProps, const QString& type, bool add, const QUuid& id) { overlayProps["type"] = type; @@ -279,7 +303,8 @@ EntityItemProperties Overlays::convertOverlayToEntityProperties(QVariantMap& ove RENAME_PROP(localOrientation, localRotation); RENAME_PROP(ignoreRayIntersection, ignorePickIntersection); - { + // Model overlays didn't support wireframe drawing + if (type != "Model") { RENAME_PROP(solid, isSolid); RENAME_PROP(isFilled, isSolid); RENAME_PROP(filled, isSolid); @@ -327,6 +352,7 @@ EntityItemProperties Overlays::convertOverlayToEntityProperties(QVariantMap& ove RENAME_PROP(url, sourceUrl); RENAME_PROP_CONVERT(inputMode, inputMode, [](const QVariant& v) { return v.toString() == "Mouse" ? "mouse" : "touch"; }); } else if (type == "Gizmo") { + RENAME_PROP(radius, outerRadius); if (add || overlayProps.contains("outerRadius")) { float ratio = 2.0f; { @@ -435,7 +461,7 @@ EntityItemProperties Overlays::convertOverlayToEntityProperties(QVariantMap& ove glm::vec3 position; auto iter2 = overlayProps.find("position"); if (iter2 != overlayProps.end()) { - position = vec3FromVariant(iter.value()); + position = vec3FromVariant(iter2.value()); } else if (!add) { EntityPropertyFlags desiredProperties; desiredProperties += PROP_POSITION; @@ -493,6 +519,119 @@ QVariantMap Overlays::convertEntityToOverlayProperties(const EntityItemPropertie QScriptEngine scriptEngine; QVariantMap overlayProps = EntityItemPropertiesToScriptValue(&scriptEngine, properties).toVariant().toMap(); + QString type = overlayProps["type"].toString(); + overlayProps["type"] = entityToOverlayType(type); + + if (type != "PolyLine") { + RENAME_PROP(position, p1); + RENAME_PROP(position, start); + } + RENAME_PROP(position, point); + RENAME_PROP(dimensions, scale); + RENAME_PROP(dimensions, size); + RENAME_PROP(rotation, orientation); + RENAME_PROP(localRotation, localOrientation); + RENAME_PROP(ignorePickIntersection, ignoreRayIntersection); + + { + RENAME_PROP_CONVERT(primitiveMode, isSolid, [](const QVariant& v) { return v.toString() == "solid" ? true : false; }); + RENAME_PROP(isSolid, solid); + RENAME_PROP(isSolid, isFilled); + RENAME_PROP(isSolid, filled); + + RENAME_PROP_CONVERT(primitiveMode, isWire, [](const QVariant& v) { return v.toString() == "lines" ? true : false; }); + RENAME_PROP(isWire, wire); + } + + RENAME_PROP_CONVERT(renderLayer, drawInFront, [](const QVariant& v) { return v.toString() == "front" ? true : false; }); + RENAME_PROP_CONVERT(renderLayer, drawHUDLayer, [](const QVariant& v) { return v.toString() == "hud" ? true : false; }); + + GROUP_ENTITY_TO_OVERLAY_PROP(grab, grabbable, grabbable); + + GROUP_ENTITY_TO_OVERLAY_PROP(pulse, min, pulseMin); + GROUP_ENTITY_TO_OVERLAY_PROP(pulse, max, pulseMax); + GROUP_ENTITY_TO_OVERLAY_PROP(pulse, period, pulsePeriod); + GROUP_ENTITY_TO_OVERLAY_PROP_CONVERT(pulse, colorMode, colorPulse, [](const QVariant& v) { + QString f = v.toString(); + if (f == "in") { + return 1.0f; + } else if (f == "out") { + return -1.0f; + } + return 0.0f; + }); + GROUP_ENTITY_TO_OVERLAY_PROP_CONVERT(pulse, alphaMode, alphaPulse, [](const QVariant& v) { + QString f = v.toString(); + if (f == "in") { + return 1.0f; + } else if (f == "out") { + return -1.0f; + } + return 0.0f; + }); + + if (type == "Model") { + RENAME_PROP(modelURL, url); + RENAME_PROP(animation, animationSettings); + } else if (type == "Image") { + RENAME_PROP(imageURL, url); + } else if (type == "Web") { + RENAME_PROP(sourceUrl, url); + RENAME_PROP_CONVERT(inputMode, inputMode, [](const QVariant& v) { return v.toString() == "mouse" ? "Mouse" : "Touch"; }); + } else if (type == "Gizmo") { + RENAME_PROP_CONVERT(dimensions, outerRadius, [](const QVariant& v) { return vec3FromVariant(v).x; }); + RENAME_PROP(outerRadius, radius); + + RENAME_PROP_CONVERT(rotation, rotation, [](const QVariant& v) { + glm::quat rot = quatFromVariant(v); + // FIXME: + return quatToVariant(glm::angleAxis((float)M_PI_2, rot * Vectors::RIGHT) * rot); + }); + + GROUP_ENTITY_TO_OVERLAY_PROP(ring, startAngle, startAt); + GROUP_ENTITY_TO_OVERLAY_PROP(ring, endAngle, endAt); + GROUP_ENTITY_TO_OVERLAY_PROP(ring, innerRadius, innerRadius); + + GROUP_ENTITY_TO_OVERLAY_PROP(ring, innerStartColor, innerStartColor); + GROUP_ENTITY_TO_OVERLAY_PROP(ring, innerEndColor, innerEndColor); + GROUP_ENTITY_TO_OVERLAY_PROP(ring, outerStartColor, outerStartColor); + GROUP_ENTITY_TO_OVERLAY_PROP(ring, outerEndColor, outerEndColor); + GROUP_ENTITY_TO_OVERLAY_PROP(ring, innerStartAlpha, innerStartAlpha); + GROUP_ENTITY_TO_OVERLAY_PROP(ring, innerEndAlpha, innerEndAlpha); + GROUP_ENTITY_TO_OVERLAY_PROP(ring, outerStartAlpha, outerStartAlpha); + GROUP_ENTITY_TO_OVERLAY_PROP(ring, outerEndAlpha, outerEndAlpha); + + GROUP_ENTITY_TO_OVERLAY_PROP(ring, hasTickMarks, hasTickMarks); + GROUP_ENTITY_TO_OVERLAY_PROP(ring, majorTickMarksAngle, majorTickMarksAngle); + GROUP_ENTITY_TO_OVERLAY_PROP(ring, minorTickMarksAngle, minorTickMarksAngle); + GROUP_ENTITY_TO_OVERLAY_PROP(ring, majorTickMarksLength, majorTickMarksLength); + GROUP_ENTITY_TO_OVERLAY_PROP(ring, minorTickMarksLength, minorTickMarksLength); + GROUP_ENTITY_TO_OVERLAY_PROP(ring, majorTickMarksColor, majorTickMarksColor); + GROUP_ENTITY_TO_OVERLAY_PROP(ring, minorTickMarksColor, minorTickMarksColor); + } else if (type == "PolyLine") { + QVector points = qVectorVec3FromScriptValue(scriptEngine.newVariant(overlayProps["linePoints"])); + glm::vec3 position = vec3FromVariant(overlayProps["position"]); + if (points.length() > 1) { + overlayProps["p1"] = vec3toVariant(points[0] + position); + overlayProps["p2"] = vec3toVariant(points[1] + position); + + overlayProps["localStart"] = vec3toVariant(points[0]); + overlayProps["localEnd"] = vec3toVariant(points[1]); + } + + RENAME_PROP(p1, startPoint); + RENAME_PROP(p1, start); + RENAME_PROP(p2, endPoint); + RENAME_PROP(p2, end); + + QVector widths = qVectorFloatFromScriptValue(scriptEngine.newVariant(overlayProps["strokeWidths"])); + if (widths.length() > 0) { + overlayProps["lineWidth"] = widths[0]; + } + + RENAME_PROP_CONVERT(glow, glow, [](const QVariant& v) { return v.toBool() ? 1.0f : 0.0f; }); + } + return overlayProps; } diff --git a/libraries/entities/src/EntityItemProperties.cpp b/libraries/entities/src/EntityItemProperties.cpp index ad5c9660f4..3b6bdc44b8 100644 --- a/libraries/entities/src/EntityItemProperties.cpp +++ b/libraries/entities/src/EntityItemProperties.cpp @@ -1489,6 +1489,7 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const { * minorGridEvery: 0.5, * lifetime: 300 // Delete after 5 minutes. * }); + */ /**jsdoc * The "Gizmo" {@link Entities.EntityType|EntityType} displays an entity that could be used as UI. @@ -1922,7 +1923,7 @@ QScriptValue EntityItemProperties::copyToScriptValue(QScriptEngine* engine, bool properties.setProperty("localEntity", convertScriptValue(engine, getEntityHostType() == entity::HostType::LOCAL)); } - if (!psuedoPropertyFlagsActive || psueudoPropertyFlags.test(EntityPsuedoPropertyFlag::FaceCamera)) { + if (!psuedoPropertyFlagsActive || psueudoPropertyFlags.test(EntityPsuedoPropertyFlag::FaceCamera) && _type != EntityTypes::PolyLine) { properties.setProperty("faceCamera", convertScriptValue(engine, getBillboardMode() == BillboardMode::YAW)); } if (!psuedoPropertyFlagsActive || psueudoPropertyFlags.test(EntityPsuedoPropertyFlag::IsFacingAvatar)) { @@ -2189,7 +2190,7 @@ void EntityItemProperties::copyFromScriptValue(const QScriptValue& object, bool } // Handle old "faceCamera" and "isFacingAvatar" props - { + if (_type != EntityTypes::PolyLine) { QScriptValue P = object.property("faceCamera"); if (P.isValid() && !object.property("billboardMode").isValid()) { bool newValue = P.toVariant().toBool();