这是indexloc提供的服务,不要输入任何密码
Skip to content

iss: 1877 - image import camera transform broken #1878

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

Merged

Conversation

MrStevns
Copy link
Member

Fixes #1877

It's worth noticing that this PR pushes to a 0.7.1 branch.
I think this bug is a good contender to start such a branch, but there are already a bunch of other things we could include as well.

@MrStevns MrStevns changed the title iss: 1877 image import camera transform broken iss: 1877 - image import camera transform broken Sep 23, 2024
@MrStevns MrStevns added the Bug label Sep 24, 2024
@MrStevns MrStevns added this to the 0.7.1 milestone Sep 30, 2024
@chchwy chchwy modified the milestones: 0.7.1, 0.8.0 Nov 11, 2024
Copy link
Member

@J5lx J5lx left a comment

Choose a reason for hiding this comment

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

This appears to work fine for single image imports. For image sequences, however, this appears to fix only the "center of camera" part while further breaking the "follow camera" part which is now completely ineffective.

@MrStevns
Copy link
Member Author

MrStevns commented Feb 16, 2025

Ah crap.. I must have forgotten to test those cases. It's been such a long time since I did this PR. I'll give it a look with a fresh pair of eyes soon.

Thanks for testing

@chchwy chchwy modified the milestones: 0.8.0, 0.7.1 Feb 19, 2025
@chchwy chchwy self-assigned this Feb 19, 2025
@MrStevns
Copy link
Member Author

MrStevns commented Feb 19, 2025

I've made some adjustments, tested all cases and they all work as expected now.

In addition I've also removed getImportView from methods that doesn't make use of the import position dialog. There should preferably be no temp state regarding importing, as such it's also been removed from ViewManager.

Another observation I noticed is that we might have had a bug where the movie importer would use whatever GetImportView was set to, which could result in it being placed at (0,0)

I've also made a small change regarding the default behavior for the Movie Importer, which now uses the Camera Followed option since you can't pick the setting yourself and it's the one that works closest to what one might expect.

Copy link
Member

@J5lx J5lx left a comment

Choose a reason for hiding this comment

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

Thanks, wonderful! The ViewManager cleanup and other fixes are welcome additions. There’s just one small issue left now, which is that when you import an image sequence with the “center of camera, current frame” option, it actually uses the most recent (relative to target position) camera keyframe rather than the current frame. So when you have multiple camera keyframes it actually works more like the “follow camera” option minus interpolation, which is probably not what we want here. Other than that it looks good to me.

@J5lx J5lx self-assigned this Feb 20, 2025
@MrStevns
Copy link
Member Author

MrStevns commented Feb 20, 2025

Ah, you're right. That's a misunderstanding on my part.. I got confused by the "center of camera, current frame" 😅

Should be fixed now though.

edit: actually it's still not quite the same but I'd argue the new logic works better since it takes the transform into account but still uses the actual current frame.

@MrStevns MrStevns requested a review from J5lx February 24, 2025 18:08
Copy link
Member

@J5lx J5lx left a comment

Choose a reason for hiding this comment

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

Yep, looks good to me now, thanks! And sorry for the delay.

@github-project-automation github-project-automation bot moved this from Waiting for Requested Changes to Approved in Pull Request Priority Mar 16, 2025
@J5lx J5lx merged commit 74c034a into pencil2d:release/0.7.1 Mar 16, 2025
7 of 8 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Merged in Pull Request Priority Mar 16, 2025
J5lx added a commit that referenced this pull request Mar 16, 2025
* iss: #1877 - Fix import image using camera transform not working

* Remove dead code

* Fix crash when importing and the scrubber is not on a keyframe

* Fix import to center of camera and camera followed not working

* MovieImporter: Simplify generate frames

* Avoid taking const reference of enum (integer)

* Fix CenterOfCamera should use the import position keyframe, not the current

* Get view of the current frame, not the current keyframe

* Fix mismatched header guard and add missing licence header

---------

Co-authored-by: Jakob Gahde <j5lx@fmail.co.uk>
@MrStevns
Copy link
Member Author

Thanks for reviewing once again and thanks for fixing the header stuff. I always forget to add the license to new files. 😅

@chchwy chchwy mentioned this pull request Jun 19, 2025
32 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants