-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
start of the @Frames macro #338
Conversation
@codejaeger you might want to check whether this is enough for your work or whether I missed something. |
Codecov Report
@@ Coverage Diff @@
## master #338 +/- ##
==========================================
+ Coverage 96.21% 96.24% +0.03%
==========================================
Files 35 35
Lines 1452 1519 +67
==========================================
+ Hits 1397 1462 +65
- Misses 55 57 +2
Continue to review full report at Codecov.
|
Hey @Wikunia , thanks for providing help on this issue! The requirements I was having for specifying actions on the node objects will be met by what you have provided in the PR. I will take a closer look into the code shortly and using the tests that I had prepared in the PR #334 I will be able to point out if anything might seem missing. Those tests might be a bit unreadable so I will mention the cases in verbose that I think should also be fulfilled with this PR. |
I think we might want to add something like |
Did you do some more tests with this @codejaeger ? |
Hey @Wikunia , yes I tried this PR for my purposes in graph animations. I was primarily looking for a way to provide a default case where the frame range for the next object can be calculated with respect to the starting frame of the previous object/action & an absolute finish frame. This PR achieves that. There were a few more utilities that I think will be useful. For example These are probably the only use cases I can think of right now. I had written a bunch of tests to test the logical correctness of the relative frame computations in #334 . If you would like, I could rewrite them with this interface and update in this comment. |
I think |
Yes agreed, for backgrounds |
@Wikunia , would it be possible to add just one other frame utility function This requires the knowledge of the action frames across different objects. I think it would not be possible unless a reference to that action was available. This would be a problem in the implementation since the a = Action(RFrames(1:5), appear(:fade))
act!(obj1, a)
act!(obj2, Action(@Frames(prev_action_end(a)+12), appear(:fade))) with a possible implementation for function prev_action_end(a)
return a.frames.frames[end] + PREVIOUS_OBJECT[1].frames.frames[1] - 1
end Do you have an alternative around this? |
Oh you're talking about applying it to different objects. So bascially
Should that be the same as
so
? That should work as we compute the objects first as long as |
Yes something like that but a little bit more flexible such that even if more actions were added to I could formulate this as a different problem of being able to give the animator a handle to the current active frame in the video i.e. the frame last used. This helps provide a sequential style for creating the video without worrying about global frames but the previous specification of the problem makes it more exact to what I need. |
Oh based on when you call the code I missed that point. That will be quite hard to make at this stage. Maybe you can create a new issue for that and at least get this one going into Javis earlier then? |
Yes, I am already working on an alternative but based on the use case below I think it might be useful. for i in 1:8
highlightNode(@Frames(prev_action_end()+5), graph, i)
end I will open an issue for it. |
And please give more information for the new issue without knowledge of your graph project 😉 |
@Wikunia can this PR be merged? I wanted to extend the |
Feel free to merge this into your fork for now but yeah want to merge this soon to Javis. Any objections @TheCedarPrince ? |
@Sov-trotter do you mind having a look at the error message here? I'm unsure how this happens and I can't reproduce it locally. |
This seems weird. Could you try running the CI again? |
Thanks for having a look. Unfortunately it has the same error as before. |
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.
Hey Ole, I am rather confused by the exact functionality of this PR. In some of my testing, I was trying to reason about where @Frames
created objects were beginning and ending, and discovered that the following snippet produces different results:
using Javis
video = Video(600, 400)
Background(1:200, ground)
red_circ = Object(1:90, (args...)->circ("red"))
blue_circ = Object(@Frames(prev_start()+20, 70), (args...)->circ("blue"))
blue_circ = Object(@Frames(prev_start()+20, stop=90), (args...)->circ("blue"))
println(Javis.get_frames(blue_circ))
red_circ = Object(1:90, (args...)->circ("red"))
blue_circ = Object(21:90, (args...)->circ("blue"))
blue_circ = Object(41:90, (args...)->circ("blue"))
println(Javis.get_frames(blue_circ))
which gives:
include("tmp/tmp.jl")
nothing
41:90
So somehow, it seems like @Frames
created objects are not the same as "normally" created objects. Could you explain to me what is happening here? I looked in the macro definition and it seems that you are setting the frame ranges to nothing
. Why is that? Thanks!
Thanks for the review @TheCedarPrince |
@Sov-trotter any idea why this might happen? https://github.com/Wikunia/Javis.jl/pull/338/checks?check_run_id=3142096015#step:7:422 |
MIght be realted to https://trac.ffmpeg.org/ticket/6463#comment:16 ?? |
What this PR does which should probably be in a different one is:
|
@TheCedarPrince do you mind having another look at this i.e resolving conversations and let me know if there is anything I should change. |
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.
LGTM!
PR Checklist
If you are contributing to
Javis.jl
, please make sure you are able to check off each item on this list:CHANGELOG.md
with whatever changes/features I added with this PR?Project.toml
+ set an upper bound of the dependency (if applicable)?test
directory (if applicable)?Link to relevant issue(s)
Closes #331
How did you address these issues with this PR? What methods did you use?
Based on our discussion in #334 I've created a
@Frames
macro.One can now write
prev_start()
to refer to the previous starting frame of the last object or action. Similarly withprev_end
.These can be used like this in the
@Frames
macro.The first parameter of
@Frames
is the start of the frame (same as when just writing a unit range but can be a function likeprev_start()
or something likeprev_start()+10
or whatever)The second parameter is the length of the object/action.
In the above example it's quite simple such that it can be easily achieved with unit ranges but one might want to do more complicated stuff like
which is now easier to write than previously:
Additionally it supports
which are similar to
prev_start
andprev_end
but one can specify the object or action.