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

[Studio] Bone Tool cleanup #2325

Merged
merged 6 commits into from
Oct 2, 2021

Conversation

rodolforg
Copy link
Contributor

No description provided.

@ice0
Copy link
Collaborator

ice0 commented Sep 21, 2021

@rodolforg Code looks good to me.

@morevnaproject Can you test this PR?

@morevnaproject
Copy link
Member

@morevnaproject Can you test this PR?

Added to my list now. Thank you! ^__^

@rodolforg
Copy link
Contributor Author

@morevnaproject I suggest you to write/record your tests here, because I'll submit another PR related to Bone Tool following this PR approval XD
It will fix a crash with active bone selection changes (after undoes)

} else if (Layer_SkeletonDeformation::Handle::cast_dynamic(layer)) {
std::vector<std::pair<Bone,Bone>> bone_pair_list = (*list_desc.get_value_node())(get_canvas()->get_time()).get_list_of(std::pair<Bone,Bone>());
for (const auto& item : bone_pair_list)
bone_list.push_back(item.second);
Copy link
Member

Choose a reason for hiding this comment

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

After reviewing this part I have realized that there is a bug in original code: it should use "first" bone instead of "second". Because of this bug I was experiencing an issue when it was not possible to select bone as active at some when second bone had different position than second (this usually happens when user deforms image).

So, we should change this part of code from "item.second" to "item.first', but I suggest to do that in separate PR, because it's better to have this PR for cleanup&refactoring only. ^__^

Copy link
Contributor Author

@rodolforg rodolforg Sep 25, 2021

Choose a reason for hiding this comment

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

First item is for resting state and the second one is for posing state, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe it depends on layer activate status?

Copy link
Member

Choose a reason for hiding this comment

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

First item is for resting state and the second one is for posing state, right?

Exactly!

Copy link
Member

Choose a reason for hiding this comment

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

Maybe it depends on layer activate status?

In general case - yes. But Bone Tool always sets the Skeleton Deformation layer to “inactive” state. So, in our case we always deal with “first”.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed via #2340

Copy link
Member

Choose a reason for hiding this comment

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

Thank you! ^__^

morevnaproject
morevnaproject previously approved these changes Sep 25, 2021
@morevnaproject
Copy link
Member

I suggest you to write/record your tests here, because I'll submit another PR related to Bone Tool following this PR approval XD

Woops, I already did my tests before I saw your message! This is a great idea and I will do that next time (I believe we have many more fixes ahead XD).

@morevnaproject
Copy link
Member

The PR is looks good to me! Thank you!

morevnaproject
morevnaproject previously approved these changes Oct 2, 2021
@morevnaproject morevnaproject merged commit fcaa6fb into synfig:master Oct 2, 2021
rodolforg added a commit to rodolforg/synfig that referenced this pull request Oct 15, 2021
morevnaproject pushed a commit that referenced this pull request Oct 18, 2021
@rodolforg rodolforg deleted the studio-bone-tool-cleanup branch October 25, 2021 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants