Can Copy Animation from SceneA to SceneB

Copying the animations using CGE API → means you need to copy many more nodes. Not only TTimeSensorNode nodes, also all the interpolators and then setup “routes” connecting them. You can read Interpolation component | Castle Game Engine to understand how animations are described using X3D nodes in our engine. You need to copy/setup all things in that section to transfer a working animation from one model to another.

So, it is possible to copy the animations using the above approach (copying time sensor, interpolators, setting up routes), but:

  1. Admittedly it’s a bit difficult. You will need to understand many details about how X3D nodes are being used to animate. It’s not really something I recommend regular engine users to do :slight_smile:

    Practically speaking, it is easier to just copy animations at your model creation (e.g. in Blender) and have the same animation just exported to every 3D model.

  2. It doesn’t really give you an advantage in terms of memory consumption. The copies of animations are copies, then consume memory. For now, we have to work like this, as each scene must have separate nodes. In the future, maybe it will be possible to reuse nodes more (see roadmap: Allow animating selected node graph properties, without changing the graph, to be able to reuse graphs) and the skinned animation should definitely consume less memory in general (see roadmap: Efficient skinned animation on GPU (from glTF and more) using new SkinnedAnimation node).

  3. Also, it should not change if/how you can use animation transitions. If you can submit a testcase to illustrate the issue when you can / cannot use animation transitions, it would be helpful.

All in all, what you ask for is possible, but difficult and doesn’t address some problems you mention, at least as far as I understand it. Sorry for that, but it’s the honest answer, for now. There are a few things in the engine we could do better in this regard, including giving you easy API to transfer animations, but it’s not ready yet.

1 Like