From 1b4f35f6a5889d8d2e65c6231e84f8b1744c4f96 Mon Sep 17 00:00:00 2001 From: Aras Pranckevicius Date: Tue, 14 Jun 2022 10:19:02 +0300 Subject: obj: vertex colors support in importer and exporter Adds support for vertex colors to OBJ I/O. Importer: - Supports both "xyzrgb" and "MRGB" vertex color formats. - Whenever vertex color is present in the file for a model, it is imported and a Color attribute is created (per-vertex, full float color data type). Color coming from the file is assumed to be sRGB, and is converted to linear upon import. Exporter: - Option to export the vertex colors. Defaults to "off", since not all 3rd party software supports vertex colors. - When the option is "on", if a mesh has a color attribute layer, the active one is exported in "xyzrgb" form. If the mesh has per-face-corner colors, they are averaged on the vertices. Colors are converted from linear to sRGB upon export. Reviewed By: Howard Trickey Differential Revision: https://developer.blender.org/D15159 --- source/blender/io/wavefront_obj/importer/obj_import_mesh.hh | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/io/wavefront_obj/importer/obj_import_mesh.hh') diff --git a/source/blender/io/wavefront_obj/importer/obj_import_mesh.hh b/source/blender/io/wavefront_obj/importer/obj_import_mesh.hh index cf4a2aee394..216717f3578 100644 --- a/source/blender/io/wavefront_obj/importer/obj_import_mesh.hh +++ b/source/blender/io/wavefront_obj/importer/obj_import_mesh.hh @@ -65,6 +65,7 @@ class MeshFromGeometry : NonMovable, NonCopyable { Map &created_materials, Object *obj); void create_normals(Mesh *mesh); + void create_colors(Mesh *mesh); }; } // namespace blender::io::obj -- cgit v1.2.3