We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Accessing exported from Blender animations in Verge3D

Home Forums Graphics / Blender Accessing exported from Blender animations in Verge3D

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #82331
    devjan
    Participant

    Good day!

    I have exported a scene to Verge3d project. The scene has animated objects (one animation per object), and when played in “Run App” or Sneak Peak – animations are there. However, I want to access animations and create a few custom animations from code. How do I access exported animations and control them (like move to a specific frame or pause)? Looking at examples in documentation suggested,

    https://www.soft8soft.com/docs/manual/en/programmers_guide/Animation-system.html

    but I get an empty array in clips. Same goes for objects.animations in scene, app.animations or app.scene.animations – all empty arrays (animation is working in preview though). I also checked all boxes in Blender: Render panel in Verge3D tab (Animations, Export Playback Range, Keyframe starts with 0, Bake Armature Actions).

    Question: how do I access animations via code and control them? Are there any working examples or videos?

    #82334

    Hi,

    Unfortunately, the code snippet in the “Animation System” guide is a bit misleading (we will fix it!). The actual code is way easier, since in Verge3D we already prepare animation actions for the loaded application. These can be accessible via app.actions, and usually found by a clip name via v3d.SceneUtils.getAnimationActionByName().

    Check out this snippet:

    const action = v3d.SceneUtils.getAnimationActionByName(app, "AnimatedObjectName");
    if (action) {
        action.reset();
        action.play();
    }

    Soft8Soft Tech Chief
    X | FB | LinkedIn

    #82336
    devjan
    Participant

    Thanks. Hope that works. I will give it a try.

    #82338
    kdv
    Participant

    but I get an empty array in clips. Same goes for objects.animations in scene, app.animations or app.scene.animations – all empty arrays

    all animations are here app.actions :unsure:

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.