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:
@@ -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() ) {
|
||||
|
||||
Reference in New Issue
Block a user