forked from blender/blender
Fix texture render in HdStorm. #54
@ -2,6 +2,7 @@
|
||||
* Copyright 2011-2022 Blender Foundation */
|
||||
|
||||
#include <pxr/base/gf/vec2f.h>
|
||||
#include <pxr/base/tf/staticTokens.h>
|
||||
#include <pxr/imaging/hd/tokens.h>
|
||||
|
||||
#include "BKE_material.h"
|
||||
@ -12,6 +13,10 @@
|
||||
#include "blender_scene_delegate.h"
|
||||
#include "mesh.h"
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
TF_DEFINE_PRIVATE_TOKENS(_tokens, (st));
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
namespace blender::render::hydra {
|
||||
|
||||
MeshData::MeshData(BlenderSceneDelegate *scene_delegate,
|
||||
@ -93,7 +98,7 @@ pxr::VtValue MeshData::get_data(pxr::SdfPath const &id, pxr::TfToken const &key)
|
||||
else if (key == pxr::HdTokens->normals) {
|
||||
ret = submesh(id).normals;
|
||||
}
|
||||
else if (key == pxr::HdPrimvarRoleTokens->textureCoordinate) {
|
||||
else if (key == pxr::_tokens->st) { // pxr::HdPrimvarRoleTokens->textureCoordinate) {
|
||||
ret = submesh(id).uvs;
|
||||
}
|
||||
return ret;
|
||||
@ -136,9 +141,8 @@ pxr::HdPrimvarDescriptorVector MeshData::primvar_descriptors(
|
||||
pxr::HdTokens->normals, interpolation, pxr::HdPrimvarRoleTokens->normal);
|
||||
}
|
||||
if (!submeshes_[0].uvs.empty()) {
|
||||
primvars.emplace_back(pxr::HdPrimvarRoleTokens->textureCoordinate,
|
||||
interpolation,
|
||||
pxr::HdPrimvarRoleTokens->textureCoordinate);
|
||||
primvars.emplace_back(
|
||||
pxr::_tokens->st, interpolation, pxr::HdPrimvarRoleTokens->textureCoordinate);
|
||||
}
|
||||
}
|
||||
return primvars;
|
||||
|
Loading…
Reference in New Issue
Block a user