20 const pxr::UsdGeomPrimvar &primvar,
21 const pxr::TfToken &pv_name,
22 double motion_sample_time)
25 if (usd_colors.empty()) {
32 const StringRef attr_name(pv_name.GetString());
34 attributes.lookup_or_add_for_write_only_span<
ColorGeometry4f>(attr_name, color_domain);
36 CLOG_WARN(&
LOG,
"Primvar '%s' could not be added to Blender", primvar.GetBaseName().GetText());
41 for (
const int i : faces.index_range()) {
42 if (i >= usd_colors.size()) {
48 for (
const int j : face.index_range()) {
49 const int corner = face.
start() + j;
75 if (value ==
nullptr) {
83 const pxr::UsdGeomPrimvar &primvar,
84 const double motionSampleTime,
85 const bool is_left_handed)
87 const pxr::SdfValueTypeName pv_type = primvar.GetTypeName();
88 const pxr::TfToken pv_interp = primvar.GetInterpolation();
89 const pxr::TfToken pv_name = pxr::UsdGeomPrimvar::StripPrimvarsName(primvar.GetPrimvarName());
94 if (!domain.has_value() || !type.has_value()) {
96 "Primvar '%s' (interpolation %s, type %s) cannot be converted to Blender",
99 pv_type.GetAsToken().GetText());
108 pxr::SdfValueTypeNames->Color3fArray,
109 pxr::SdfValueTypeNames->Color3hArray,
110 pxr::SdfValueTypeNames->Color3dArray))
122 if (is_left_handed) {
123 faces = mesh->faces();
void copy_primvar_to_blender_attribute(const pxr::UsdGeomPrimvar &primvar, const pxr::UsdTimeCode timecode, const eCustomDataType data_type, const bke::AttrDomain domain, const OffsetIndices< int > face_indices, bke::MutableAttributeAccessor attributes)