Start a new topic

MgGetCode = 4097

Original Post by: jrhea Thu Feb 2 20:56:20 2012

Can you tell me what a code 4097 is for? It looks like some sort of reference node. The problem is I can't call mgGetName on a node that is of type 4097. How would I change the name of that node? Or how would I change to what the node refers to? Thanks!

Original Post by: SteveThompson Fri Feb 3 00:00:05 2012

I am afraid the answer is not so easy... The OpenFlight Data Dictionary only uses codes 0..4095. Numbers beyond 4095 are "user extension codes". So all you know about 4097 is that it is the second extension node type of the first extension that was loaded when the database was created.

In what context are you seeing this node?

Original Post by: jrhea Fri Feb 3 00:39:34 2012

Ahh i see....

I have this hierarchy (simplified):


-x1 (external ref to file: foo.flt)

-x2 (code 4097 - looks like a ref to file foo.flt)

-x3(code 4097- looks like a ref to file foo.flt)


I am altering this scene graph so maybe I should just remove the 4097 nodes and add external references in its place.

Thanks again

Original Post by: SteveThompson Fri Feb 3 00:48:44 2012

This is odd...

Can you share some of the code here? In your diagram what function are you using to get from x1 to x2? Since x1 is an xref, I presume you are using something like:

x2 = mgGetReference (x1);

// then

code = mgGetCode (x2);

// code is 4097??

If this is the case, then something is very odd, the reference of an x-ref node should be code 310 (fltHeader - the root of the x-ref).

Original Post by: jrhea Fri Feb 3 15:08:50 2012

I have probably done a poor job of explaining what I am seeing. I think I worded it wrong. I will give you a brief synopsis of what I am doing. I am taking a scene and splitting it into high resolution files and low resolution files. So basically, I am manually traversing the scene graph and looking at LODs to determine what parts of the scene graph belongs in what file. I got to this odd 4097 code and it threw me for a loop. To get from x1 to x2 I am doing this:

mgrec * x2 = mgGetNext(x1);



Line 2 prints:


Line 3 causes the program to crash.

If you look at the attached image you will see the node I refered to as "x1" highlighted in red. Bc it is a regular xref I was able to change the name of the file it refers to from:




The problem is that the sibling nodes are all code 4097.

Original Post by: SteveThompson Fri Feb 3 15:46:39 2012

Thanks for the extra info. If your hierarchy is as you show it (and the x-ref road_light1.flt is really the next sibling of the x-ref high_road_light1.flt) then your line 2 should print 397 and line 3 should print <path>/road_light1.flt.

After digging around the extension node code, I see that the first 256 codes used by an extension are reserved so it is very unlikely that 4097 is really an extension node. The first code used by an extension would really be 4351. I suspect something more nefarious is going on here.

I assume you have verified that x2 is not NULL (although mgGetCode and mgGetName won't be bothered if it is). More likely the scene graph may be in a strange state and that mgGetNext may be giving you bad info.

Other than that I can't offer an explanation of what you are seeing.

Login to post a comment