Skip to content

Commit

Permalink
Various cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
lanierd-adsk committed Apr 8, 2024
1 parent b61b3ab commit 07efb7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
10 changes: 4 additions & 6 deletions lib/mayaHydra/hydraExtensions/adapters/meshAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,15 +321,13 @@ class MayaHydraMeshAdapter : public MayaHydraShapeAdapter
}

static const bool passNormalsToHydra = MayaHydraSceneIndex::passNormalsToHydra();
if (passNormalsToHydra){
return HdMeshTopology(
return (passNormalsToHydra) ?
HdMeshTopology(
PxOsdOpenSubdivTokens->none,//For the OGS normals vertex buffer to be used, we need to use PxOsdOpenSubdivTokens->none
UsdGeomTokens->rightHanded,
faceVertexCounts,
faceVertexIndices);
}

return HdMeshTopology(
faceVertexIndices) :
HdMeshTopology(
(GetMayaHydraSceneIndex()->GetParams().displaySmoothMeshes || GetDisplayStyle().refineLevel > 0)
? PxOsdOpenSubdivTokens->catmullClark
: PxOsdOpenSubdivTokens->none,
Expand Down
6 changes: 2 additions & 4 deletions lib/mayaHydra/hydraExtensions/adapters/renderItemAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <mayaHydraLib/adapters/mayaAttrs.h>
#include <mayaHydraLib/adapters/tokens.h>
#include <mayaHydraLib/sceneIndex/mayaHydraSceneIndex.h>
#include <mayaHydraLib/mayaUtils.h>

#include <pxr/base/plug/plugin.h>
#include <pxr/base/plug/registry.h>
Expand Down Expand Up @@ -203,7 +202,7 @@ void MayaHydraRenderItemAdapter::UpdateFromDelta(const UpdateFromDeltaData& data
// Vertices
if (geomChanged && vertexBuffercount) {
//vertexBuffercount > 0 means geom is non null
for (int vbIdx = 0; vbIdx < geom->vertexBufferCount(); vbIdx++) {
for (int vbIdx = 0; vbIdx < vertexBuffercount; vbIdx++) {
MVertexBuffer* mvb = geom->vertexBuffer(vbIdx);
if ( ! mvb) {
continue;
Expand Down Expand Up @@ -306,15 +305,14 @@ void MayaHydraRenderItemAdapter::UpdateFromDelta(const UpdateFromDeltaData& data

MVertexBuffer* mvb = nullptr;

for (int vbIdx = 0; vbIdx < geom->vertexBufferCount(); vbIdx++) {
for (int vbIdx = 0; vbIdx < vertexBuffercount; vbIdx++) {
mvb = geom->vertexBuffer(vbIdx);
if (!mvb)
continue;

const MVertexBufferDescriptor& desc = mvb->descriptor();
const auto semantic = desc.semantic();
switch(semantic){

case MGeometry::Semantic::kTexture: {
// Hydra supports a uv coordinate for each face-index (face varying), though we could use its own set of indices which should be smaller.
_uvs.clear();
Expand Down

0 comments on commit 07efb7a

Please sign in to comment.