Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from custom_types import utils
- def dump_datamap(datamap):
- def dump_dmap(proppath, dmap, offset=0):
- # Loop through all properties in this data map
- for x in xrange(dmap.dataNumFields):
- # Get the current description
- desc = dmap.dataDesc[x]
- # Does the property have no name or is it a function?
- if not desc.fieldName or desc.inputFunc:
- continue
- temppath = proppath + '.' + desc.fieldName
- # Calculate the current offset
- tempoffset = offset + desc.fieldOffset[0]
- # Is there no embedded datamap?
- if not desc.td:
- print temppath, tempoffset
- else:
- # Dump the embedded data map, too!
- dump_dmap(temppath, desc.td, tempoffset)
- # Dump the data map and its subclasses
- while datamap:
- dump_dmap(datamap.dataClassName, datamap)
- datamap = datamap.baseMap
- entity = utils.EntityByIndex(1)
- if not entity:
- raise ValueError('Could not find an entity with index 1.')
- dump_datamap(entity.GetDataDescMap())
Advertisement
Add Comment
Please, Sign In to add comment