def METHOD_NAME( obj ):
    has_primitives = False
    for c in obj.children:
        if c.type == 'MESH':
            has_primitives = True
            break
    primitives = []
    if has_primitives:
        for c in obj.children:
            if c.type == 'MESH':
                primitive = {}
                verts = []
                if len( c.data.uv_layers ) > 0:
                    for i in range( len( c.data.vertices ) ):
                        v = c.data.vertices[i]
                        st = c.data.uv_layers[0].data[i]
                        verts.append( { 'xyz': [ v.co[0], v.co[1], v.co[2] ], 'st': [ st.uv[0], 1.0 - st.uv[1] ], 'normal': [ v.normal[0], v.normal[1], v.normal[2] ] } )
                else:
                    for v in c.data.vertices:
                        verts.append( { 'xyz': [ v.co[0], v.co[1], v.co[2] ], 'normal': [ v.normal[0], v.normal[1], v.normal[2] ] } )    
                primitive['verts'] = verts
                primitives.append( primitive )
                polygons = []
                for p in c.data.polygons:
                    #print ( p.vertices )
                    indices = []
                    for i in p.vertices:
                        indices.append( i )
                    #for i in range( len( p.vertices ) ):
                    #    indices.append( p.vertices[i] )
                    polygons.append( { 'material': c.data.materials[p.material_index].name, 'indices': indices } )
                primitive['polygons'] = polygons
    return primitives