From 6d9b69cd2e90477aebb5a4de82a44f3f4587fff2 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 7 Apr 2018 16:44:58 +1200 Subject: [PATCH 1/6] Fix cloning a model overlay not cloning animation settings --- interface/src/ui/overlays/ModelOverlay.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/interface/src/ui/overlays/ModelOverlay.cpp b/interface/src/ui/overlays/ModelOverlay.cpp index 1c00f57eec..f8bf2c7a8d 100644 --- a/interface/src/ui/overlays/ModelOverlay.cpp +++ b/interface/src/ui/overlays/ModelOverlay.cpp @@ -35,7 +35,19 @@ ModelOverlay::ModelOverlay(const ModelOverlay* modelOverlay) : _url(modelOverlay->_url), _updateModel(false), _scaleToFit(modelOverlay->_scaleToFit), - _loadPriority(modelOverlay->_loadPriority) + _loadPriority(modelOverlay->_loadPriority), + + _animationURL(modelOverlay->_animationURL), + _animationFPS(modelOverlay->_animationFPS), + _animationCurrentFrame(modelOverlay->_animationCurrentFrame), + _animationFirstFrame(modelOverlay->_animationFirstFrame), + _animationLastFrame(modelOverlay->_animationLastFrame), + _animationRunning(modelOverlay->_animationRunning), + _animationLoop(modelOverlay->_animationLoop), + _animationHold(modelOverlay->_animationHold), + _animationAllowTranslation(modelOverlay->_animationAllowTranslation) + + // Joint translations and rotations aren't copied because the model needs to load before they can be applied. { _model->setLoadingPriority(_loadPriority); if (_url.isValid()) { From 38d7b81a4f93b9e34632512c4f57568787fd6d09 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 7 Apr 2018 16:46:02 +1200 Subject: [PATCH 2/6] Add missing "get" and JSDoc for "loadPriority" property --- interface/src/ui/overlays/ModelOverlay.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/interface/src/ui/overlays/ModelOverlay.cpp b/interface/src/ui/overlays/ModelOverlay.cpp index f8bf2c7a8d..4edd276bb1 100644 --- a/interface/src/ui/overlays/ModelOverlay.cpp +++ b/interface/src/ui/overlays/ModelOverlay.cpp @@ -353,6 +353,8 @@ vectorType ModelOverlay::mapJoints(mapFunction function) const { * parentID is an avatar skeleton. A value of 65535 means "no joint". * * @property {string} url - The URL of the FBX or OBJ model used for the overlay. + * @property {number} loadPriority=0.0 - The priority for loading and displaying the overlay. Overlays with higher values load + * first. * @property {Vec3} dimensions - The dimensions of the overlay. Synonym: size. * @property {Vec3} scale - The scale factor applied to the model's dimensions. * @property {object.} textures - Maps the named textures in the model to the JPG or PNG images in the urls. @@ -396,6 +398,10 @@ QVariant ModelOverlay::getProperty(const QString& property) { } } + if (property == "loadPriority") { + return _loadPriority; + } + if (property == "jointNames") { if (_model && _model->isActive()) { // note: going through Rig because Model::getJointNames() (which proxies to FBXGeometry) was always empty From ba020854b6df003016c9e55157cade2b854af99e Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 7 Apr 2018 16:46:44 +1200 Subject: [PATCH 3/6] Add missing "animationSettings.currentFrame" property JSDoc --- interface/src/ui/overlays/ModelOverlay.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/interface/src/ui/overlays/ModelOverlay.cpp b/interface/src/ui/overlays/ModelOverlay.cpp index 4edd276bb1..a683220819 100644 --- a/interface/src/ui/overlays/ModelOverlay.cpp +++ b/interface/src/ui/overlays/ModelOverlay.cpp @@ -369,6 +369,7 @@ vectorType ModelOverlay::mapJoints(mapFunction function) const { * @property {number} animationSettings.fps=0 - The frame rate (frames/sec) to play the animation at. * @property {number} animationSettings.firstFrame=0 - The frame to start playing at. * @property {number} animationSettings.lastFrame=0 - The frame to finish playing at. + * @property {number} animationSettings.currentFrame=0 - The current frame being played. * @property {boolean} animationSettings.running=false - Whether or not the animation is playing. * @property {boolean} animationSettings.loop=false - Whether or not the animation should repeat in a loop. * @property {boolean} animationSettings.hold=false - Whether or not when the animation finishes, the rotations and From 96178404c71e8cf9c4daae8fa05684ce81163319 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 7 Apr 2018 16:47:38 +1200 Subject: [PATCH 4/6] Document that jointTranslations and jointRotations are not cloned --- interface/src/ui/overlays/ModelOverlay.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/interface/src/ui/overlays/ModelOverlay.cpp b/interface/src/ui/overlays/ModelOverlay.cpp index a683220819..e3604cf2ae 100644 --- a/interface/src/ui/overlays/ModelOverlay.cpp +++ b/interface/src/ui/overlays/ModelOverlay.cpp @@ -359,8 +359,10 @@ vectorType ModelOverlay::mapJoints(mapFunction function) const { * @property {Vec3} scale - The scale factor applied to the model's dimensions. * @property {object.} textures - Maps the named textures in the model to the JPG or PNG images in the urls. * @property {Array.} jointNames - The names of the joints - if any - in the model. Read-only - * @property {Array.} jointRotations - The relative rotations of the model's joints. - * @property {Array.} jointTranslations - The relative translations of the model's joints. + * @property {Array.} jointRotations - The relative rotations of the model's joints. Not copied if overlay is + * cloned. + * @property {Array.} jointTranslations - The relative translations of the model's joints. Not copied if overlay is + * cloned. * @property {Array.} jointOrientations - The absolute orientations of the model's joints, in world coordinates. * Read-only * @property {Array.} jointPositions - The absolute positions of the model's joints, in world coordinates. From 8093e3e5ae7c283b20acf3df6960ca6cd5f2a136 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 7 Apr 2018 16:48:05 +1200 Subject: [PATCH 5/6] Fix some miscellaneous JSDoc typos --- interface/src/ui/overlays/ModelOverlay.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/interface/src/ui/overlays/ModelOverlay.cpp b/interface/src/ui/overlays/ModelOverlay.cpp index e3604cf2ae..7787766ce1 100644 --- a/interface/src/ui/overlays/ModelOverlay.cpp +++ b/interface/src/ui/overlays/ModelOverlay.cpp @@ -358,15 +358,15 @@ vectorType ModelOverlay::mapJoints(mapFunction function) const { * @property {Vec3} dimensions - The dimensions of the overlay. Synonym: size. * @property {Vec3} scale - The scale factor applied to the model's dimensions. * @property {object.} textures - Maps the named textures in the model to the JPG or PNG images in the urls. - * @property {Array.} jointNames - The names of the joints - if any - in the model. Read-only + * @property {Array.} jointNames - The names of the joints - if any - in the model. Read-only. * @property {Array.} jointRotations - The relative rotations of the model's joints. Not copied if overlay is * cloned. * @property {Array.} jointTranslations - The relative translations of the model's joints. Not copied if overlay is * cloned. * @property {Array.} jointOrientations - The absolute orientations of the model's joints, in world coordinates. - * Read-only + * Read-only. * @property {Array.} jointPositions - The absolute positions of the model's joints, in world coordinates. - * Read-only + * Read-only. * @property {string} animationSettings.url="" - The URL of an FBX file containing an animation to play. * @property {number} animationSettings.fps=0 - The frame rate (frames/sec) to play the animation at. * @property {number} animationSettings.firstFrame=0 - The frame to start playing at. From f3a745b6cb52ed819f32cc591cea25777c30c577 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 7 Apr 2018 18:53:27 +1200 Subject: [PATCH 6/6] Fix initialization order --- interface/src/ui/overlays/ModelOverlay.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/ui/overlays/ModelOverlay.cpp b/interface/src/ui/overlays/ModelOverlay.cpp index 7787766ce1..7edc03490c 100644 --- a/interface/src/ui/overlays/ModelOverlay.cpp +++ b/interface/src/ui/overlays/ModelOverlay.cpp @@ -40,10 +40,10 @@ ModelOverlay::ModelOverlay(const ModelOverlay* modelOverlay) : _animationURL(modelOverlay->_animationURL), _animationFPS(modelOverlay->_animationFPS), _animationCurrentFrame(modelOverlay->_animationCurrentFrame), - _animationFirstFrame(modelOverlay->_animationFirstFrame), - _animationLastFrame(modelOverlay->_animationLastFrame), _animationRunning(modelOverlay->_animationRunning), _animationLoop(modelOverlay->_animationLoop), + _animationFirstFrame(modelOverlay->_animationFirstFrame), + _animationLastFrame(modelOverlay->_animationLastFrame), _animationHold(modelOverlay->_animationHold), _animationAllowTranslation(modelOverlay->_animationAllowTranslation)