From 78a86b47694a7bb0bafa4393352e4293bb09357d Mon Sep 17 00:00:00 2001 From: Bogdan Nagirniak Date: Thu, 8 Jun 2023 17:04:33 +0300 Subject: [PATCH 1/2] Fix texture render in HdStorm. Changed mesh primvar name for UVs to "st" which is primary name in HdStorm. --- source/blender/render/hydra/scene_delegate/mesh.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/source/blender/render/hydra/scene_delegate/mesh.cc b/source/blender/render/hydra/scene_delegate/mesh.cc index 11e9157d08de..3558880d2e07 100644 --- a/source/blender/render/hydra/scene_delegate/mesh.cc +++ b/source/blender/render/hydra/scene_delegate/mesh.cc @@ -2,6 +2,7 @@ * Copyright 2011-2022 Blender Foundation */ #include +#include #include #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; -- 2.30.2 From ab61212f458ea69f3d934d752ae28e4ac44bf873 Mon Sep 17 00:00:00 2001 From: Bogdan Nagirniak Date: Fri, 9 Jun 2023 01:47:49 +0300 Subject: [PATCH 2/2] Fix after merge --- source/blender/render/hydra/scene_delegate/light.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/source/blender/render/hydra/scene_delegate/light.cc b/source/blender/render/hydra/scene_delegate/light.cc index b9952f2ddad2..7c1ae2f7dd30 100644 --- a/source/blender/render/hydra/scene_delegate/light.cc +++ b/source/blender/render/hydra/scene_delegate/light.cc @@ -139,7 +139,6 @@ void LightData::update() pxr::VtValue LightData::get_data(pxr::TfToken const &key) const { ID_LOG(3, "%s", key.GetText()); - pxr::VtValue ret; auto it = data_.find(key); if (it != data_.end()) { return pxr::VtValue(it->second); -- 2.30.2