Fix: USD Import: set active mesh color #105907

Closed
Michael Kowalski wants to merge 1 commits from makowalski:usd_import_set_active_color into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 4 additions and 2 deletions

View File

@ -458,10 +458,10 @@ void USDMeshReader::read_colors(Mesh *mesh, const double motionSampleTime)
return;
}
void *cd_ptr = add_customdata_cb(mesh, "displayColors", CD_PROP_BYTE_COLOR);
void *cd_ptr = add_customdata_cb(mesh, "displayColor", CD_PROP_BYTE_COLOR);
if (!cd_ptr) {
std::cerr << "WARNING: Couldn't add displayColors custom data.\n";
std::cerr << "WARNING: Couldn't add displayColor custom data.\n";
return;
}
@ -504,6 +504,8 @@ void USDMeshReader::read_colors(Mesh *mesh, const double motionSampleTime)
colors[loop_index].a = unit_float_to_uchar_clamp(1.0);
}
}
BKE_id_attributes_active_color_set(&mesh->id, "displayColor");
}
void USDMeshReader::read_vertex_creases(Mesh *mesh, const double motionSampleTime)