Skip to content

Handling animations#104

Open
MrRedbloX wants to merge 1 commit intogiandifra:masterfrom
MrRedbloX:master
Open

Handling animations#104
MrRedbloX wants to merge 1 commit intogiandifra:masterfrom
MrRedbloX:master

Conversation

@MrRedbloX
Copy link

No description provided.

@kashyappiyush1998
Copy link

can we get an example that utilizes this commit for animation?

@MrRedbloX
Copy link
Author

@kashyappiyush1998, yes sure.

The following code will play the first animation in sfbFile and will repeat it infinitely.

ArCoreReferenceNode(
        name: "MyModel",
        object3DFileName: "sfbFile",
        position: Vector3(0, 0, 0),
        scale: Vector3(1, 1, 1),
        animationIndex: 0,
      );

The following code will play the animation called MyAnimation in sfbFile and will repeat it 5 times.

ArCoreReferenceNode(
        name: "MyModel",
        object3DFileName: "sfbFile",
        position: Vector3(0, 0, 0),
        scale: Vector3(1, 1, 1),
        animationName: "MyAnimation",
        animationRepeatNb: 5,
      );

The following code will play the second animation in sfbFile infinitely. Note that it will discard the animationName because the animationIndex is filled.

ArCoreReferenceNode(
        name: "MyModel",
        object3DFileName: "sfbFile",
        position: Vector3(0, 0, 0),
        scale: Vector3(1, 1, 1),
        animationIndex: 1,
        animationName: "MyAnimation",
      );

@MrRedbloX
Copy link
Author

Hi @eduardoGo,
If you want the animation to repeat infinitely you can remove the 'animationRepeatNb'. Try it and tell me if it's working.
This might be a bug to fix.

@eduardoGo
Copy link

eduardoGo commented May 13, 2021

Hi @eduardoGo,
If you want the animation to repeat infinitely you can remove the 'animationRepeatNb'. Try it and tell me if it's working.
This might be a bug to fix.

I found the bug. The animations don't work with NodeWithAncor. When I used controller.addNode(node), the animation work fine.

@KyleKun
Copy link

KyleKun commented May 25, 2021

Hey @eduardoGo / @MrRedbloX, could you share your files or complete repository please? I'm trying to use sceneform sample andy_dance.sfb and the application is crashing without giving any useful logs... Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants