improve Surface Inspector consistency

was showing shader of last selected brush, texdef of 1st
now shows properties of single primitive
at 1st tries to show last selected primitive to be responsible to selection
prefers brushes over patches as general rule
This commit is contained in:
Garux
2022-10-28 21:00:55 +03:00
parent 0f2ad6378d
commit 0678e842b2
5 changed files with 37 additions and 12 deletions

View File

@@ -908,6 +908,21 @@ void Scene_BrushGetTexdef_Selected( scene::Graph& graph, TextureProjection& proj
Scene_ForEachSelectedBrush_ForEachFace( graph, FaceGetTexdef( projection ) );
}
bool Scene_BrushGetShaderTexdef_Selected( scene::Graph& graph, CopiedString& shader, TextureProjection& projection ){
BrushInstance *brush = nullptr;
if ( GlobalSelectionSystem().countSelected() == 0
|| !( brush = Instance_getBrush( GlobalSelectionSystem().ultimateSelected() ) ) ) {
Scene_forEachSelectedBrush( [&brush]( BrushInstance& b ){ if( !brush ) brush = &b; } );
}
if( brush && !brush->getBrush().empty() ){
Face *face = brush->getBrush().begin()->get();
shader = face->GetShader();
face->GetTexdef( projection );
return true;
}
return false;
}
void Scene_BrushGetTexdef_Component_Selected( scene::Graph& graph, TextureProjection& projection ){
#if 1
if ( !g_SelectedFaceInstances.empty() ) {