FIRE-17251: Allow users to set default values for animation uploads - patch by Sei Lisa; this also fixes FIRE-13738 (Default hand position is spread instead of relaxed)

meow-7.2.2
Ansariel 2015-11-11 14:17:47 +01:00
parent 9036ed275a
commit b97ceaa77b
2 changed files with 30 additions and 10 deletions

View File

@ -166,7 +166,9 @@ void LLFloaterBvhPreview::setAnimCallbacks()
getChild<LLUICtrl>("playback_slider")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onSliderMove, this));
getChild<LLUICtrl>("preview_base_anim")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onCommitBaseAnim, this));
getChild<LLUICtrl>("preview_base_anim")->setValue("Standing");
// <FS:Sei> FIRE-17251: Use the XUI values for defaults
//getChild<LLUICtrl>("preview_base_anim")->setValue("Standing");
// </FS:Sei>
getChild<LLUICtrl>("priority")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onCommitPriority, this));
getChild<LLUICtrl>("loop_check")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onCommitLoop, this));
@ -178,7 +180,9 @@ void LLFloaterBvhPreview::setAnimCallbacks()
getChild<LLUICtrl>("hand_pose_combo")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onCommitHandPose, this));
getChild<LLUICtrl>("emote_combo")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onCommitEmote, this));
getChild<LLUICtrl>("emote_combo")->setValue("[None]");
// <FS:Sei> FIRE-17251: Use the XUI values for defaults
//getChild<LLUICtrl>("emote_combo")->setValue("[None]");
// </FS:Sei>
getChild<LLUICtrl>("ease_in_time")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onCommitEaseIn, this));
getChild<LLUICtrl>("ease_in_time")->setValidateBeforeCommit( boost::bind(&LLFloaterBvhPreview::validateEaseIn, this, _1));
@ -371,13 +375,22 @@ BOOL LLFloaterBvhPreview::loadBVH()
getChild<LLSlider>("playback_slider")->setMinValue(0.0);
getChild<LLSlider>("playback_slider")->setMaxValue(1.0);
getChild<LLUICtrl>("loop_check")->setValue(LLSD(motionp->getLoop()));
getChild<LLUICtrl>("loop_in_point")->setValue(LLSD(motionp->getLoopIn() / motionp->getDuration() * 100.f));
getChild<LLUICtrl>("loop_out_point")->setValue(LLSD(motionp->getLoopOut() / motionp->getDuration() * 100.f));
getChild<LLUICtrl>("priority")->setValue(LLSD((F32)motionp->getPriority()));
getChild<LLUICtrl>("hand_pose_combo")->setValue(LLHandMotion::getHandPoseName(motionp->getHandPose()));
getChild<LLUICtrl>("ease_in_time")->setValue(LLSD(motionp->getEaseInDuration()));
getChild<LLUICtrl>("ease_out_time")->setValue(LLSD(motionp->getEaseOutDuration()));
//<FS:Sei> FIRE-17251: Use defaults from XUI, not from the JointMotionList constructor
//getChild<LLUICtrl>("loop_check")->setValue(LLSD(motionp->getLoop()));
//getChild<LLUICtrl>("loop_in_point")->setValue(LLSD(motionp->getLoopIn() / motionp->getDuration() * 100.f));
//getChild<LLUICtrl>("loop_out_point")->setValue(LLSD(motionp->getLoopOut() / motionp->getDuration() * 100.f));
//getChild<LLUICtrl>("priority")->setValue(LLSD((F32)motionp->getPriority()));
//getChild<LLUICtrl>("hand_pose_combo")->setValue(LLHandMotion::getHandPoseName(motionp->getHandPose()));
//getChild<LLUICtrl>("ease_in_time")->setValue(LLSD(motionp->getEaseInDuration()));
//getChild<LLUICtrl>("ease_out_time")->setValue(LLSD(motionp->getEaseOutDuration()));
motionp->setLoop(getChild<LLUICtrl>("loop_check")->getValue().asBoolean());
motionp->setLoopIn((F32)getChild<LLUICtrl>("loop_in_point")->getValue().asReal() / 100.f * motionp->getDuration());
motionp->setLoopOut((F32)getChild<LLUICtrl>("loop_out_point")->getValue().asReal() / 100.f * motionp->getDuration());
motionp->setPriority(getChild<LLUICtrl>("priority")->getValue().asInteger());
motionp->setHandPose(LLHandMotion::getHandPose(getChild<LLUICtrl>("hand_pose_combo")->getValue().asString()));
motionp->setEaseIn((F32)getChild<LLUICtrl>("ease_in_time")->getValue().asReal());
motionp->setEaseOut((F32)getChild<LLUICtrl>("ease_out_time")->getValue().asReal());
//</FS>
setEnabled(TRUE);
std::string seconds_string;
seconds_string = llformat(" - %.2f seconds", motionp->getDuration());

View File

@ -193,7 +193,7 @@ Maximum animation length is [MAX_LENGTH] seconds.
follows="left|top"
height="23"
increment="1"
initial_value="0"
initial_value="2"
label="Priority"
label_width="88"
layout="topleft"
@ -209,6 +209,7 @@ Maximum animation length is [MAX_LENGTH] seconds.
layout="topleft"
left="10"
width="100"
initial_value="false"
name="loop_check"
tool_tip="Makes this animation loop" />
<spinner
@ -256,6 +257,8 @@ Maximum animation length is [MAX_LENGTH] seconds.
height="23"
layout="topleft"
left_pad="20"
initial_value="Hands_Relaxed"
label=" "
name="hand_pose_combo"
tool_tip="Controls what hands do during animation"
width="130">
@ -330,6 +333,8 @@ Maximum animation length is [MAX_LENGTH] seconds.
width="130"
layout="topleft"
left_pad="20"
initial_value=""
label=" "
name="emote_combo"
tool_tip="Controls what face does during animation">
<item
@ -431,6 +436,8 @@ Maximum animation length is [MAX_LENGTH] seconds.
width="130"
layout="topleft"
left_pad="20"
initial_value="Standing"
label=" "
name="preview_base_anim"
tool_tip="Use this to test your animation behavior while your avatar performs common actions.">
<item