Comments (7)
Hi !
I'm interested in this work ! could you explain more clear this work ?
Thanks for your answer
from etro.
Absolutely! Because properties can be keyframes, functions, or just simple values; we need a way to get the current value of a property for a frame. Right now, the util function val(property, element, time)
does this, but I think there is a way to make the syntax nicer (and more friendly to usage from the user).
The task is to write a getter and setter for each public property (that's intended to be used externally). I'm thinking something like:
// for layers
set propName(value) {
this._propName = value;
}
get propName() {
return val(this._propName, this, this._movie.currentTime - this.startTime);
}
Doing this will solve another problem: There are some properties that require custom logic when accessing their values, like layer dimensions default to the movie's dimensions when they are undefined. Right now, this is handled by resizing the canvas to the current frame's values each frame. Then, the canvas's dimensions are read for the rest of the frame. It would be a lot better to put this logic in a getter, like:
// in layer.Base
get width() {
return val(this._width, this, this._movie.currentTime - this.startTime);
}
I just created #20 which ideally should be done first, so you can use this.currentTime
for movies and layers and this._target.currentTime
for effects when you pass the time to val
.
from etro.
I updated the OP with a checklist. Just pick one and push it to a new feature branch for this issue, unless you're feeling ambitious. Or, you can start with one of the smaller good first issues, if you'd like.
from etro.
Any progress on this? I can help with this.
from etro.
@alejolale Are you currently working on this issue?
from etro.
@rc41186 I forget about this, yes you can work on it if you're still interested
from etro.
I decided not to do this, because it would be very error-prone to have to implement setters and getters (that call val
) for every public property in every class. Instead, I implemented property filters (0fca188) that process the results of val
. You only need to implement property filters when custom logic needs to be applied to the instant value.
from etro.
Related Issues (20)
- Add `onDraw` option to `Movie.record()`
- Seeking during playback doesn't seek the movie's current time HOT 2
- Can't add an outline to a text layer HOT 2
- Mute karma browser output
- `test:*` scripts in `package.json` cannot be run on Windows because of syntax error
- Can't resolve 'etro' on Next 13. HOT 13
- Quality loss when resizing picture
- `Shader` effect always rendering as solid black in firefox on macos
- Deprecate `mediaRecorderOptions`
- Non-numeric keyframe values throwing compile-time type error
- `this.data is undefined` when calling `Transform.apply()` with dynamic matrix
- Deprecate and rename `Layer.render`
- Replace `unknown` in `KeyFrame.value`'s type HOT 1
- Deprecate function properties
- Deprecate `time` parameter for `val()`
- Release commit log link broken
- Type `KeyFrame` constructor to accept custom interpolation functions
- Can't read an image layer while rendering the movie. The image is from remote, like (https://image/) HOT 2
- timeline editor component for end users ? HOT 1
- Unmount using react
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from etro.