Jump to content
  • Advertisement
Sign in to follow this  
VanillaSnake21

How to compare two GUIDS

This topic is 4393 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, im trying to check whether an object is of type mesh, i use the GetType() method of the filedata interface, and get the GUID, but what do i compare that guid to?

Share this post


Link to post
Share on other sites
Advertisement
x.GetType() == typeof(Mesh) checks if x is an instance of the Mesh class (it cannot, however, be another class that is derived from Mesh).

Also, simpler:


Mesh mesh = x as Mesh;
if (mesh != null) {
// x can be cast to a Mesh
}
else {
// x cannot be cast to a Mesh
}

Share this post


Link to post
Share on other sites
what i meant was that i was trying to load a mesh from an XFILE, and the X File was generated with a Maya Plugin. Im trying to cycle through that X File looking for mesh objects. But when i get the guid of the object in the X File, what should i compare that guid to, to figure out if its a mesh or not.
Thanx for the answers

Share this post


Link to post
Share on other sites
I've never really messed with X files, but from what I can tell from the d3dx headers, the GUID for a mesh object is defined as TID_D3DRMMesh. I could be totally wrong, and there may be a much better way to find mesh objects in an X file.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!