Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Android ARCore animation start problem #1315

@windofny1

Description

@windofny1

Hi! I faced a problem with starting animation for loaded .sdf file.

It's loaded using this peace of code:

            var builder = ModelRenderable.InvokeBuilder();
            var javaClass = Java.Lang.Class.FromType(builder.GetType());
            var methods = javaClass.GetMethods();
            var method = methods[11];
            method.Invoke(builder, Platform.CurrentActivity, Resource.Raw.CoinModel);
            builder.Build((m) =>
            { 
                if (m.AnimationDataCount > 0)
                {
                    var d = m.GetAnimationData(0);  
                    ModelAnimator ma = new ModelAnimator(d, m); 
                    ma.Start();
                    
                }
            });

SFB file contains only one animation - and it's exist - m.AnimationDataCount==1, but when Start method called - there is exception rised:
Java.Lang.IllegalStateException: 'Cannot cast 'com.google.ar.sceneform.rendering.AnimationData$1$1' to
'com.google.ar.sceneform.animation.ModelAnimationData'

Why 'com.google.ar.sceneform.animation.ModelAnimationData' ? In Java ModelAnimationData is inside 'com.google.ar.sceneform.rendering', in .NET also right:
[Register("getAnimationData", "(I)Lcom/google/ar/sceneform/rendering/AnimationData;", "GetGetAnimationData_IHandler")]
public virtual AnimationData GetAnimationData(int index);

Maybe anybody faced this problem too ?

Xamarin.Android.SceneForm.Animation 1.17.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions