From 55612611c679efda5d491944dee75f4768749277 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 30 May 2017 22:03:43 +0100 Subject: SL-694 - stub support for ObjectAnimation message type --- scripts/messages/message_template.msg | 30 ++++++++++++++++++++++++++++-- scripts/messages/message_template.msg.sha1 | 2 +- 2 files changed, 29 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/messages/message_template.msg b/scripts/messages/message_template.msg index c56eaae6fe..3185121a6e 100755 --- a/scripts/messages/message_template.msg +++ b/scripts/messages/message_template.msg @@ -8,7 +8,7 @@ version 2.0 // for each type is listed below: // Low: 423 // Medium: 18 -// High: 29 +// High: 30 // PLEASE UPDATE THIS WHEN YOU ADD A NEW MESSAGE! @@ -3571,7 +3571,6 @@ version 2.0 } } - // AvatarAppearance - Update visual params { AvatarAppearance Low 158 Trusted Zerocoded @@ -7285,6 +7284,33 @@ version 2.0 } +// ************************************************************************* +// Object animation messages +// ************************************************************************* + +// Note this is basically identical to AvatarAnimation. +// Needs to be a different message because existing viewers +// have insufficiently smart handler functions. + +// ObjectAnimation - Update animation state +// simulator --> viewer +{ + ObjectAnimation High 30 Trusted Unencoded + { + Sender Single + { ID LLUUID } + } + { + AnimationList Variable + { AnimID LLUUID } + { AnimSequenceID S32 } + } + { + AnimationSourceList Variable + { ObjectID LLUUID } + } +} + // ************************************************************************* // Asset storage messages // ************************************************************************* diff --git a/scripts/messages/message_template.msg.sha1 b/scripts/messages/message_template.msg.sha1 index 5bc06ec042..88b84e29da 100755 --- a/scripts/messages/message_template.msg.sha1 +++ b/scripts/messages/message_template.msg.sha1 @@ -1 +1 @@ -337f351910b0c8821cb3d447bc6578516a043c80 \ No newline at end of file +428700550e70f611b632e3bb6422fe1d093a0313 \ No newline at end of file -- cgit v1.3 From 74957676fc0b05825abc3af907241479f06fa8c3 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 5 Jun 2017 20:22:59 +0100 Subject: SL-694 - message changes for ObjectAnimation, more logging to validate behavior --- indra/newview/llviewermessage.cpp | 23 +++++++++++------------ scripts/messages/message_template.msg | 4 ---- scripts/messages/message_template.msg.sha1 | 2 +- 3 files changed, 12 insertions(+), 17 deletions(-) (limited to 'scripts') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 6a6e932b4a..2b62ccd62f 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5072,51 +5072,50 @@ void process_object_animation(LLMessageSystem *mesgsys, void **user_data) { LLUUID animation_id; LLUUID uuid; -#if 0 S32 anim_sequence_id; -#endif mesgsys->getUUIDFast(_PREHASH_Sender, _PREHASH_ID, uuid); LLViewerObject *objp = gObjectList.findObject(uuid); if (!objp) { - LL_WARNS("Messaging") << "Received animation state for unknown object" << uuid << LL_ENDL; + LL_WARNS("Messaging") << "AXON Received animation state for unknown object" << uuid << LL_ENDL; return; } LLVOVolume *volp = dynamic_cast(objp); if (!volp) { - LL_WARNS("Messaging") << "Received animation state for non-volume object" << uuid << LL_ENDL; + LL_WARNS("Messaging") << "AXON Received animation state for non-volume object" << uuid << LL_ENDL; return; } if (!volp->isAnimatedMesh()) { - LL_WARNS("Messaging") << "Received animation state for non-animated object" << uuid << LL_ENDL; + LL_WARNS("Messaging") << "AXON Received animation state for non-animated object" << uuid << LL_ENDL; return; } - LL_WARNS() << "ADD SUPPORT FOR OBJECT ANIMATION HERE" << LL_ENDL; -#if 0 S32 num_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_AnimationList); - S32 num_source_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_AnimationSourceList); + LL_WARNS() << "AXON handle object animation here, num_blocks " << num_blocks << LL_ENDL; - avatarp->mSignaledAnimations.clear(); + //avatarp->mSignaledAnimations.clear(); + volp->setDebugText(llformat("Animations %d", num_blocks)); for( S32 i = 0; i < num_blocks; i++ ) { mesgsys->getUUIDFast(_PREHASH_AnimationList, _PREHASH_AnimID, animation_id, i); mesgsys->getS32Fast(_PREHASH_AnimationList, _PREHASH_AnimSequenceID, anim_sequence_id, i); - avatarp->mSignaledAnimations[animation_id] = anim_sequence_id; + //avatarp->mSignaledAnimations[animation_id] = anim_sequence_id; + LL_INFOS() << "AXON got object animation request for object " + << uuid << " animation id " << animation_id << LL_ENDL; } if (num_blocks) { - avatarp->processAnimationStateChanges(); + LL_INFOS() << "AXON process animation state changes here" << LL_ENDL; + //avatarp->processAnimationStateChanges(); } -#endif } diff --git a/scripts/messages/message_template.msg b/scripts/messages/message_template.msg index 3185121a6e..18264ee59c 100755 --- a/scripts/messages/message_template.msg +++ b/scripts/messages/message_template.msg @@ -7305,10 +7305,6 @@ version 2.0 { AnimID LLUUID } { AnimSequenceID S32 } } - { - AnimationSourceList Variable - { ObjectID LLUUID } - } } // ************************************************************************* diff --git a/scripts/messages/message_template.msg.sha1 b/scripts/messages/message_template.msg.sha1 index 88b84e29da..db87ad5e77 100755 --- a/scripts/messages/message_template.msg.sha1 +++ b/scripts/messages/message_template.msg.sha1 @@ -1 +1 @@ -428700550e70f611b632e3bb6422fe1d093a0313 \ No newline at end of file +55df2c7135733c5da64ef8f01859b83a433a3a09 \ No newline at end of file -- cgit v1.3 From 2af5332e46b3917d6dce211e576a92d04c3eda8b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 30 Jun 2017 21:59:39 +0100 Subject: Added cycle_object_animations.lsl. Also change to test.cpp to see if it affects a g++ internal compiler error. --- indra/test/test.cpp | 2 - scripts/testing/lsl/cycle_object_animations.lsl | 53 +++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 scripts/testing/lsl/cycle_object_animations.lsl (limited to 'scripts') diff --git a/indra/test/test.cpp b/indra/test/test.cpp index 630af2b73b..e42374d56b 100644 --- a/indra/test/test.cpp +++ b/indra/test/test.cpp @@ -34,7 +34,6 @@ * */ - #include "linden_common.h" #include "llerrorcontrol.h" #include "lltut.h" @@ -685,5 +684,4 @@ int main(int argc, char **argv) return retval; //delete mycallback; - } diff --git a/scripts/testing/lsl/cycle_object_animations.lsl b/scripts/testing/lsl/cycle_object_animations.lsl new file mode 100644 index 0000000000..95fa99a191 --- /dev/null +++ b/scripts/testing/lsl/cycle_object_animations.lsl @@ -0,0 +1,53 @@ +cycle_animations() +{ + list AnimationList; + integer count = llGetInventoryNumber(INVENTORY_ANIMATION); + string ItemName; + string NowPlaying; + while (count--) + { + ItemName = llGetInventoryName(INVENTORY_ANIMATION, count); + if (NowPlaying != "") + { + llSay(0, "Stopping " + NowPlaying); + llStopObjectAnimation(NowPlaying); + } + llSay(0, "Starting " + ItemName); + llStartObjectAnimation(ItemName); + NowPlaying = ItemName; + llSleep(10); + } + if (NowPlaying != "") + { + llSay(0, "Stopping " + NowPlaying); + llStopObjectAnimation(NowPlaying); + llSleep(10); + } +} + +default +{ + state_entry() + { + llSay(0, "Animated Object here"); + } + + touch_start(integer total_number) + { + llSay(0, "Touch started."); + while (1) + { + cycle_animations(); + } + + } + + touch_end(integer total_number) + { + llSay(0, "Touch ended."); + } +} + +// Local Variables: +// shadow-file-name: "$SW_HOME/axon/scripts/testing/lsl/cycle_object_animations.lsl" +// End: -- cgit v1.3 From f55667397e75991348fa25b6ad581a36de99acf0 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 6 Jul 2017 01:25:10 +0100 Subject: SL-722 - handle per-object animation requests, combine for control avatar animation state. --- indra/newview/app_settings/logcontrol.xml | 1 + indra/newview/llcontrolavatar.cpp | 64 +++++++++++++++++++++++++ indra/newview/llcontrolavatar.h | 3 ++ indra/newview/llviewermessage.cpp | 13 ++--- indra/newview/llvoavatar.cpp | 1 + indra/newview/llvovolume.h | 5 ++ scripts/testing/lsl/cycle_object_animations.lsl | 6 +-- 7 files changed, 82 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index ecd7c4bc36..ddd07dba80 100644 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -50,6 +50,7 @@ tags + AXON