Start a new topic

mgWalkGetMatrix is returning MG_FALSE

Original Post by: Thu Dec 10 20:16:32 2015


Hi

I'm doing a mgWalk( db, PreWalkFunc, None, None, MWALK_MATRIXSTACK|MWALK_MASTERALL)

in PreWalkFunc i call mgWalkGetMatrix( data ) and it's returning MG_FALSE. I have some nodes under a MatrixTransform node am i getting false from mgWalkGetMatrix?

Thanks


Original Post by: Mon Dec 14 17:32:23 2015


I couldn't atttach the file to this post because the forum don't let me to. mgWalkGetMatrix is returning false even though I have an xForm above each group containing the polygons.

This is a part of the script I'm using

#begining of the script

def PreWalkFunc(db, parent, record, data):


try:

if mgGetCode (record) == fltPolygon:

ok, mat = mgWalkGetMatrix( data )

if ok == MG_FALSE:

print "NULLLLL"

else:

print "Good"


except:

# Due to issues in the OpenFlight API, the exceptions are not transmitted outside of the 'walk' functions

print traceback.format_exc()


return MG_FALSE


return MG_TRUE


#in the main func


mgWalk( db, PreWalkFunc, None, None, MWALK_MATRIXSTACK|MWALK_MASTERALL)



#endscript

Original Post by: SteveThompson Thu Jan 14 19:18:56 2016


Hmmm... can you tell me more about your environment? I tried this in OpenFlight API 14 and the soon to be released version 15 and don't see the problem.


I'll go back and try version 13 but can you tell us which version of OpenFlight API you are using?


And btw, mgWalkGetMatrix should work whether or not there are transforms present. In that case (and if called properly) the matrix returned would simply be identity.

Original Post by: Thu Jan 14 19:52:33 2016


Thank you for your response. I've ended up adding the mgWalkGetMatrix at the beginning of the preWalk function and somehow it worked. Thank you for the help

Original Post by: SteveThompson Thu Jan 14 20:57:39 2016


I’ve ended up adding the mgWalkGetMatrix at the beginning of the preWalk function and somehow it worked

Hmmm... that scares me more than your original problem ;-)

Login to post a comment