Skip to content

Commit

Permalink
Part: Use materialIndex.setValuesPointer() only if the new values are…
Browse files Browse the repository at this point in the history
… different
  • Loading branch information
Rexbas committed Dec 2, 2023
1 parent 8f17842 commit 6711e53
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/Mod/Part/Gui/SoBrepFaceSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,9 +643,6 @@ void SoBrepFaceSet::GLRender(SoGLRenderAction *action)
}

if(pushed) {
SbBool notify = enableNotify(FALSE);
materialIndex.setNum(0);
if(notify) enableNotify(notify);
state->pop();
}else if(action->isRenderingDelayedPaths()) {
renderSelection(action,ctx);
Expand Down Expand Up @@ -836,9 +833,11 @@ bool SoBrepFaceSet::overrideMaterialBinding(SoGLRenderAction *action, SelContext
}
}

SbBool notify = enableNotify(FALSE);
materialIndex.setValuesPointer(matIndex.size(),&matIndex[0]);
if(notify) enableNotify(notify);
if (materialIndex.getNum() != matIndex.size() || materialIndex.getValues(0) != &matIndex[0]) {
SbBool notify = enableNotify(FALSE);
materialIndex.setValuesPointer(matIndex.size(), &matIndex[0]);
if (notify) enableNotify(notify);
}

SoMaterialBindingElement::set(state, this, SoMaterialBindingElement::PER_PART_INDEXED);
SoLazyElement::setPacked(state, this, packedColors.size(), &packedColors[0], hasTransparency);
Expand Down

0 comments on commit 6711e53

Please sign in to comment.