How to get animation names in a glb file in flutter

231 Views Asked by At

I am using glb files in my flutter application I use the model_viewer_plus package for rendering glb files, now i can play a particular animation in a glb file by calling the method with that animation name, now i need to get all the animation names present in the glb file, I dont find any methods in the model_viewer documentation to get all the animation names, can someone help me in this issue. present code where I use a particular animation name to play an animation in a glb file.

 ModelViewer(
              id: "modelID",
              onWebViewCreated: (controller) => {
                _controller = controller,
              },
              key: const ValueKey('Capoiera'),
              relatedJs: """
                    function setAnimationName(animation) {
                      const modelViewer = document.querySelector('#modelID');
                      modelViewer.animationName = animation;
                    }""",
              //  animationName: 'Taunt',
              //'_bee_hover'Capoiera'
              backgroundColor: Colors.transparent,
              src: 'assets/DamagedHelmet.glb', // a bundled asset file
              alt: "A 3D model of an astronaut",
              ar: true,
              autoPlay: true,
              animationCrossfadeDuration: 400,
              arModes: const ["webxr", "scene-viewer"],
              autoRotate: false,
              cameraControls: true,
              disableZoom: false,
            ),
0

There are 0 best solutions below