Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fire 34747: Refactor for Base/Delta-Rotations, bug fixes #51

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

AngeldarkRaymaker
Copy link
Contributor

Bulk of the work has been refactoring/renaming.
I broke out the class that stores the rot/pos/scale for an lljoint into new files.
Fixed the named case (about undo/redo of scales being wonky).
Refactored the redo/undo pieces into generic methods.

Got rid of some code smells behind the UI regarding recapture of joint state. All that neatened up well with separate treatment for the base and delta rotation. I gave position and scale the same do-over just for completeness. I've thought more on the UX this time.

There's a new feature to reset the base rotation when you start editing a joint... I think it makes a nice middle-ground between making your own pose and capturing/re-working someone else's.

I have a mostly working BVH exporter, but it's not in this PR. BVH can't do elbows it seems: there's some restrictions on rotation it's content with or something? Maybe I'm doing something wrong...
Beq, you mentioned wanting to take anim saving... Maybe that's the way to go?

If there's any code-tidying tools you use, please let me know. I can never tell when I orphan something.

remove recapture code smell, refactor double click
Refactor undo/redo to generic, tiny rework to UI sliders for delta usage
Recapture now undo/redo, load from zero rot now per joint, fix joint reflection, fix delta mode
broken after refactor; tidy up
@@ -160,6 +159,14 @@ bool FSFloaterPoser::postBuild()
if (gSavedSettings.getBOOL(POSER_ADVANCEDWINDOWSTATE_SAVE_KEY))
mToggleAdvancedPanelBtn->setValue(true);

mStopPosingOnCloseCbx = getChild<LLCheckBoxCtrl>("stop_posing_on_close_checkbox");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed - By specifying the control_name attribute in the XML file it handles setting the checkbox and storing the value.

Copy link
Collaborator

@Ansariel Ansariel Nov 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You actually removed the wrong part. mToggleAdvancedPanelBtn still needs manual handling, but not mStopPosingOnCloseCbx

Also both mStopPosingOnCloseCbx and mResetBaseRotOnEditCbx can be removed entirely.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

facepalm sorry
mResetBaseRotOnEditCbx had one reference in getWhetherToResetBaseRotationOnEdit() right at the bottom... but I can just go get the setting.. so all removed, cheers.

@@ -231,6 +236,12 @@ void FSFloaterPoser::onClose(bool app_quitting)
if (mToggleAdvancedPanelBtn)
gSavedSettings.setBOOL(POSER_ADVANCEDWINDOWSTATE_SAVE_KEY, mToggleAdvancedPanelBtn->getValue().asBoolean());

if (mStopPosingOnCloseCbx)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed - same as mentioned above.

mRotation = FSJointRotation(mRotation.baseRotation, rot);
}

void FSJointPose::setScaleDelta(LLVector3 scale)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scale should be passed as const LLVector3&

deltaRotation.set(delta);
}

FSJointRotation() {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be omitted or changed into FSJointRotation() = default;

deltaRotation.mQ[VZ] *= -1;
}

void set(FSJointRotation jRot)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

void set(const FSJoingRotation& jRot)

@@ -139,6 +139,7 @@ set(viewer_SOURCE_FILES
fsfloatervramusage.cpp
fsfloaterwearablefavorites.cpp
fsfloaterwhitelisthelper.cpp
fsjointpose.cpp
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to add the header file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot a bunch of them... all added, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants