USD: support color4f types in addition to color3f

Support the USD `color4f` (and related) types during import and use this
type when writing out Blender's color attributes.

This roundtrips Blender data correctly and will properly load data from
many more USD files as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/125839
This commit is contained in:
Jesse Yurkovich
2024-08-04 04:34:15 +02:00
committed by Jesse Yurkovich
parent 21f2d91359
commit 892bdf3134
5 changed files with 69 additions and 31 deletions

View File

@@ -195,8 +195,8 @@ class USDExportTest(AbstractUSDTest):
self.check_primvar(prim, "p_int8", "VtArray<unsigned char>", "vertex", 4)
self.check_primvar(prim, "p_int32", "VtArray<int>", "vertex", 4)
self.check_primvar(prim, "p_float", "VtArray<float>", "vertex", 4)
self.check_primvar(prim, "p_color", "VtArray<GfVec3f>", "vertex", 4)
self.check_primvar(prim, "p_byte_color", "VtArray<GfVec3f>", "vertex", 4)
self.check_primvar(prim, "p_color", "VtArray<GfVec4f>", "vertex", 4)
self.check_primvar(prim, "p_byte_color", "VtArray<GfVec4f>", "vertex", 4)
self.check_primvar(prim, "p_vec2", "VtArray<GfVec2f>", "vertex", 4)
self.check_primvar(prim, "p_vec3", "VtArray<GfVec3f>", "vertex", 4)
self.check_primvar(prim, "p_quat", "VtArray<GfQuatf>", "vertex", 4)
@@ -228,8 +228,8 @@ class USDExportTest(AbstractUSDTest):
self.check_primvar(prim, "fc_int8", "VtArray<unsigned char>", "faceVarying", 4)
self.check_primvar(prim, "fc_int32", "VtArray<int>", "faceVarying", 4)
self.check_primvar(prim, "fc_float", "VtArray<float>", "faceVarying", 4)
self.check_primvar(prim, "fc_color", "VtArray<GfVec3f>", "faceVarying", 4)
self.check_primvar(prim, "fc_byte_color", "VtArray<GfVec3f>", "faceVarying", 4)
self.check_primvar(prim, "fc_color", "VtArray<GfVec4f>", "faceVarying", 4)
self.check_primvar(prim, "fc_byte_color", "VtArray<GfVec4f>", "faceVarying", 4)
self.check_primvar(prim, "fc_vec2", "VtArray<GfVec2f>", "faceVarying", 4)
self.check_primvar(prim, "fc_vec3", "VtArray<GfVec3f>", "faceVarying", 4)
self.check_primvar(prim, "fc_quat", "VtArray<GfQuatf>", "faceVarying", 4)