def _parse_node(node, parent_matrix, material_map, meshes, graph, resolver=None):
    '\n    Recursively parse COLLADA scene nodes.\n    '
    if isinstance(node, collada.scene.GeometryNode):
        geometry = node.geometry
        local_material_map = {}
        for mn in node.materials:
            symbol = mn.symbol
            m = mn.target
            if (m.id in material_map):
                local_material_map[symbol] = material_map[m.id]
            else:
                local_material_map[symbol] = _parse_material(m, resolver)
        for (i, primitive) in enumerate(geometry.primitives):
            if isinstance(primitive, collada.polylist.Polylist):
                primitive = primitive.triangleset()
            if isinstance(primitive, collada.triangleset.TriangleSet):
                vertex = primitive.vertex
                vertex_index = primitive.vertex_index
                vertices = vertex[vertex_index].reshape((len(vertex_index) * 3), 3)
                normals = None
                if (primitive.normal is not None):
                    normal = primitive.normal
                    normal_index = primitive.normal_index
                    normals = normal[normal_index].reshape((len(normal_index) * 3), 3)
                colors = None
                s = primitive.sources
                if (('COLOR' in s) and (len(s['COLOR']) > 0) and (len(primitive.index) > 0)):
                    color = s['COLOR'][0][4].data
                    color_index = primitive.index[:, :, s['COLOR'][0][0]]
                    colors = color[color_index].reshape((len(color_index) * 3), 3)
                faces = np.arange(vertices.shape[0]).reshape((vertices.shape[0] // 3), 3)
                vis = None
                if (primitive.material in local_material_map):
                    material = copy.copy(local_material_map[primitive.material])
                    uv = None
                    if (len(primitive.texcoordset) > 0):
                        texcoord = primitive.texcoordset[0]
                        texcoord_index = primitive.texcoord_indexset[0]
                        uv = texcoord[texcoord_index].reshape(((len(texcoord_index) * 3), 2))
                    vis = visual.texture.TextureVisuals(uv=uv, material=material)
                primid = u'{}.{}'.format(geometry.id, i)
                meshes[primid] = {'vertices': vertices, 'faces': faces, 'vertex_normals': normals, 'vertex_colors': colors, 'visual': vis}
                graph.append({'frame_to': primid, 'matrix': parent_matrix, 'geometry': primid})
    elif isinstance(node, collada.scene.Node):
        if (node.children is not None):
            for child in node.children:
                matrix = np.dot(parent_matrix, node.matrix)
                _parse_node(node=child, parent_matrix=matrix, material_map=material_map, meshes=meshes, graph=graph, resolver=resolver)
    elif isinstance(node, collada.scene.CameraNode):
        pass
    elif isinstance(node, collada.scene.LightNode):
        pass
Recursively parse COLLADA scene nodes.
def _parse_node(node, parent_matrix, material_map, meshes, graph, resolver=None):
    '\n    \n    '
    if isinstance(node, collada.scene.GeometryNode):
        geometry = node.geometry
        local_material_map = {}
        for mn in node.materials:
            symbol = mn.symbol
            m = mn.target
            if (m.id in material_map):
                local_material_map[symbol] = material_map[m.id]
            else:
                local_material_map[symbol] = _parse_material(m, resolver)
        for (i, primitive) in enumerate(geometry.primitives):
            if isinstance(primitive, collada.polylist.Polylist):
                primitive = primitive.triangleset()
            if isinstance(primitive, collada.triangleset.TriangleSet):
                vertex = primitive.vertex
                vertex_index = primitive.vertex_index
                vertices = vertex[vertex_index].reshape((len(vertex_index) * 3), 3)
                normals = None
                if (primitive.normal is not None):
                    normal = primitive.normal
                    normal_index = primitive.normal_index
                    normals = normal[normal_index].reshape((len(normal_index) * 3), 3)
                colors = None
                s = primitive.sources
                if (('COLOR' in s) and (len(s['COLOR']) > 0) and (len(primitive.index) > 0)):
                    color = s['COLOR'][0][4].data
                    color_index = primitive.index[:, :, s['COLOR'][0][0]]
                    colors = color[color_index].reshape((len(color_index) * 3), 3)
                faces = np.arange(vertices.shape[0]).reshape((vertices.shape[0] // 3), 3)
                vis = None
                if (primitive.material in local_material_map):
                    material = copy.copy(local_material_map[primitive.material])
                    uv = None
                    if (len(primitive.texcoordset) > 0):
                        texcoord = primitive.texcoordset[0]
                        texcoord_index = primitive.texcoord_indexset[0]
                        uv = texcoord[texcoord_index].reshape(((len(texcoord_index) * 3), 2))
                    vis = visual.texture.TextureVisuals(uv=uv, material=material)
                primid = u'{}.{}'.format(geometry.id, i)
                meshes[primid] = {'vertices': vertices, 'faces': faces, 'vertex_normals': normals, 'vertex_colors': colors, 'visual': vis}
                graph.append({'frame_to': primid, 'matrix': parent_matrix, 'geometry': primid})
    elif isinstance(node, collada.scene.Node):
        if (node.children is not None):
            for child in node.children:
                matrix = np.dot(parent_matrix, node.matrix)
                _parse_node(node=child, parent_matrix=matrix, material_map=material_map, meshes=meshes, graph=graph, resolver=resolver)
    elif isinstance(node, collada.scene.CameraNode):
        pass
    elif isinstance(node, collada.scene.LightNode):
        pass