-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Change arguments of an Action #216
Comments
Seems like it's not that easy to or even possible to get access to the default value. |
@Wikunia This turns out to be a bug with respect to documentation for the change function. I also tried to look for a way to extract the defaults from the keyword arguments but no success yet. Apart from that, I think the other issue this feature might help to solve is passing relevant keywords to drawing functions. Pulling in issue #313, if multiple draw functions are to be composed together to form the object drawing function then it makes sense to let the individual draw functions access keywords only specific to their purpose. |
Can you clarify what you mean? I can't see anything wrong with the docstring for the |
Sorry I termed it as a bug, it is actually more of a feature request 😄 . My assumption was that I was trying out a way around for issue 313. Consider the following function Line(p1, p2)
return (args...; line_width=12) -> custom_line(p1, p2, line_width)
end
function Circle(r)
return (args...; radius=r) -> circle(O, radius, :fill)
end
obj = Object(1:50, [Line(p1, p2), Circle(r)]) Now, animating the line using |
The reason I mentioned it in this thread is since, if there is a way to know what keywords a particular drawing function requires it will be possible to store the default from the change keywords themselves. Then probably interpolation could be done for a subset of keywords using |
One thing that would make this possible is to introduce a macro which then takes the defaults and writes them into the object metadata or similar. |
Is your feature request related to a problem? Please explain.
Currently each action has access to
video, action, frame
but maybe the user would like to change a parameter.We can use scaling for changing the radius of a circle as an example but maybe one would like to draw a line that gets longer for some frames which can currently be done hard coded with
frame
but that's not intuitive.Describe the solution you'd like
One option would be:
So one can define keyword arguments that can be changed in an animated way. The change would always be from the last value to the next. I'm not sure whether Javis has internally access to the
x=0
though 🤔I think we need
:x
asx
itself is not defined.Describe alternatives you've considered
If we don't have access to the default value we can maybe use:
or
Additional context
In general this should of course also work with Animations.jl such that one can write an
Animation
and just callchange(:x)
to apply that change to the variable x.The text was updated successfully, but these errors were encountered: