Add option in Singularity menu to Resync Anims
#close SV-1321
This commit is contained in:
@@ -198,6 +198,23 @@ void invrepair()
|
||||
gInventory.collectDescendents(gInventory.getRootFolderID(),cats,items,FALSE);//,objectnamematches);
|
||||
}
|
||||
|
||||
void resync_anims()
|
||||
{
|
||||
for (S32 i = 0; i < gObjectList.getNumObjects(); ++i)
|
||||
{
|
||||
LLViewerObject* object = gObjectList.getObject(i);
|
||||
if (object && object->isAvatar())
|
||||
{
|
||||
LLVOAvatar& avatarp = *(LLVOAvatar*)object;
|
||||
for (const auto& playpair : avatarp.mPlayingAnimations)
|
||||
{
|
||||
avatarp.stopMotion(playpair.first, TRUE);
|
||||
avatarp.startMotion(playpair.first);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PROF_CTRL_CALLS
|
||||
bool sort_calls(const std::pair<std::string, U32>& left, const std::pair<std::string, U32>& right)
|
||||
{
|
||||
@@ -446,20 +463,7 @@ bool cmd_line_chat(std::string data, EChatType type)
|
||||
}
|
||||
else if (cmd == utf8str_tolower(sResyncAnimCommand)) // Resync Animations
|
||||
{
|
||||
for (S32 i = 0; i < gObjectList.getNumObjects(); i++)
|
||||
{
|
||||
LLViewerObject* object = gObjectList.getObject(i);
|
||||
if (object && object->isAvatar())
|
||||
{
|
||||
LLVOAvatar& avatarp = *(LLVOAvatar*)object;
|
||||
for (LLVOAvatar::AnimIterator it = avatarp.mPlayingAnimations.begin(), end = avatarp.mPlayingAnimations.end(); it != end; ++it)
|
||||
{
|
||||
const std::pair<LLUUID, S32>& playpair = *it;
|
||||
avatarp.stopMotion(playpair.first, TRUE);
|
||||
avatarp.startMotion(playpair.first);
|
||||
}
|
||||
}
|
||||
}
|
||||
resync_anims();
|
||||
return false;
|
||||
}
|
||||
else if (cmd == utf8str_tolower(sKeyToName))
|
||||
|
||||
@@ -2634,6 +2634,15 @@ class LLObjectData : public view_listener_t
|
||||
}
|
||||
};
|
||||
|
||||
class LLSyncAnimations : public view_listener_t
|
||||
{
|
||||
bool handleEvent(const LLSD& userdata)
|
||||
{
|
||||
void resync_anims();
|
||||
resync_anims();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
class LLCanIHasKillEmAll : public view_listener_t
|
||||
{
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
@@ -9494,6 +9503,7 @@ void initialize_menus()
|
||||
addMenu(new SinguCheckPoseStand(), "CheckPoseStand");
|
||||
addMenu(new SinguRebake(), "Rebake");
|
||||
addMenu(new SinguVisibleDebugConsole(), "VisibleRegionDebugConsole");
|
||||
addMenu(new LLSyncAnimations(), "Tools.ResyncAnimations");
|
||||
|
||||
// [RLVa:KB] - Checked: 2010-01-18 (RLVa-1.1.0m) | Added: RLVa-1.1.0m | OK
|
||||
if (rlv_handler_t::isEnabled())
|
||||
|
||||
@@ -1072,6 +1072,10 @@
|
||||
<on_click function="ToggleControl" userdata="Nimble"/>
|
||||
<on_check control="Nimble"/>
|
||||
</menu_item_check>
|
||||
<menu_item_call label="Resync Animations" name="Resync Animations">
|
||||
<menu_item_call.on_click
|
||||
function="Tools.ResyncAnimations" />
|
||||
</menu_item_check>
|
||||
<menu_item_separator mouse_opaque="true" name="separators3"/>
|
||||
<menu_item_check label="Region Tracker" name="Region Tracker">
|
||||
<on_click function="ShowFloater" userdata="region_tracker"/>
|
||||
|
||||
Reference in New Issue
Block a user