Open Omega1975 opened 1 year ago
Without having a reproducible example, my guess is you're not using the right object for that property.
I suspect you need to use CurveBuilder
Generally speaking, ICurverSampler is an interface used to "sample values along the curve" but does not state how the curve was built in the first place.
So you need to use an object that implements both ICurveSampler
Also, there's a number of incompatible curves: you cannot mix STEP, LINEAR, or SPLINE curves,
The program I'm writing merges several glb files, now I would like to be able to read the animation data from the original files and write them into the new file. Below the simplified code
ModelRoot model = SharpGLTF.Schema2.ModelRoot.Load(glb.FileName);
foreach (Node nd in model.LogicalNodes){ if (nd.Mesh != null){
}
the line rootNode.WithTranslationAnimation(name, CS); returns an error at runtime: Message: "Must implement IConvertibleCurve\r\nNome parametro: sampler"
ParamName: "sampler"
Source: "SharpGLTF.Toolkit"
StackTrace: " in SharpGLTF.Schema2.Toolkit.WithTranslationAnimation(Node node, String animationName, ICurveSampler
1 sampler) in D:\\Sorgenti\\SharpGLTF\\src\\SharpGLTF.Toolkit\\Schema2\\AnimationExtensions.cs:riga 56" TargetSite: {SharpGLTF.Schema2.Node WithTranslationAnimation(SharpGLTF.Schema2.Node, System.String, SharpGLTF.Animations.ICurveSampler
1[System.Numerics.Vector3])}Where am i going wrong? Which instructions should I use?
Thanks in advance for the time you will dedicate to me