-
Notifications
You must be signed in to change notification settings - Fork 279
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
Enhanced relative layer visibility #1160
Enhanced relative layer visibility #1160
Conversation
This brings back relative layer transparency with a slight enhancement or similarity to the real world. The top layer is at the bottom of the visibility stack, meaning that once the top is selected, other layers aren't shown. As soon as you move down the stack (or add more papers to the light board) then the drawings behind will become more and more opaque.
Adds: + Shortcuts to change overall layer visibility + Ability to toggle visibility backwards using right-click
@candyface YES!!!!!!! Thank you so much! I know many people will love to have this back, myself included! 😄 |
@candyface Alright I've read through all your notes. I just have one question. Will the visibility state be saved in a working pencil2d file? or will it be saved in the pencil2d preferences? I mean It's ok that transparent is default for a new user, but if the user presses alt +3 to make it fully opaque, will this change revert the next time they either open the program or open a new file? |
@Jose-Moreno The visibility state is not saved atm. so when you reopen a project it'll start as relative like it always has. I'll look into seeing if I can add that to the project file. edit: correction, it is saved but it is being set to 1 (relative) when loading the xml. I will fix that. |
@Jose-Moreno The visibility state is now being saved and loaded as requested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I don't think it's good idea to have this feature enabled by default. I'm not debating the usefulness of this feature to some people, but I think the majority of our users, particular the ones new to animation, will see this as a bug. Let's not forget that the reason this was removed in the first place was because of the numerous complaints about parts of their drawing becoming translucent. The 'improvements' in this PR will only make things worse. People will create a layer for their background and then a character layer on top of it and think "wtf where is my background? this program sukz" or something along those lines.
I've reworked the algorithm now so it goes both ways. So now it's "true" relative opacity based on the current layer in each direction as opposed to before where it only went downwards and the top layer would be the bottom of the stack and the only visible one. Additionally I have also implemented the ability to select the startup value for the global dot visibility mode. @scribblemaniac That's true I almost forgot about that. @Jose-Moreno A correction from my last comment, the visibility state that I was speaking about was simply whether a layer was visible or not, since that wasn't handled either. The global layer visibility state was not loaded or saved prior to my last commit but now it's possible to set the startup value through the preference dialog. It is not project based currently. |
2c5c49d
to
bcae158
Compare
bcae158
to
787d9a4
Compare
PR now up to date and everything still works. |
Finally got around updating the code after the other painting changes, can be reviewed now. |
Because the parent implementation of mouseDoubleClickEvent was never being called, the second mouse event never fires, causing some mouse presses to not change the visibility. This wasn't a big issue with most of the other timeline functions because clicking twice in the same place usually has the same effect as clicking once or a double click action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's almost there, but there are still some changes to be made. Many minor refactoring things, a couple functional things, and a couple points to discuss further.
In addition to what is mention in my review comments, I have one further issue to note that I did not have a good place to put: the dot color is not updated to the correct value when Pencil2D is started. You probably need some extra code in timelinecells
Add default layer values if none is found Fix comparison of floating pointer warning Fix optionid being float where it should be int Use layerVisibility enum instead of int consistently Always render layers on camera layer Simplify condition Fix warning Fix cosmetics Add layer opacity threshold as parameter to CanvasPainterOptions Fix spinbox not going beyond 52... Move layer and onion skin into own section Move layer visibility to View instead of Layer Fix UI bugs Fix warning and remove debug statement LayerVisibility should be 2 by default Refactor some cosmetics Remove redundant check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Next batch of comments ready to go. Additionally, the keyboard shortcuts do not appear to be working anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from a couple very small things which I'll just handle myself, I think this is finally ready. Merging now, thanks for your work and patience @candyface.
I have also implemented the ability to select the startup value for the global dot visibility mode.


fullfills and closes #1112
This PR adds:
~~- This brings back relative layer transparency with slight enhancements.
Given the state of the timeline, I've left these out. I personally think that relative layer visibility should still be default, at least until it becomes apparent enough what the dots are used for (ie. to be changed via the timeline rewrite.)Not implemented exactly as requested:
You can cycle backwards using right-click now,