pythreejs icon indicating copy to clipboard operation
pythreejs copied to clipboard

Updates to KeyframeTrack do not effect the AnimationAction

Open maartenbreddels opened this issue 6 years ago • 8 comments

Starting from this example and afterwards executing this:

positon_track.values = [100, 6, 100,
            6.3, 3.78, 6.3,
            -2.98, 0.84, 9.2,
           ]

will not lead to different positions in the animation, it keeps the old ones. Any idea?

maartenbreddels avatar Apr 05 '18 13:04 maartenbreddels

Thanks for this. It seems the values array cannot be reassigned on the JS side; it needs to be written to in-place (i.e. same array, new content).

vidartf avatar Apr 05 '18 14:04 vidartf

Note, this might mean that you cannot change the length of times/values during the run-time. I'll look further into it. What is the usage pattern for what you are doing?

vidartf avatar Apr 05 '18 14:04 vidartf

Ok, i worked around it by creating the whole widgets-chain again. Also, it would be nice if the AnimationAction can reuse the Play view, and be controlled programatically.

maartenbreddels avatar Apr 05 '18 14:04 maartenbreddels

I'm making a movie creator, so you click a button, and it should add the position and camera quaternion to a list to edit the camera keyframe positions and angles.

maartenbreddels avatar Apr 05 '18 14:04 maartenbreddels

Neat. Is the logic kernel side or front-end side (just curious)? Can you say a little more what what you mean about the AnimationAction thing?

I'm considering marking the times/values as read only on the kernel side (i.e. can only be passed in constructor). What do you think?

vidartf avatar Apr 05 '18 15:04 vidartf

http://pythreejs.readthedocs.io/en/latest/api/animation/AnimationAction_autogen.html There is some bookkeeping doing on at the server side, but if we would have a widget + jslink that could add/remove/set values of a list, I think it could go all server side. However, the threejs animation framework doesn't play nice with the rest of ipywidgets, I wonder if ipytween should be started... :) On that last item, that would prevent doing it all front-end, but if it's not possible.. so be it.

maartenbreddels avatar Apr 06 '18 10:04 maartenbreddels

Would you mind specifying the use cases you encounter where using the animation system is difficult? It would be nice to have a list of cases, so that we can either develop solutions for it, or list workarounds.

vidartf avatar Apr 06 '18 10:04 vidartf

Issues I remember now:

  • I cannot control a widget trait on the js side using the animation system, only threejs widgets/objects can be modified.
  • Cannot start a widget programatically (although that should not be so difficult to add)
  • It seems the tracks cannot be modified.

maartenbreddels avatar Apr 06 '18 14:04 maartenbreddels