FIRE-34884: Add load selective

Loads a pose to only the joints that are switched off
master
Angeldark Raymaker 2024-11-27 20:57:14 +00:00
parent 627b8dd483
commit d64022b523
4 changed files with 25 additions and 29 deletions

View File

@ -599,6 +599,10 @@ void FSFloaterPoser::onPoseMenuAction(const LLSD& param)
loadType = POSITIONS_AND_SCALES;
else if (loadStyle == "all")
loadType = ROT_POS_AND_SCALES;
else if (loadStyle == "selective")
loadType = SELECTIVE;
else if (loadStyle == "selective_rot")
loadType = SELECTIVE_ROT;
LLVOAvatar* avatar = getUiSelectedAvatar();
if (!avatar)
@ -753,11 +757,12 @@ void FSFloaterPoser::loadPoseFromXml(LLVOAvatar* avatar, const std::string& pose
gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, POSE_SAVE_SUBDIRECTORY, poseFileName + POSE_INTERNAL_FORMAT_FILE_EXT);
bool loadRotations = loadMethod == ROTATIONS || loadMethod == ROTATIONS_AND_POSITIONS || loadMethod == ROTATIONS_AND_SCALES ||
loadMethod == ROT_POS_AND_SCALES;
loadMethod == ROT_POS_AND_SCALES || loadMethod == SELECTIVE || loadMethod == SELECTIVE_ROT;
bool loadPositions = loadMethod == POSITIONS || loadMethod == ROTATIONS_AND_POSITIONS || loadMethod == POSITIONS_AND_SCALES ||
loadMethod == ROT_POS_AND_SCALES;
loadMethod == ROT_POS_AND_SCALES || loadMethod == SELECTIVE;
bool loadScales = loadMethod == SCALES || loadMethod == POSITIONS_AND_SCALES || loadMethod == ROTATIONS_AND_SCALES ||
loadMethod == ROT_POS_AND_SCALES;
loadMethod == ROT_POS_AND_SCALES || loadMethod == SELECTIVE;
bool loadSelective = loadMethod == SELECTIVE || loadMethod == SELECTIVE_ROT;
try
{
@ -808,10 +813,13 @@ void FSFloaterPoser::loadPoseFromXml(LLVOAvatar* avatar, const std::string& pose
if (!poserJoint)
continue;
if (loadSelective && mPoserAnimator.isPosingAvatarJoint(avatar, *poserJoint))
continue;
if (control_map.has("enabled"))
{
enabled = control_map["enabled"].asBoolean();
mPoserAnimator.setPosingAvatarJoint(avatar, *poserJoint, enabled);
mPoserAnimator.setPosingAvatarJoint(avatar, *poserJoint, enabled || loadSelective);
}
if (control_map.has("jointBaseRotationIsZero"))

View File

@ -54,6 +54,8 @@ typedef enum E_LoadPoseMethods
HAND_RIGHT = 8,
HAND_LEFT = 9,
FACE_ONLY = 10,
SELECTIVE = 11,
SELECTIVE_ROT = 12,
} E_LoadPoseMethods;
/// <summary>

View File

@ -1158,7 +1158,7 @@ width="403">
name="button_RecaptureParts"
left_pad="1"
top_delta="0"
tool_tip="If the selected body part(s) is/are OFF, this Recaptures what those body parts are doing right now. This button disables if you start from a T-Pose"
tool_tip="If the selected body part(s) is/are OFF, this Recaptures what those body parts are doing right now."
width="45" >
<button.commit_callback
function="Poser.RecaptureSelectedBones"/>

View File

@ -3,48 +3,34 @@
layout="topleft"
name="Settings">
<menu_item_call
label="Load Rotations only"
label="Load Rotations"
layout="topleft"
tool_tip="Loads just the rotations. Good for poses made for other avatars/shapes"
name="rotations">
<on_click function="Pose.Menu" parameter="rotation"/>
</menu_item_call>
<menu_item_call
label="Load Positions only"
layout="topleft"
name="positions">
<on_click function="Pose.Menu" parameter="position"/>
</menu_item_call>
<menu_item_call
label="Load Scales only"
layout="topleft"
name="scale">
<on_click function="Pose.Menu" parameter="scale"/>
</menu_item_call>
<menu_item_separator
layout="topleft" />
<menu_item_call
label="Load Rotations &amp; Positions"
label="Load Selective"
tool_tip="Loads only the joints that are off, and turns them on"
layout="topleft"
name="rotations_positions">
<on_click function="Pose.Menu" parameter="rot_pos"/>
<on_click function="Pose.Menu" parameter="selective"/>
</menu_item_call>
<menu_item_call
label="Load Rotations &amp; Scales"
label="Load Selective - Rot Only"
tool_tip="Loads only rotations, only to the joints that are off, and turns them on"
layout="topleft"
name="rotations_scales">
<on_click function="Pose.Menu" parameter="rot_scale"/>
</menu_item_call>
<menu_item_call
label="Load Position &amp; Scales"
layout="topleft"
name="positions_scales">
<on_click function="Pose.Menu" parameter="pos_scale"/>
name="rotations_positions">
<on_click function="Pose.Menu" parameter="selective_rot"/>
</menu_item_call>
<menu_item_separator
layout="topleft" />
<menu_item_call
label="Load all"
layout="topleft"
tool_tip="Loads rotations, positions and scales"
name="load_all">
<on_click function="Pose.Menu" parameter="all"/>
</menu_item_call>