def xmlParseState(node): """ parses a state node and return an GLState instance. """ stateType = node.get('type') return GLState( name = node.get('name'), value = _typeMapping[stateType](node.get('val')), dynamic = xmlBool(node.get('dynamic', False)) )
def xmlParseStateGroup(node): params = {} name = node.get('name') dynamic = xmlBool(node.get('dynamic'), False) for child in list(node): if child.tag!="state": continue xmlParseStateParam(child, params) return GLStateGroup(params, name, dynamic)
def xmlParseVertexParam( node, segmentParams ): name = node.get('name') param = GLVertexParam(name=name, dynamic=xmlBool(node.get('dynamic'), False)) segmentParams[name] = param