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
Horizontal timeline option in Xsheet (issue#503) #1019
Conversation
Now screen (x, y) of various Xsheet UI items depend on both (row, col). Row means frame number; column means layer number. Keeping old terms. Orientation class is responsible for mapping timeline either horizontally or vertically.
Size of cell varies in vertical and horizontal layout Dropped right to left orientation
Splitting too long draw cells into several functions Orientation can now produce lines Preparing to display drag handle and locked dotted line Improved drawing of sound cell
Drawing drag handle on the top side of the cell Drawing locked dotted line on the top side Factored out similarities of drawing various kinds of cells
Refactored it as a dimension
Orientation also provides painter paths
Fixed an upper extender crash
Moved orientation to toonzlib
Xsheet now features a flip orientation button. When multiple Xsheet windows are open, flip is slightly buggy due to use of shared columns fan.
Xsheet now stores a column fan for each orientation XsheetViewers view mode can be toggled independently
Sound was too wide in vertical mode
Resized cell in horizontal mode. Added precautions against nullptr orientation and other fields.
Fixed highlighting area
Fixed scroll bar regression by making disconnect more specific
Adjusted display of markers
Adjusted drawing onion in both layouts
There was a minor issue with misbehaving dragging Onion handle up in horizontal layout.
@Agnyy I saw the video on YouTube showing some of them already implemented. Is that code available? |
@turtleTooth The programmer had to lay out. Here you can look it up. If you do not find it then let me tell the programmer to send the information. https://github.com/jaros3/opentoonz/tree/feature/timeline-func |
@shun-iwasawa I forgot that I had to force the official OT releases in the normal installation folder to use GPU in order to run decently on my system. For testing purposes, I was running right out of the Release/RelWithDebInfo folders after building which wasn't set up to use GPU and therefore ran badly. After setting the builds in my dev environments to use GPU, I see no issue with performance. |
@manongjohn Thank you for all your work with this. You are awesome! I am playing with getting text levels working again in OpenToonz. (They started out only for Magpie Pro files, but I am working at expanding their functionality.) Could you load this scene and see how it looks in the horizontal timeline? |
@turtleTooth I saw there was a column type of "SoundText" that appeared to be sourced from Magpie files. I didn't have one to test and I couldn't make one so I gave up on it. It was the only column type I couldn't check/test. I had hoped the layout was going to be ok as is. Apparently, it isn't. After loading your sample file, the column header in both vertical and horizontal layouts need a lot of work. It seems the layout is still from Toonz Harmony? I'm guessing the SoundText layout was never updated to be in line with the other columns in OpenToonz. I also have to fix how it loads into the cell area in horizontal mode. Now that I have an example of one, I will work on fixing it to match the rest of OpenToonz. :) |
Doh! I'm sorry for the extra work. I had just seen a bunch of requests related to text columns and thought I would look into it. |
@turtletooh No problem. Felt rather incomplete no being able to test it all. Now I can. :) Shouldn't take me very long. |
@2dvision i don't think adding timeline exclusive functionality makes alot of sense, these features probably need their own issue. |
@tGuMedia Ok, I thought these could be a few optimizations for the timeline, not feature requests. |
@2dvision while you are waiting for additional camera/timeline functionality, the camera can also be animated directly in the viewer using the edit tool. Select the camera, choose the mode (position, scale or etc.), make adjustments/edits as desired |
@artisteacher Thank you. I found a trick for animate camera in Xsheet too. |
This feature is now included into our builds ^__^ - https://morevnaproject.org/2017/07/17/horizontal-timeline-now-available-opentoonz/ |
@morevnaproject I just submitted a commit to this PR. If you can, you might want to pull the latest as it includes some Timeline SoundText columns and tool tips fixes that needed to be made. I've also added a preference setting to show/hide Column number in Timeline mode as well as Ctrl-Click of buttons in Xsheet mode will do a Toggle All of that button. @shun-iwasawa I've decided to freeze the code for this PR pending any major bugs found or additional changes you might require of it. I do not plan on modifying this PR any more beyond that. The latest commit does not include the UI changes we've been discussing. I will do that as a separate PR since I don't know when that will ever be finalized. Having said that, please review when you have time. Hopefully it can be merged sometime soon. Once this is merged my plans are as follows:
|
Jenkins |
Dots |
@manongjohn Thank you! We will include it into the next build. ^__^ |
I confirmed that it works great for now. I found a tiny problem that the xsheet and the function editor do not scroll synchronously. I'll post the separate PR for it. LGTM |
Yes, of course! Thank you @Agnyy for your help! |
Thank you all. @manongjohn Thank you for picking this up and running with it. You have done a great job! |
Overview
This feature adds a "toggle orientation" button to the Xsheet, letting you switch between default Xsheet layout (with vertical timeline) and compact horizontal timeline:
I've tested as many features as I could, though I'm no veteran in OpenToonz. I've got the basics of selecting, resizing, moving of columns and cells covered. I could not reproduce several more obscure column types; these will behave correctly in old layout and will need tweaks for the new orientation.
Implementation
OpenToonz code is strongly tied to vertical timeline; it maps X to column number and Y to row number. The link is pervasive in the code. In order to untie them, I introduced several concepts:
Orientation operates on slightly higher level abstractions than the old code. Wherever possible, I used QRects to mark rectangular areas with meaningful role.
Old code
New code
I keep
x
andy
for compatibility; however, whenever possible, I prefer higher level abstraction ofQPoint xy
.QRect
arithmetics rewards this approach. Sometimes QLine is more appropriate; and sometimes I fall back to X and Y calculations, termed as Layer Axis and Frame Axis. Orientation helps me translate them to screen XY in the end.Orientation provides quite a few enumerated QRects, QLines, ints and QPainterPaths to satisfy any needs in marking up the screen. These can be retrieved via methods similar to Orientation::rect ():
These are almost always relative to the top left corner of corresponding cell. These primitives are used for both displaying the items and responding to mouse events:
Old code:
New code:
which, among other things, reduces chances for inconsistencies.