From 016bf4011d4a7e6d1600c7ffa72a973f8afc0ed0 Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Tue, 6 Oct 2015 16:07:36 -0700 Subject: [PATCH] cleanup --- .../example/entities/animatedModelExample.js | 20 +-------- libraries/animation/src/AnimationLoop.cpp | 1 - .../src/RenderableModelEntityItem.cpp | 2 - .../entities/src/AnimationPropertyGroup.cpp | 43 ------------------- libraries/entities/src/ModelEntityItem.cpp | 25 ++--------- 5 files changed, 4 insertions(+), 87 deletions(-) diff --git a/examples/example/entities/animatedModelExample.js b/examples/example/entities/animatedModelExample.js index 6c97671463..1e7869559e 100644 --- a/examples/example/entities/animatedModelExample.js +++ b/examples/example/entities/animatedModelExample.js @@ -20,14 +20,6 @@ var yaw = 0.0; var roll = 0.0; var rotation = Quat.fromPitchYawRollDegrees(pitch, yaw, roll); -var animationSettings = JSON.stringify({ - loop: true, - running: true, - fps: 30, - firstFrame: 10, - lastFrame: 20, -}); - var originalProperties = { type: "Model", position: { x: MyAvatar.position.x, @@ -45,12 +37,6 @@ var originalProperties = { modelURL: "http://public.highfidelity.io/cozza13/club/dragon/dragon.fbx", rotation: rotation, - - - animationURL: "http://public.highfidelity.io/cozza13/club/dragon/flying.fbx", - animationSettings: animationSettings, - //animationIsPlaying: true, - /* animation: { url: "http://public.highfidelity.io/cozza13/club/dragon/flying.fbx", running: true, @@ -59,7 +45,6 @@ var originalProperties = { lastFrame: 20, loop: true } - */ }; var modelID = Entities.addEntity(originalProperties); @@ -120,8 +105,6 @@ function moveModel(deltaTime) { if (somethingChanged) { var newProperties = { - //animationIsPlaying: isPlaying, - //animationFPS: animationFPS, animation: { running: isPlaying, fps: animationFPS @@ -130,7 +113,6 @@ function moveModel(deltaTime) { if (resetFrame) { print("resetting the frame!"); - //newProperties.animationFrameIndex = 0; newProperties.animation.frameIndex = 0; resetFrame = false; } @@ -141,7 +123,7 @@ function moveModel(deltaTime) { // register the call back so it fires before each data send -//Script.update.connect(moveModel); +Script.update.connect(moveModel); Script.scriptEnding.connect(function () { diff --git a/libraries/animation/src/AnimationLoop.cpp b/libraries/animation/src/AnimationLoop.cpp index ee07558c4a..59b8e7d209 100644 --- a/libraries/animation/src/AnimationLoop.cpp +++ b/libraries/animation/src/AnimationLoop.cpp @@ -104,7 +104,6 @@ void AnimationLoop::setRunning(bool running) { // If we just set running to true, then also reset the frame to the first frame if (running && (_resetOnRunning)) { // move back to the beginning - qDebug() << "resetting _frameIndex:" << _frameIndex << "to _firstFrame:" << _firstFrame; _frameIndex = _firstFrame; } diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp index 54f5c384e0..ed088bc9b5 100644 --- a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp @@ -269,7 +269,6 @@ void RenderableModelEntityItem::render(RenderArgs* args) { if (_model) { // handle animations.. if (hasAnimation()) { - //qDebug() << "RenderableModelEntityItem::render() -- hasAnimation()"; if (!jointsMapped()) { QStringList modelJointNames = _model->getJointNames(); mapJoints(modelJointNames); @@ -280,7 +279,6 @@ void RenderableModelEntityItem::render(RenderArgs* args) { QVector frameDataRotations; QVector frameDataTranslations; getAnimationFrame(newFrame, frameDataRotations, frameDataTranslations); - qDebug() << "RenderableModelEntityItem::render() -- getAnimationFrame() newFrame:" << newFrame; assert(frameDataRotations.size() == frameDataTranslations.size()); if (newFrame) { for (int i = 0; i < frameDataRotations.size(); i++) { diff --git a/libraries/entities/src/AnimationPropertyGroup.cpp b/libraries/entities/src/AnimationPropertyGroup.cpp index a7e77a75e0..f648c4c06e 100644 --- a/libraries/entities/src/AnimationPropertyGroup.cpp +++ b/libraries/entities/src/AnimationPropertyGroup.cpp @@ -93,15 +93,6 @@ void AnimationPropertyGroup::copyFromScriptValue(const QScriptValue& object, boo COPY_PROPERTY_FROM_QSCRIPTVALUE_GETTER(animationFrameIndex, float, setFrameIndex, getFrameIndex); } - /* - if (_animationLoop) { - qDebug() << "copyFromScriptValue() running:" << _animationLoop->getRunning(); - } else { - qDebug() << "copyFromScriptValue() running:" << getRunning(); - } - */ - - } void AnimationPropertyGroup::setFromOldAnimationSettings(const QString& value) { @@ -256,19 +247,6 @@ bool AnimationPropertyGroup::decodeFromEditPacket(EntityPropertyFlags& propertyF processedBytes += bytesRead; - /* - if (propertyFlags.getHasProperty(PROP_ANIMATION_PLAYING)) { - qDebug() << "AnimationPropertyGroup::decodeFromEditPacket() DID contain PROP_ANIMATION_PLAYING -----------"; - if (_animationLoop) { - qDebug() << " decodeFromEditPacket() _animationLoop->getRunning:" << _animationLoop->getRunning(); - } else { - qDebug() << " decodeFromEditPacket() getRunning:" << getRunning(); - } - } else { - qDebug() << "AnimationPropertyGroup::decodeFromEditPacket() packet did not contain PROP_ANIMATION_PLAYING"; - } - */ - return true; } @@ -342,12 +320,6 @@ bool AnimationPropertyGroup::setProperties(const EntityItemProperties& propertie SET_ENTITY_GROUP_PROPERTY_FROM_PROPERTIES(Animation, StartAutomatically, startAutomatically, setStartAutomatically); } - if (_animationLoop) { - qDebug() << "setProperties() _animationLoop->running:" << _animationLoop->getRunning(); - } else { - qDebug() << "setProperties() running:" << getRunning(); - } - _somethingChanged = somethingChanged; return somethingChanged; @@ -399,15 +371,6 @@ void AnimationPropertyGroup::appendSubclassData(OctreePacketData* packetData, En APPEND_ENTITY_PROPERTY(PROP_ANIMATION_HOLD, getHold()); APPEND_ENTITY_PROPERTY(PROP_ANIMATION_START_AUTOMATICALLY, getStartAutomatically()); } - - /* - if (_animationLoop) { - qDebug() << "appendSubclassData() running:" << _animationLoop->getRunning(); - } else { - qDebug() << "appendSubclassData() running:" << getRunning(); - } - */ - } int AnimationPropertyGroup::readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead, @@ -467,11 +430,5 @@ int AnimationPropertyGroup::readEntitySubclassDataFromBuffer(const unsigned char - if (_animationLoop) { - qDebug() << "readEntitySubclassDataFromBuffer() _animationLoop->running:" << _animationLoop->getRunning(); - } else { - qDebug() << "readEntitySubclassDataFromBuffer() running:" << getRunning(); - } - return bytesRead; } diff --git a/libraries/entities/src/ModelEntityItem.cpp b/libraries/entities/src/ModelEntityItem.cpp index 73119f4211..1eafc50141 100644 --- a/libraries/entities/src/ModelEntityItem.cpp +++ b/libraries/entities/src/ModelEntityItem.cpp @@ -80,10 +80,6 @@ bool ModelEntityItem::setProperties(const EntityItemProperties& properties) { setLastEdited(properties._lastEdited); } - qDebug() << "ModelEntityItem::setProperties() id:" << getEntityItemID() - << " properties.animation.running:" << properties.getAnimation().getRunning() - << " running:" << getAnimationIsPlaying(); - return somethingChanged; } @@ -114,16 +110,11 @@ int ModelEntityItem::readEntitySubclassDataFromBuffer(const unsigned char* data, READ_ENTITY_PROPERTY(PROP_TEXTURES, QString, setTextures); - qDebug() << "ModelEntityItem::readEntitySubclassDataFromBuffer() id:" << getEntityItemID() << " args.bitstreamVersion:" << args.bitstreamVersion << " VERSION_ENTITIES_ANIMATION_PROPERTIES_GROUP:" << VERSION_ENTITIES_ANIMATION_PROPERTIES_GROUP; - if (args.bitstreamVersion < VERSION_ENTITIES_ANIMATION_PROPERTIES_GROUP) { READ_ENTITY_PROPERTY(PROP_ANIMATION_SETTINGS, QString, setAnimationSettings); } else { // Note: since we've associated our _animationProperties with our _animationLoop, the readEntitySubclassDataFromBuffer() // will automatically read into the animation loop - - qDebug() << "ModelEntityItem::readEntitySubclassDataFromBuffer() id:" << getEntityItemID() << " calling _animationProperties.readEntitySubclassDataFromBuffer()"; - int bytesFromAnimation = _animationProperties.readEntitySubclassDataFromBuffer(dataAt, (bytesLeftToRead - bytesRead), args, propertyFlags, overwriteLocalData); @@ -133,8 +124,6 @@ int ModelEntityItem::readEntitySubclassDataFromBuffer(const unsigned char* data, READ_ENTITY_PROPERTY(PROP_SHAPE_TYPE, ShapeType, updateShapeType); - qDebug() << "ModelEntityItem::readEntitySubclassDataFromBuffer() id:" << getEntityItemID() << " running:" << getAnimationIsPlaying(); - if (_animationProperties.somethingChanged()) { _dirtyFlags |= EntityItem::DIRTY_UPDATEABLE; } @@ -174,9 +163,6 @@ void ModelEntityItem::appendSubclassData(OctreePacketData* packetData, EncodeBit propertyFlags, propertiesDidntFit, propertyCount, appendState); APPEND_ENTITY_PROPERTY(PROP_SHAPE_TYPE, (uint32_t)getShapeType()); - - //qDebug() << "ModelEntityItem::appendSubclassData() id:" << getEntityItemID() << " running:" << getAnimationIsPlaying(); - } @@ -237,7 +223,6 @@ void ModelEntityItem::getAnimationFrame(bool& newFrame, int frameCount = frames.size(); if (frameCount > 0) { - qDebug() << "getAnimationFrameIndex:" << getAnimationFrameIndex(); int animationFrameIndex = (int)(glm::floor(getAnimationFrameIndex())) % frameCount; if (animationFrameIndex < 0 || animationFrameIndex > frameCount) { animationFrameIndex = 0; @@ -281,13 +266,9 @@ bool ModelEntityItem::needsToCallUpdate() const { void ModelEntityItem::update(const quint64& now) { - // only worry about this if we have an animation - if (hasAnimation()) { - // only advance the frame index if we're playing - if (getAnimationIsPlaying()) { - _animationLoop.simulateAtTime(now); - qDebug() << "ModelEntityItem::update() getAnimationIsPlaying():" << getAnimationIsPlaying() << "frame:" << getAnimationFrameIndex(); - } + // only advance the frame index if we're playing + if (getAnimationIsPlaying()) { + _animationLoop.simulateAtTime(now); } EntityItem::update(now); // let our base class handle it's updates...