Comments (4)
I save animation data using studio.createContentOfSaveFile("myproject") to variabel animationData ans save it to file. And after load animationData from file, I want to rebuild sequence animation. But I got nothing. What's wrong in my code?
studio.setSelection([ObjStudio]);
const objProp =
_this.animationData.sheetsById.Objects.sequence.tracksByObject[
objName
];
if (objProp) {
const propKeys = Object.keys(objProp.trackIdByPropPath);
for (var i = 0; i < propKeys.length; i++) {
let propValue =
objProp.trackData[objProp.trackIdByPropPath[propKeys[i]]];
if (propValue.keyframes.length > 0) {
let propname = JSON.parse(propKeys[i]);
for (var j = 0; j < propValue.keyframes.length; j++) {
sheet.sequence.position = propValue.keyframes[j].position;
studio.transaction(({ set, unset }) => {
if (propname.length == 1) {
set(
ObjStudio.props[propname[0]],
propValue.keyframes[j].value
);
} else {
set(
ObjStudio.props[propname[0]][propname[1]],
propValue.keyframes[j].value
);
}
});
}
}
}
}
from theatre.
The code may work but before using set function, prop must have been manually right click and choose sequence.
I normally save content and animationContent both in a file. When i open the file I Create a new project with saved animationContent. See a ref https://github.com/vimlesh1975/ReactCasparClient/blob/b98222f8a19eeac8cb8b09ae867d9bf1ea56dd52/client/src/theatrejs/WebAnimator.jsx#L1927
from theatre.
The code may work but before using set function, prop must have been manually right click and choose sequence. I normally save content and animationContent both in a file. When i open the file I Create a new project with saved animationContent. See a ref https://github.com/vimlesh1975/ReactCasparClient/blob/b98222f8a19eeac8cb8b09ae867d9bf1ea56dd52/client/src/theatrejs/WebAnimator.jsx#L1927
Thanks vimlesh1975, but right click and choose sequence is impossible if we have many keyframes :)
I think we need new API to create sequence from code.
from theatre.
I got the solution. After load project, sequence should be play to show sequence UI editor
I create the test project here
https://codepen.io/wahono77/pen/RwLNJXK
from theatre.
Related Issues (20)
- Support for expressions
- @theatre/r3f alone
- @theatre/r3f extension breaks with vite HOT 2
- insert sequence HOT 2
- Unhandled Runtime Error TypeError: der.onStale is not a function HOT 5
- Move a key to a new namespace HOT 3
- really good work
- Context error when using drei PositionalAudio (R3F)
- Free 3D studio built with BabylonJS and Theatre-JS HOT 1
- Mobile Friendly UI
- Feature Request: Ability to Translate Keyframes by Specifying Time Duration HOT 4
- Bug - Bezier curve drag bug HOT 1
- Initial value of boolean prop
- Animation does not work in WebXR HOT 5
- Can't run three.js basic example HOT 4
- `yarn cli build` fails HOT 1
- sequence performance optimization HOT 5
- How to programmatically modify the value of the property panel? HOT 3
- animation frozen when enter into immersive AR or VR mode on Quest browser HOT 1
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 theatre.