10 #include <pxr/base/gf/vec2f.h>
11 #include <pxr/base/gf/vec3f.h>
12 #include <pxr/base/gf/vec4f.h>
13 #include <pxr/base/vt/array.h>
14 #include <pxr/imaging/hd/tokens.h>
24 const void *
data = HdGetValueData(value);
25 size_t size = value.GetArraySize();
27 const HdType valueType = HdGetValueTupleType(value).type;
29 TypeDesc attrType = CCL_NS::TypeUnknown;
32 attrType = CCL_NS::TypeFloat;
38 static_assert(
sizeof(GfVec2f) ==
sizeof(
float2));
40 case HdTypeFloatVec3: {
41 attrType = CCL_NS::TypeVector;
44 const auto &valueData = value.Get<VtVec3fArray>();
45 VtArray<float3> valueConverted;
46 valueConverted.reserve(valueData.size());
47 for (
const GfVec3f &vec : valueData) {
48 valueConverted.push_back(
make_float3(vec[0], vec[1], vec[2]));
50 data = valueConverted.data();
51 value = std::move(valueConverted);
55 attrType = CCL_NS::TypeFloat4;
57 static_assert(
sizeof(GfVec4f) ==
sizeof(
float4));
60 TF_WARN(
"Unsupported attribute type %d",
static_cast<int>(valueType));
64 Attribute *
const attr = attributes.
add(name, attrType, elem);
typedef float(TangentPoint)[2]
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Attribute * add(ustring name, TypeDesc type, AttributeElement element)
HDCYCLES_NAMESPACE_OPEN_SCOPE void ApplyPrimvars(AttributeSet &attributes, const ustring &name, VtValue value, AttributeElement elem, AttributeStandard std)
#define HDCYCLES_NAMESPACE_CLOSE_SCOPE
CCL_NAMESPACE_BEGIN static constexpr OIIO_NAMESPACE_USING TypeDesc TypeFloat2(TypeDesc::FLOAT, TypeDesc::VEC2)