Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


AssimpNet + BinaryWriter - Writing Nodes + Name Problem


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 KoldGames   Members   -  Reputation: 222

Like
0Likes
Like

Posted 11 September 2013 - 08:11 AM

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! :)


Sponsor:

#2 Starnick   Members   -  Reputation: 1255

Like
0Likes
Like

Posted 11 September 2013 - 01:19 PM

You probably have to supply some code other than just some method signatures. Although this WriteTo, why are you writing the parent, usually a parent would be calling WriteTo - parents write children, children write their children and so on. And by writing the parent, the parent is writing other information out? If so, parent writing its children, its children writing its parent, ping pong and so on.

 

For the case of not getting mesh names that you may be expecting, this may be dependent on the importer. If there's a mesh name, the AssimpNet marshaling process will grab it. If its there or not is dependent on what the native library is doing.



#3 KoldGames   Members   -  Reputation: 222

Like
0Likes
Like

Posted 11 September 2013 - 01:41 PM

Hey Starnick! Thanks! It worked. I don't even know why I did that. lol No more staying up until 4AM coding anymore! Haha, thanks again! :)






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS