forked from blender/blender
Refactor code after PR #57 #67
@ -108,10 +108,6 @@ pxr::VtValue VolumeData::get_data(pxr::TfToken const &key) const
|
||||
if (key == pxr::HdVolumeFieldSchemaTokens->filePath) {
|
||||
return pxr::VtValue(pxr::SdfAssetPath(filepath_, filepath_));
|
||||
}
|
||||
if (key == pxr::HdVolumeFieldSchemaTokens->fieldName) {
|
||||
std::string name = prim_id.GetName();
|
||||
return pxr::VtValue(pxr::TfToken(name.substr(name.find("VF_") + 3)));
|
||||
}
|
||||
if (key == pxr::HdVolumeFieldSchemaTokens->fieldIndex) {
|
||||
return pxr::VtValue(0);
|
||||
}
|
||||
@ -121,6 +117,16 @@ pxr::VtValue VolumeData::get_data(pxr::TfToken const &key) const
|
||||
return pxr::VtValue();
|
||||
}
|
||||
|
||||
pxr::VtValue VolumeData::get_data(pxr::SdfPath const &id, pxr::TfToken const &key) const
|
||||
{
|
||||
if (key == pxr::HdVolumeFieldSchemaTokens->fieldName) {
|
||||
std::string name = id.GetName();
|
||||
return pxr::VtValue(pxr::TfToken(name.substr(name.find("VF_") + 3)));
|
||||
}
|
||||
|
||||
return get_data(key);
|
||||
}
|
||||
|
||||
pxr::SdfPath VolumeData::material_id() const
|
||||
{
|
||||
if (!mat_data_) {
|
||||
|
@ -20,6 +20,7 @@ class VolumeData : public ObjectData {
|
||||
void update() override;
|
||||
|
||||
pxr::VtValue get_data(pxr::TfToken const &key) const override;
|
||||
pxr::VtValue get_data(pxr::SdfPath const &id, pxr::TfToken const &key) const override;
|
||||
pxr::SdfPath material_id() const override;
|
||||
void available_materials(Set<pxr::SdfPath> &paths) const override;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user