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