Skip to content

Commit

Permalink
fixup! VisualiserTool : VertexLabel mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmehl committed Jan 23, 2025
1 parent 501c26a commit 398f9a3
Showing 1 changed file with 16 additions and 43 deletions.
59 changes: 16 additions & 43 deletions src/GafferSceneUI/VisualiserTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -998,57 +998,30 @@ class VisualiserGadget : public Gadget
if( dataName != g_vertexIndexDataName )
{
auto vIt = primitive->variables.find( primitiveVariableName );
if( vIt == primitive->variables.end() )
vData = primitive->expandedVariableData<Data>(
primitiveVariableName,
IECoreScene::PrimitiveVariable::Vertex,
false /* throwIfInvalid */
);
if( !vData )
{
continue;
}
if( mode == VisualiserTool::Mode::Auto && vIt->second.data->typeId() != IntVectorDataTypeId )
if( mode == VisualiserTool::Mode::Auto && vData->typeId() != IntVectorDataTypeId )
{
// Will be handled by `renderColorVisualiser()` instead.
continue;
}
switch( vIt->second.data->typeId() )
{
case IntVectorDataTypeId :
vData = primitive->expandedVariableData<IntVectorData>(
primitiveVariableName,
IECoreScene::PrimitiveVariable::Vertex,
false /* throwIfInvalid */
);
break;
case FloatVectorDataTypeId :
vData = primitive->expandedVariableData<FloatVectorData>(
primitiveVariableName,
IECoreScene::PrimitiveVariable::Vertex,
false /* throwIfInvalid */
);
break;
case V2fVectorDataTypeId :
vData = primitive->expandedVariableData<V2fVectorData>(
primitiveVariableName,
IECoreScene::PrimitiveVariable::Vertex,
false /* throwIfInvalid */
);
break;
case V3fVectorDataTypeId :
vData = primitive->expandedVariableData<V3fVectorData>(
primitiveVariableName,
IECoreScene::PrimitiveVariable::Vertex,
false /* throwIfInvalid */
);
break;
case Color3fVectorDataTypeId :
vData = primitive->expandedVariableData<Color3fVectorData>(
primitiveVariableName,
IECoreScene::PrimitiveVariable::Vertex,
false /* throwIfInvalid */
);
break;
default : break;
}
if( !vData )
if(
vData->typeId() != IntVectorDataTypeId &&
vData->typeId() != FloatVectorDataTypeId &&
vData->typeId() != V2fVectorDataTypeId &&
vData->typeId() != V3fVectorDataTypeId &&
vData->typeId() != Color3fVectorDataTypeId
)
{
continue;
}
Expand Down

0 comments on commit 398f9a3

Please sign in to comment.