Skip to content

Commit

Permalink
#5584: Patch control lattice is now rendered when in vertex component…
Browse files Browse the repository at this point in the history
… mode
  • Loading branch information
codereader committed Jan 7, 2022
1 parent cf039c0 commit b872517
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
12 changes: 10 additions & 2 deletions radiantcore/patch/PatchNode.cpp
Expand Up @@ -344,8 +344,16 @@ void PatchNode::onPreRender(const VolumeTest& volume)
_renderableSurfaceWireframe.update(_renderEntity->getWireShader());
}

// Selected patches in component mode render the lattice connecting the control points
_renderableCtrlLattice.update(_ctrlLatticeShader);
if (isSelected() && GlobalSelectionSystem().ComponentMode() == selection::ComponentSelectionMode::Vertex)
{
// Selected patches in component mode render the lattice connecting the control points
_renderableCtrlLattice.update(_ctrlLatticeShader);
}
else
{
_renderableCtrlLattice.clear();
_renderableCtrlLattice.queueUpdate(); // will be updated next time it's rendered
}
}

void PatchNode::renderSolid(IRenderableCollector& collector, const VolumeTest& volume) const
Expand Down
3 changes: 1 addition & 2 deletions radiantcore/patch/PatchNode.h
Expand Up @@ -62,8 +62,6 @@ class PatchNode final :
// Copy Constructor
PatchNode(const PatchNode& other);

void updateSelectableControls();

std::string name() const override;
Type getNodeType() const override;

Expand Down Expand Up @@ -150,6 +148,7 @@ class PatchNode final :
void onControlPointsChanged();
void onMaterialChanged();
void onTesselationChanged();
void updateSelectableControls();

protected:
// Gets called by the Transformable implementation whenever
Expand Down

0 comments on commit b872517

Please sign in to comment.