Skip to content

Commit

Permalink
Reset disp_map instead of setting nullptr array. (#790) (#791)
Browse files Browse the repository at this point in the history
  • Loading branch information
sirpalee committed Jun 1, 2021
1 parent 89bd454 commit f632ca9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions render_delegate/mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,16 @@ void HdArnoldMesh::Sync(
setMaterial(_subsets[subset], subset);
}
setMaterial(sceneDelegate->GetMaterialId(id), numSubsets);
if (std::any_of(dispMap, dispMap + numShaders, [](AtNode* disp) { return disp != nullptr; })) {
AiArrayUnmap(dispMapArray);
AiNodeSetArray(GetArnoldNode(), str::disp_map, dispMapArray);
} else {
AiArrayUnmap(dispMapArray);
AiArrayDestroy(dispMapArray);
AiNodeResetParameter(GetArnoldNode(), str::disp_map);
}
AiArrayUnmap(shaderArray);
AiArrayUnmap(dispMapArray);
AiNodeSetArray(GetArnoldNode(), str::shader, shaderArray);
AiNodeSetArray(GetArnoldNode(), str::disp_map, dispMapArray);
};

if (dirtyPrimvars) {
Expand Down

0 comments on commit f632ca9

Please sign in to comment.