diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 1a843156dc..258685662d 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -460,7 +460,8 @@ void MyAvatar::enableHandTouchForID(const QUuid& entityID) { void MyAvatar::registerMetaTypes(ScriptEnginePointer engine) { scriptRegisterMetaType(engine.get()); - scriptRegisterMetaType(engine.get()); + scriptRegisterMetaType(engine.get(), "DriveKeys"); + qDebug() << "MyAvatar::registerMetaTypes"; } void MyAvatar::registerProperties(ScriptEnginePointer engine) { diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index 11a1fa9f82..12104c0ad5 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -2291,13 +2291,6 @@ public slots: */ void clearAvatarEntity(const QUuid& entityID, bool requiresRemovalFromTree = true) override; - /*@jsdoc - * @function MyAvatar.sanitizeAvatarEntityProperties - * @param {EntityItemProperties} properties - Properties. - * @deprecated This function is deprecated and will be removed. - */ - void sanitizeAvatarEntityProperties(EntityItemProperties& properties) const; - /*@jsdoc * Sets whether your avatar mesh is visible to you. * @function MyAvatar.setEnableMeshVisible @@ -2689,6 +2682,7 @@ private: virtual int parseDataFromBuffer(const QByteArray& buffer) override; virtual glm::vec3 getSkeletonPosition() const override; int _skeletonModelChangeCount { 0 }; + void sanitizeAvatarEntityProperties(EntityItemProperties& properties) const; void saveAvatarScale(); @@ -3119,6 +3113,8 @@ private: QTimer _addAvatarEntitiesToTreeTimer; }; +Q_DECLARE_METATYPE(MyAvatar::DriveKeys) + ScriptValue audioListenModeToScriptValue(ScriptEngine* engine, const AudioListenerMode& audioListenerMode); bool audioListenModeFromScriptValue(const ScriptValue& object, AudioListenerMode& audioListenerMode); diff --git a/interface/src/scripting/Audio.cpp b/interface/src/scripting/Audio.cpp index 4a96e36939..57c160b7e0 100644 --- a/interface/src/scripting/Audio.cpp +++ b/interface/src/scripting/Audio.cpp @@ -508,9 +508,9 @@ void Audio::setReverb(bool enable) { }); } -void Audio::setReverbOptions(const AudioEffectOptions* options) { +void Audio::setReverbOptions(const AudioEffectOptions options) { withWriteLock([&] { - DependencyManager::get()->setReverbOptions(options); + DependencyManager::get()->setReverbOptions(&options); }); } diff --git a/interface/src/scripting/Audio.h b/interface/src/scripting/Audio.h index bb8a92aa73..5c1cb68b50 100644 --- a/interface/src/scripting/Audio.h +++ b/interface/src/scripting/Audio.h @@ -215,7 +215,7 @@ public: * @function Audio.setReverbOptions * @param {AudioEffectOptions} options - The reverberation options. */ - Q_INVOKABLE void setReverbOptions(const AudioEffectOptions* options); + Q_INVOKABLE void setReverbOptions(const AudioEffectOptions options); /*@jsdoc * Sets the gain (relative volume) that avatars' voices are played at. This gain is used at the server. diff --git a/libraries/avatars/src/AvatarData.h b/libraries/avatars/src/AvatarData.h index 5db3cf37e1..0b2a925de0 100644 --- a/libraries/avatars/src/AvatarData.h +++ b/libraries/avatars/src/AvatarData.h @@ -778,16 +778,6 @@ public: */ Q_INVOKABLE char getHandState() const { return _handState; } - const QVector& getRawJointData() const { return _jointData; } - - /*@jsdoc - * Sets joint translations and rotations from raw joint data. - * @function Avatar.setRawJointData - * @param {JointData[]} data - The raw joint data. - * @deprecated This function is deprecated and will be removed. - */ - Q_INVOKABLE void setRawJointData(QVector data); - /*@jsdoc * Sets a specific joint's rotation and position relative to its parent, in model coordinates. *

Warning: These coordinates are not necessarily in meters.

@@ -1706,6 +1696,9 @@ protected: QByteArray packAvatarEntityTraitInstance(AvatarTraits::TraitInstanceID traitInstanceID); QByteArray packGrabTraitInstance(AvatarTraits::TraitInstanceID traitInstanceID); + const QVector& getRawJointData() const { return _jointData; } + void setRawJointData(QVector data); + void unpackSkeletonModelURL(const QByteArray& data); void unpackSkeletonData(const QByteArray& data); @@ -1894,6 +1887,9 @@ private: Q_DISABLE_COPY(AvatarData) friend void avatarStateFromFrame(const QByteArray& frameData, AvatarData* _avatar); + // Required for setRawJointData. Making setRawJointData public would expose it to scripting interface. + friend class SkeletonModel; + friend class MyAvatar; static QUrl _defaultFullAvatarModelUrl; }; Q_DECLARE_METATYPE(AvatarData*) diff --git a/libraries/controllers/src/controllers/ScriptingInterface.cpp b/libraries/controllers/src/controllers/ScriptingInterface.cpp index 14957abbac..9796c5cb49 100644 --- a/libraries/controllers/src/controllers/ScriptingInterface.cpp +++ b/libraries/controllers/src/controllers/ScriptingInterface.cpp @@ -123,18 +123,10 @@ namespace controller { return userInputMapper->getPose(Input((uint32_t)source)); } - QVector ScriptingInterface::getAllActions() { - return DependencyManager::get()->getAllActions(); - } - QString ScriptingInterface::getDeviceName(unsigned int device) { return DependencyManager::get()->getDeviceName((unsigned short)device); } - QVector ScriptingInterface::getAvailableInputs(unsigned int device) { - return DependencyManager::get()->getAvailableInputs((unsigned short)device); - } - int ScriptingInterface::findDevice(QString name) { return DependencyManager::get()->findDevice(name); } diff --git a/libraries/controllers/src/controllers/ScriptingInterface.h b/libraries/controllers/src/controllers/ScriptingInterface.h index 2886282069..96680dd28c 100644 --- a/libraries/controllers/src/controllers/ScriptingInterface.h +++ b/libraries/controllers/src/controllers/ScriptingInterface.h @@ -73,25 +73,6 @@ namespace controller { ScriptingInterface(); virtual ~ScriptingInterface() {}; - /*@jsdoc - * Gets a list of all available actions. - * @function Controller.getAllActions - * @returns {Action[]} All available actions. - * @deprecated This function is deprecated and will be removed. It no longer works. - */ - // FIXME: This function causes a JavaScript crash: https://highfidelity.manuscript.com/f/cases/edit/13921 - Q_INVOKABLE QVector getAllActions(); - - /*@jsdoc - * Gets a list of all available inputs for a hardware device. - * @function Controller.getAvailableInputs - * @param {number} deviceID - Integer ID of the hardware device. - * @returns {NamedPair[]} All available inputs for the device. - * @deprecated This function is deprecated and will be removed. It no longer works. - */ - // FIXME: This function causes a JavaScript crash: https://highfidelity.manuscript.com/f/cases/edit/13922 - Q_INVOKABLE QVector getAvailableInputs(unsigned int device); - /*@jsdoc * Finds the name of a particular controller from its device ID. * @function Controller.getDeviceName diff --git a/libraries/networking/src/AddressManager.h b/libraries/networking/src/AddressManager.h index 71f5ddc51d..bbf78157bf 100644 --- a/libraries/networking/src/AddressManager.h +++ b/libraries/networking/src/AddressManager.h @@ -549,4 +549,6 @@ private: QUrl _previousAPILookup; }; +Q_DECLARE_METATYPE(AddressManager::LookupTrigger) + #endif // hifi_AddressManager_h diff --git a/libraries/script-engine/src/ScriptValueUtils.cpp b/libraries/script-engine/src/ScriptValueUtils.cpp index bbe2184d4e..665313cb7d 100644 --- a/libraries/script-engine/src/ScriptValueUtils.cpp +++ b/libraries/script-engine/src/ScriptValueUtils.cpp @@ -34,6 +34,7 @@ #include "ScriptValueIterator.h" #include "ScriptEngineLogging.h" #include "v8/FastScriptValueUtils.h" +#include "AddressManager.h" bool isListOfStrings(const ScriptValue& arg) { if (!arg.isArray()) { @@ -98,6 +99,8 @@ void registerMetaTypes(ScriptEngine* engine) { scriptRegisterSequenceMetaType>(engine); scriptRegisterSequenceMetaType>(engine); scriptRegisterSequenceMetaType>(engine); + + scriptRegisterMetaType, scriptValueToEnumClass>(engine, "LookupTrigger"); } ScriptValue qVector2DToScriptValue(ScriptEngine* engine, const QVector2D& qVector2D) { diff --git a/libraries/ui/src/ui/TabletScriptingInterface.cpp b/libraries/ui/src/ui/TabletScriptingInterface.cpp index ecaa3aa3c4..42af68f820 100644 --- a/libraries/ui/src/ui/TabletScriptingInterface.cpp +++ b/libraries/ui/src/ui/TabletScriptingInterface.cpp @@ -37,6 +37,7 @@ STATIC_SCRIPT_TYPES_INITIALIZER((+[](ScriptManager* manager){ scriptRegisterMetaType, wrapperFromScriptValue >(scriptEngine); scriptRegisterMetaType, wrapperFromScriptValue >(scriptEngine); + scriptRegisterMetaType, scriptValueToEnumClass>(scriptEngine); })); // FIXME move to global app properties diff --git a/libraries/ui/src/ui/TabletScriptingInterface.h b/libraries/ui/src/ui/TabletScriptingInterface.h index 73de02a22d..d3119cb7ca 100644 --- a/libraries/ui/src/ui/TabletScriptingInterface.h +++ b/libraries/ui/src/ui/TabletScriptingInterface.h @@ -687,5 +687,6 @@ protected: }; Q_DECLARE_METATYPE(TabletButtonProxy*); +Q_DECLARE_METATYPE(TabletScriptingInterface::TabletAudioEvents) #endif // hifi_TabletScriptingInterface_h