Changeset View
Changeset View
Standalone View
Standalone View
source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc
| Context not available. | |||||
| #include "BKE_blender_version.h" | #include "BKE_blender_version.h" | ||||
| #include "BLI_enumerable_thread_specific.hh" | |||||
| #include "BLI_path_util.h" | #include "BLI_path_util.h" | ||||
| #include "BLI_task.hh" | #include "BLI_task.hh" | ||||
| Context not available. | |||||
| obj_mesh_data.tot_uv_vertices()); | obj_mesh_data.tot_uv_vertices()); | ||||
| const int tot_polygons = obj_mesh_data.tot_polygons(); | const int tot_polygons = obj_mesh_data.tot_polygons(); | ||||
| const int tot_deform_groups = obj_mesh_data.tot_deform_groups(); | |||||
| threading::EnumerableThreadSpecific<Vector<float>> group_weights; | |||||
| obj_parallel_chunked_output(fh, tot_polygons, [&](FormatHandler<eFileType::OBJ> &buf, int idx) { | obj_parallel_chunked_output(fh, tot_polygons, [&](FormatHandler<eFileType::OBJ> &buf, int idx) { | ||||
| /* Polygon order for writing into the file is not necessarily the same | /* Polygon order for writing into the file is not necessarily the same | ||||
| * as order in the mesh; it will be sorted by material indices. Remap current | * as order in the mesh; it will be sorted by material indices. Remap current | ||||
| Context not available. | |||||
| /* Write vertex group if different from previous. */ | /* Write vertex group if different from previous. */ | ||||
| if (export_params_.export_vertex_groups) { | if (export_params_.export_vertex_groups) { | ||||
| Vector<float> &local_weights = group_weights.local(); | |||||
| local_weights.resize(tot_deform_groups); | |||||
| const int16_t prev_group = idx == 0 ? NEGATIVE_INIT : | const int16_t prev_group = idx == 0 ? NEGATIVE_INIT : | ||||
| obj_mesh_data.get_poly_deform_group_index(prev_i); | obj_mesh_data.get_poly_deform_group_index( | ||||
| const int16_t group = obj_mesh_data.get_poly_deform_group_index(i); | prev_i, local_weights); | ||||
| const int16_t group = obj_mesh_data.get_poly_deform_group_index(i, local_weights); | |||||
| if (group != prev_group) { | if (group != prev_group) { | ||||
| buf.write<eOBJSyntaxElement::object_group>( | buf.write<eOBJSyntaxElement::object_group>( | ||||
| group == NOT_FOUND ? DEFORM_GROUP_DISABLED : | group == NOT_FOUND ? DEFORM_GROUP_DISABLED : | ||||
| Context not available. | |||||