more debugging on animation.running

This commit is contained in:
Brad Hefta-Gaub 2015-10-05 14:17:12 -07:00
parent 6f86b0f550
commit 8c8e83dc8e
5 changed files with 41 additions and 14 deletions

View file

@ -10,6 +10,15 @@
var DEGREES_TO_RADIANS = PI / 180.0;
var RADIANS_TO_DEGREES = 180.0 / PI;
debugPrint = function(message) {
EventBridge.emitWebEvent(
JSON.stringify({
type:"print",
message: message
})
);
};
function enableChildren(el, selector) {
els = el.querySelectorAll(selector);
for (var i = 0; i < els.length; i++) {
@ -37,10 +46,11 @@
};
}
function createEmitGroupCheckedPropertyUpdateFunction(group, propertyName) {
return function() {
return function () {
var properties = {};
properties[group] = {};
properties[group][propertyName] = this.checked;
//debugPrint(" about to emitWebEvent() properties:" + JSON.stringify(properties));
EventBridge.emitWebEvent(
JSON.stringify({
type: "update",

View file

@ -93,11 +93,14 @@ 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();
}
*/
}
@ -193,7 +196,7 @@ bool AnimationPropertyGroup::appendToEditPacket(OctreePacketData* packetData,
if (_animationLoop) {
APPEND_ENTITY_PROPERTY(PROP_ANIMATION_FPS, _animationLoop->getFPS());
APPEND_ENTITY_PROPERTY(PROP_ANIMATION_FRAME_INDEX, _animationLoop->getFrameIndex());
APPEND_ENTITY_PROPERTY(PROP_ANIMATION_FRAME_INDEX, _animationLoop->getRunning());
APPEND_ENTITY_PROPERTY(PROP_ANIMATION_PLAYING, _animationLoop->getRunning());
APPEND_ENTITY_PROPERTY(PROP_ANIMATION_LOOP, _animationLoop->getLoop());
APPEND_ENTITY_PROPERTY(PROP_ANIMATION_FIRST_FRAME, _animationLoop->getFirstFrame());
APPEND_ENTITY_PROPERTY(PROP_ANIMATION_LAST_FRAME, _animationLoop->getLastFrame());
@ -202,7 +205,7 @@ bool AnimationPropertyGroup::appendToEditPacket(OctreePacketData* packetData,
} else {
APPEND_ENTITY_PROPERTY(PROP_ANIMATION_FPS, getFPS());
APPEND_ENTITY_PROPERTY(PROP_ANIMATION_FRAME_INDEX, getFrameIndex());
APPEND_ENTITY_PROPERTY(PROP_ANIMATION_FRAME_INDEX, getRunning());
APPEND_ENTITY_PROPERTY(PROP_ANIMATION_PLAYING, getRunning());
APPEND_ENTITY_PROPERTY(PROP_ANIMATION_LOOP, getLoop());
APPEND_ENTITY_PROPERTY(PROP_ANIMATION_FIRST_FRAME, getFirstFrame());
APPEND_ENTITY_PROPERTY(PROP_ANIMATION_LAST_FRAME, getLastFrame());
@ -210,13 +213,6 @@ bool AnimationPropertyGroup::appendToEditPacket(OctreePacketData* packetData,
APPEND_ENTITY_PROPERTY(PROP_ANIMATION_START_AUTOMATICALLY, getStartAutomatically());
}
if (_animationLoop) {
qDebug() << "appendToEditPacket() running:" << _animationLoop->getRunning();
} else {
qDebug() << "appendToEditPacket() running:" << getRunning();
}
return true;
}
@ -260,11 +256,18 @@ bool AnimationPropertyGroup::decodeFromEditPacket(EntityPropertyFlags& propertyF
processedBytes += bytesRead;
if (_animationLoop) {
qDebug() << "decodeFromEditPacket() running:" << _animationLoop->getRunning();
/*
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() << "decodeFromEditPacket() running:" << getRunning();
qDebug() << "AnimationPropertyGroup::decodeFromEditPacket() packet did not contain PROP_ANIMATION_PLAYING";
}
*/
return true;
}
@ -339,11 +342,13 @@ bool AnimationPropertyGroup::setProperties(const EntityItemProperties& propertie
SET_ENTITY_GROUP_PROPERTY_FROM_PROPERTIES(Animation, StartAutomatically, startAutomatically, setStartAutomatically);
}
/*
if (_animationLoop) {
qDebug() << "setProperties() running:" << _animationLoop->getRunning();
} else {
qDebug() << "setProperties() running:" << getRunning();
}
*/
return somethingChanged;
}
@ -395,11 +400,13 @@ void AnimationPropertyGroup::appendSubclassData(OctreePacketData* packetData, En
APPEND_ENTITY_PROPERTY(PROP_ANIMATION_START_AUTOMATICALLY, getStartAutomatically());
}
/*
if (_animationLoop) {
qDebug() << "appendSubclassData() running:" << _animationLoop->getRunning();
} else {
qDebug() << "appendSubclassData() running:" << getRunning();
}
*/
}
@ -433,11 +440,13 @@ int AnimationPropertyGroup::readEntitySubclassDataFromBuffer(const unsigned char
READ_ENTITY_PROPERTY(PROP_ANIMATION_START_AUTOMATICALLY, bool, setStartAutomatically);
}
/*
if (_animationLoop) {
qDebug() << "readEntitySubclassDataFromBuffer() running:" << _animationLoop->getRunning();
} else {
qDebug() << "readEntitySubclassDataFromBuffer() running:" << getRunning();
}
*/
return bytesRead;
}

View file

@ -1150,7 +1150,6 @@ bool EntityItemProperties::encodeEntityEditPacket(PacketType command, EntityItem
// If any part of the model items didn't fit, then the element is considered partial
if (appendState != OctreeElement::COMPLETED) {
// TODO: handle mechanism for handling partial fitting data!
// add this item into our list for the next appendElementData() pass
//modelTreeElementExtraEncodeData->includedItems.insert(getEntityItemID(), propertiesDidntFit);

View file

@ -583,6 +583,8 @@ int EntityTree::processEditPacketData(NLPacket& packet, const unsigned char* edi
case PacketType::EntityAdd:
case PacketType::EntityEdit: {
qCDebug(entities) << "EntityTree::processEditPacketData()... EntityAdd/EntityEdit";
quint64 startDecode = 0, endDecode = 0;
quint64 startLookup = 0, endLookup = 0;
quint64 startUpdate = 0, endUpdate = 0;

View file

@ -77,6 +77,8 @@ bool ModelEntityItem::setProperties(const EntityItemProperties& properties) {
setLastEdited(properties._lastEdited);
}
//qDebug() << "ModelEntityItem::setProperties() id:" << getEntityItemID() << " running:" << getAnimationIsPlaying();
return somethingChanged;
}
@ -121,6 +123,8 @@ int ModelEntityItem::readEntitySubclassDataFromBuffer(const unsigned char* data,
READ_ENTITY_PROPERTY(PROP_SHAPE_TYPE, ShapeType, updateShapeType);
//qDebug() << "ModelEntityItem::readEntitySubclassDataFromBuffer() id:" << getEntityItemID() << " running:" << getAnimationIsPlaying();
return bytesRead;
}
@ -156,6 +160,9 @@ 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();
}