def _get_color_from_attribute(attribute_name):
    """Create a material that obtains its color from the specified attribute."""
    material = bpy.data.materials.new("color")
    material.use_nodes = True
    color_node = material.node_tree.nodes.new("ShaderNodeAttribute")
    color_node.attribute_name = attribute_name
    material.node_tree.links.new(
        color_node.outputs["Color"],
        material.node_tree.nodes["Principled BSDF"].inputs["Base Color"],
    )
    return material
Create a material that obtains its color from the specified attribute.
photogrammetry_importer/importers/point_utility.py