@@ -436,10 +436,10 @@ void vk_gltf_viewer::control::ImGuiTaskCollector::assetInspector(gltf::AssetExte
436
436
" gltf-buffers-table" ,
437
437
ImGuiTableFlags_Borders | ImGuiTableFlags_Reorderable | ImGuiTableFlags_RowBg | ImGuiTableFlags_Hideable | ImGuiTableFlags_ScrollY,
438
438
assetExtended.asset .buffers ,
439
- ImGui::ColumnInfo { " Name" , [](std::size_t row , fastgltf::Buffer &buffer) {
440
- ImGui::WithID (row , [&]() {
439
+ ImGui::ColumnInfo { " Name" , [& ](std::size_t bufferIndex , fastgltf::Buffer &buffer) {
440
+ ImGui::WithID (bufferIndex , [&]() {
441
441
ImGui::SetNextItemWidth (-std::numeric_limits<float >::min ());
442
- ImGui::InputTextWithHint (" ##name" , " <empty> " , &buffer.name );
442
+ ImGui::InputTextWithHint (" ##name" , gui::getDisplayName (assetExtended. asset . buffers , bufferIndex) , &buffer.name );
443
443
});
444
444
}, ImGuiTableColumnFlags_WidthStretch },
445
445
ImGui::ColumnInfo { " Size" , [](const fastgltf::Buffer &buffer) {
@@ -481,10 +481,10 @@ void vk_gltf_viewer::control::ImGuiTaskCollector::assetInspector(gltf::AssetExte
481
481
" gltf-buffer-views-table" ,
482
482
ImGuiTableFlags_Borders | ImGuiTableFlags_Reorderable | ImGuiTableFlags_RowBg | ImGuiTableFlags_Hideable | ImGuiTableFlags_ScrollY,
483
483
assetExtended.asset .bufferViews ,
484
- ImGui::ColumnInfo { " Name" , [](std::size_t rowIndex , fastgltf::BufferView &bufferView) {
485
- ImGui::WithID (rowIndex , [&]() {
484
+ ImGui::ColumnInfo { " Name" , [& ](std::size_t bufferViewIndex , fastgltf::BufferView &bufferView) {
485
+ ImGui::WithID (bufferViewIndex , [&] {
486
486
ImGui::SetNextItemWidth (-std::numeric_limits<float >::min ());
487
- ImGui::InputTextWithHint (" ##name" , " <empty> " , &bufferView.name );
487
+ ImGui::InputTextWithHint (" ##name" , gui::getDisplayName (assetExtended. asset . bufferViews , bufferViewIndex) , &bufferView.name );
488
488
});
489
489
}, ImGuiTableColumnFlags_WidthStretch },
490
490
ImGui::ColumnInfo { " Buffer" , [](std::size_t i, const fastgltf::BufferView &bufferView) {
@@ -525,10 +525,10 @@ void vk_gltf_viewer::control::ImGuiTaskCollector::assetInspector(gltf::AssetExte
525
525
" gltf-images-table" ,
526
526
ImGuiTableFlags_Borders | ImGuiTableFlags_Reorderable | ImGuiTableFlags_RowBg | ImGuiTableFlags_Hideable | ImGuiTableFlags_ScrollY,
527
527
assetExtended.asset .images ,
528
- ImGui::ColumnInfo { " Name" , [](std::size_t rowIndex , fastgltf::Image &image) {
529
- ImGui::WithID (rowIndex , [&]() {
528
+ ImGui::ColumnInfo { " Name" , [& ](std::size_t imageIndex , fastgltf::Image &image) {
529
+ ImGui::WithID (imageIndex , [&] {
530
530
ImGui::SetNextItemWidth (-std::numeric_limits<float >::min ());
531
- ImGui::InputTextWithHint (" ##name" , " <empty> " , &image.name );
531
+ ImGui::InputTextWithHint (" ##name" , gui::getDisplayName (assetExtended. asset . images , imageIndex) , &image.name );
532
532
});
533
533
}, ImGuiTableColumnFlags_WidthStretch },
534
534
ImGui::ColumnInfo { " MIME" , [](const fastgltf::Image &image) {
@@ -625,10 +625,10 @@ void vk_gltf_viewer::control::ImGuiTaskCollector::assetInspector(gltf::AssetExte
625
625
" gltf-samplers-table" ,
626
626
ImGuiTableFlags_Borders | ImGuiTableFlags_Reorderable | ImGuiTableFlags_RowBg | ImGuiTableFlags_Hideable | ImGuiTableFlags_ScrollY,
627
627
assetExtended.asset .samplers ,
628
- ImGui::ColumnInfo { " Name" , [](std::size_t rowIndex , fastgltf::Sampler &sampler) {
629
- ImGui::WithID (rowIndex , [&]() {
628
+ ImGui::ColumnInfo { " Name" , [& ](std::size_t samplerIndex , fastgltf::Sampler &sampler) {
629
+ ImGui::WithID (samplerIndex , [&] {
630
630
ImGui::SetNextItemWidth (-std::numeric_limits<float >::min ());
631
- ImGui::InputTextWithHint (" ##name" , " <empty> " , &sampler.name );
631
+ ImGui::InputTextWithHint (" ##name" , gui::getDisplayName (assetExtended. asset . samplers , samplerIndex) , &sampler.name );
632
632
});
633
633
}, ImGuiTableColumnFlags_WidthStretch },
634
634
ImGui::ColumnInfo { " Filter (Mag/Min)" , [](const fastgltf::Sampler &sampler) {
@@ -710,7 +710,7 @@ void vk_gltf_viewer::control::ImGuiTaskCollector::materialEditor(gltf::AssetExte
710
710
gui::popup::waitList.emplace_back (
711
711
std::in_place_type<gui::popup::NameChanger>,
712
712
assetExtended.asset .materials [*i].name ,
713
- std::format (" Unnamed material {}" , *i));
713
+ std::format (" Unnamed Material {}" , *i));
714
714
}
715
715
}
716
716
@@ -1083,7 +1083,7 @@ void vk_gltf_viewer::control::ImGuiTaskCollector::sceneHierarchy(gltf::AssetExte
1083
1083
const fastgltf::Node &node = asset.nodes [nodeIndex];
1084
1084
1085
1085
if (std::string_view name = node.name ; name.empty ()) {
1086
- tempStringBuffer.append (" < Unnamed node {}> " , nodeIndex);
1086
+ tempStringBuffer.append (" Unnamed Node {}" , nodeIndex);
1087
1087
}
1088
1088
else {
1089
1089
tempStringBuffer.append (name);
@@ -1307,7 +1307,7 @@ void vk_gltf_viewer::control::ImGuiTaskCollector::nodeInspector(gltf::AssetExten
1307
1307
if (assetExtended.selectedNodes .size () == 1 ) {
1308
1308
const std::size_t selectedNodeIndex = *assetExtended.selectedNodes .begin ();
1309
1309
fastgltf::Node &node = assetExtended.asset .nodes [selectedNodeIndex];
1310
- ImGui::InputTextWithHint (" Name" , " <empty> " , &node.name );
1310
+ ImGui::InputTextWithHint (" Name" , gui::getDisplayName (assetExtended. asset . nodes , selectedNodeIndex) , &node.name );
1311
1311
1312
1312
ImGui::SeparatorText (" Transform" );
1313
1313
@@ -1403,7 +1403,7 @@ void vk_gltf_viewer::control::ImGuiTaskCollector::nodeInspector(gltf::AssetExten
1403
1403
if (ImGui::BeginTabBar (" node-tab-bar" )) {
1404
1404
if (node.meshIndex && ImGui::BeginTabItem (" Mesh" )) {
1405
1405
fastgltf::Mesh &mesh = assetExtended.asset .meshes [*node.meshIndex ];
1406
- ImGui::InputTextWithHint (" Name" , " <empty> " , &mesh.name );
1406
+ ImGui::InputTextWithHint (" Name" , gui::getDisplayName (assetExtended. asset . meshes , *node. meshIndex ) , &mesh.name );
1407
1407
1408
1408
for (auto &&[primitiveIndex, primitive]: mesh.primitives | ranges::views::enumerate) {
1409
1409
if (ImGui::CollapsingHeader (tempStringBuffer.write (" Primitive {}" , primitiveIndex).view ().c_str ())) {
@@ -1502,7 +1502,7 @@ void vk_gltf_viewer::control::ImGuiTaskCollector::nodeInspector(gltf::AssetExten
1502
1502
}
1503
1503
if (node.cameraIndex && ImGui::BeginTabItem (" Camera" )) {
1504
1504
auto &[camera, name] = assetExtended.asset .cameras [*node.cameraIndex ];
1505
- ImGui::InputTextWithHint (" Name" , " <empty> " , &name);
1505
+ ImGui::InputTextWithHint (" Name" , gui::getDisplayName (assetExtended. asset . cameras , *node. cameraIndex ) , &name);
1506
1506
1507
1507
ImGui::WithDisabled ([&]() {
1508
1508
if (int type = camera.index (); ImGui::Combo (" Type" , &type, " Perspective\0 Orthographic\0 " )) {
@@ -1564,7 +1564,7 @@ void vk_gltf_viewer::control::ImGuiTaskCollector::nodeInspector(gltf::AssetExten
1564
1564
}
1565
1565
if (node.lightIndex && ImGui::BeginTabItem (" Light" )) {
1566
1566
fastgltf::Light &light = assetExtended.asset .lights [*node.lightIndex ];
1567
- ImGui::InputTextWithHint (" Name" , " <empty> " , &light.name );
1567
+ ImGui::InputTextWithHint (" Name" , gui::getDisplayName (assetExtended. asset . lights , *node. lightIndex ) , &light.name );
1568
1568
ImGui::EndTabItem ();
1569
1569
}
1570
1570
0 commit comments