-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
Discussion: Syntax for SubAction #179
Comments
Thanks for trying out Javis! I'm quite confused to be honest 😄 The Action syntax doesn't allow to let an object appear it change color as an example. This can be only done using a SubAction. Examples can be found in tutorial no. 4 That being said I kind of like your idea of applying the same SubAction to two actions. It might be possible to have this in the syntax described in #100 I would additionally like to have a way to change the frame range then I think. If you don't mind: can you send me some of your Javis code that you tried such that I can see the problem more clearly and might offer a way how I would express this in Javis? |
That's something I don't understand. Why is there such a distinction between the two? To me they are both just actions that can be applied to an object. |
An |
That would make much more sense! And that is my mental model anyway. Strip away any "action" from |
I'll leave this open such we don't loose track of it. I don't think we can do this in the next release. Unfortunately it's quite a breaking change. We should implement this quite soon as long as Javis is not used by many people. Another positive point is that this would make the code of Javis more readable and less complicated. |
Thanks for sharing your thoughts with us @xiaodaigh ! Appreciated as always. 😄 Yea I agree with you @Wikunia that this sort of change would certainly be breaking. Perhaps this could be in the v0.3.0 release or even in v0.4.0 as I think we already have a lot on the horizon for v0.3.0. Furthermore, I do like the suggestion of changing
Could instead be said of the new Perhaps tying this to issue #100, here are some ideas about syntax: Idea 1video = Video(600, 600)
@Background(1:60, ground)
@Object(id, func(my_args)) # If there is only one background, inherit frame range
@Object(1:10, func(id))
javis(video; pathname="test.gif") Idea 2video = Video(600, 600)
b = @Background(1:60, ground)
@Object(b.frames, id, func(my_args))
@Object(1:10, func(id))
javis(video; pathname="test.gif") Idea 3video = Video(600, 600)
@Background(1:180, ground)
a = @Object(1:180, id, draw_grid)
@Action(1:60, a, appear(:lr, :tb))
javis(video; pathname="test.gif") Idea 4video = Video(600, 600)
@Background(1:180, ground)
a = @Object(1:180, id, draw_grid)
@Action(1:60, appear(:lr, :tb)) # If an @Action follows an @Object, assume that @Action applies to the prior @Object
javis(video; pathname="test.gif") One last comment, as I was writing this example, I somewhat felt that it might be more apt to instead call Just thoughts! Hope it helps! |
Thanks for your thoughts @TheCedarPrince Let me add some comments to your ideas first and address your last point. Afterwards I bring in my own ideas. 😄 Idea 1I would agree on this one but wouldn't change the definition of default frames. It's currently the frame of the action above and I think that's okay. We can add more symbols on that like Idea 2Yes Idea 3I think this is adding the Object at a weird point. It should in my opinion be in front of the frames Idea 4Yes I agree with the default About your last comment: I do think that My ideas on including a whole concept with layers as discussed in #75: appear_action = @Action(appear(:fade))
translate_action = @Action(translate_anim, translate())
translate_layer = @Action(translate_layer_anim, translate())
video = Video(600, 600)
@Background(1:250, ground)
acircle = @Object(1:180, id, circle(O, 50,:fill))
acircle += appear_action(1:60) # or if you only need it once `@Action(1:60, appear(:fade))` or `acircle += @Action(1:60, appear(:fade))` see **
acircle += translate_action(61:180)
astar = @Object(1:120, id, star(Point(100, 100), 50, 5, 0.5, 0, :fill))
astar += appear_action(1:30)
astar += translate_action(31:120)
layer_1 = Layer(acircle, astar)
layer_1 += translate_layer(181:250)
javis(video; pathname="test.gif") **: @Object(1:180, id, circle(O, 50,:fill))
+ @Action(1:60, appear(:fade)) to not give it any name if one doesn't need the |
A breaking change with 50 users have less impact than one with 100. So if u decide a syntax change is in order then do it sooner rather than later would be better IMHO. |
Also |> works as well of u don't wanna overload + |
Do you mind to comment on our ideas for the syntax @xiaodaigh and potentially add your own? |
Perhaps similar to what I wrote up @xiaodaigh ? Thanks! |
About the Video syntax. Do we need it as a separate object? Cos
how does background and object here related to the video? Some sort of implicit usage? Nah.
Why does
Seems ok, but now clearly how video and background and object are linked. How about something like this
If you want to achieve
But make |
Thanks for your comments @xiaodaigh . The Video is currently used to define global definitions and the last frames such that an I think for small animations it is quite cumbersome to specify a name for every object to specify it inside an Action. Do you mind to add some comments to my idea with using BTW:
|
actually i don't understand the above now. But it's looking good! |
You don't understand what and what is looking good even though you don't understand it? |
i trust u guys to make it awesome. I just make noise. |
Can you please explain yourself! 😛 |
I don't understand this.
What does this mean?
So why not just not make the user create a video using
Agree, so some kind of easy syntax.
Ok. Again. not sure what that means. |
The |
Why can't
I generally disagree with this design unless everything is inside a
In open code, it's generally a turn off for me.
Maybe. Not sure I 100% follow. |
This is an example in Luxor: using Luxor
Drawing(1000, 1000, "hello-world.png")
origin()
background("black")
sethue("red")
fontsize(50)
text("hello world")
finish()
preview() One needs to define a Drawing where everything is drawn into. I find it quite ugly to make it between a begin and end block as you don't gain clarity in my opinion. I think users will have an animation file and then everything in this file will be between a begin and end so I just remove that block. There is always a way to define the Video afterwards inside the javis funcrion, so after defining the action but it's one line of code for the user and it gives quite some clarity. Imagine you have two animations in one file so call In the current version you could either define a new Video object or not. Clearer would be to define an action with |
maybe u r right. For luxor and javis still project it's fine. |
I find the current syntax for subaction non-composable. I think of subactions as just actions on an object.
Describe the solution you'd like
So, we can we define subaction using the
+
e.g.Action(....) + Action(....)
so I am constantly doing more things to the object but I am just adding actions. Also, now actions are more composable, say if I wanna do the same subaction to two different objects I can just do[Action(...), Action(...)] .+ Action(....)
Describe alternatives you've considered*
Hmm. None.
Additional context
Libraries in R like ggplot2 adopts this addition syntax to modify a plot. So I think it makes for Javis.jl too.
The text was updated successfully, but these errors were encountered: