Help with animated models
#1
Hi,
i have converted quite a lot of code to vb.net, all seems to work fine, but i am having an issue with one function, been scratching my head for a while i am sure it is a simple thing but i dont know what here is the function:

Code:
Private Function GenerateSkeleton(ByVal node As Node, ByVal parentSkeletonNode As SkeletonNode, ByRef boneNodesLeftToGenerate As Integer) As SkeletonNode
            If node Is Nothing Then Return Nothing
            Dim newlyCreatedSkeletonNode As SkeletonNode
            Dim boneIndex = Array.IndexOf(_allBoneNames, node.Name)

            If boneIndex >= 0 Then
                Dim assimpBone = AssimpMesh.Bones(boneIndex)
                boneNodesLeftToGenerate -= 1
                newlyCreatedSkeletonNode = New SkeletonNode(node, assimpBone, parentSkeletonNode, boneIndex:=SkeletonNodes.Count)
            Else
                newlyCreatedSkeletonNode = New SkeletonNode(node, Nothing, parentSkeletonNode, -1)
            End If

            SkeletonNodes.Add(newlyCreatedSkeletonNode)

            If node.HasChildren AndAlso boneNodesLeftToGenerate > 0 Then

                For i = 0 To node.ChildCount - 1
                    Dim childBone = GenerateSkeleton(node.Children(i), newlyCreatedSkeletonNode, boneNodesLeftToGenerate)
                    If childBone IsNot Nothing Then newlyCreatedSkeletonNode.Children.Add(childBone)
                Next
            End If

            Return newlyCreatedSkeletonNode
        End Function
the error i get no matter which file i try is:

line that errors: Dim assimpBone = AssimpMesh.Bones(boneIndex)

Exception Thrown

system.NullReferenceException: 'Object reference not set to an instance of object

Ab3d.Assimp.Skeleton.AssimpMesh.get returned Nothing.

can anyone help please
Kevan Hampson
  


Messages In This Thread
Help with animated models - by GraPhiX - 01-20-2022, 07:23 PM
RE: Help with animated models - by GraPhiX - 01-21-2022, 07:08 PM
RE: Help with animated models - by GraPhiX - 01-21-2022, 07:40 PM
RE: Help with animated models - by abenedik - 01-23-2022, 10:28 PM
RE: Help with animated models - by GraPhiX - 01-24-2022, 02:53 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)