Hello! I have created my own custom binary model format. To create a file of this format, I have created a converter that uses AssimpNet to load and write the model data the data to a new file. I currently have meshes & materials done and working. But for me to get animation working, I need the RootNode and all of its children. My game engine contains a class called NXNode, which I will be loading each node's data into. It has two constructors:
public NXNode(BinaryReader reader) - Reads the node from the binary file.
public NXNode(string name, short meshCount, short childCount, NXNode parent, NXNode children, Matrix4 transform, bool hasChlidren, bool hasParent) - Used in my converter project to write the node to the binary. Basically, just sets all members.
I also have a method (which is in all my structs or classes that have to do with data loading):
public void WriteTo(BinaryWriter writer) - Writes the node's name, mesh count, child count, parent (if not null), children, and transform.
The problem is that I cannot get it to write the nodes without getting a StackOverflow exception. I tried everything that I could think of. It works without writing nodes, but I need the nodes for animation so leaving them out is not an option unless there is another way to do this. Also, Assimp seems to not be loading mesh names. Any help? Thanks!