Skip to content

Commit b4728be

Browse files
committed
always have object parameters show up in UI next to value parameters
1 parent 170ff69 commit b4728be

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

tsd/apps/interactive/common/tsd_ui.cpp

+13-7
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,6 @@ void buildUI_object(tsd::Object &o,
184184

185185
for (size_t i = 0; i < o.numParameters(); i++) {
186186
auto &p = o.parameterAt(i);
187-
if (p.value().holdsObject() && !anari::isArray(p.value().type()))
188-
continue;
189187
ImGui::TableNextRow();
190188
buildUI_parameter(p, ctx, useTableForParameters);
191189
}
@@ -406,10 +404,18 @@ void buildUI_parameter(
406404
}
407405
} break;
408406
default:
409-
if (useTable)
410-
ImGui::Text("%s", anari::toString(type));
411-
else
412-
ImGui::BulletText("%s | %s", name, anari::toString(type));
407+
if (anari::isObject(type)) {
408+
const auto idx = pVal.getAsObjectIndex();
409+
if (useTable)
410+
ImGui::Text("[%zu] %s", idx, anari::toString(type));
411+
else
412+
ImGui::BulletText("%s | [%zu] %s", name, idx, anari::toString(type));
413+
} else {
414+
if (useTable)
415+
ImGui::Text("%s", anari::toString(type));
416+
else
417+
ImGui::BulletText("%s | %s", name, anari::toString(type));
418+
}
413419
break;
414420
}
415421

@@ -418,7 +424,7 @@ void buildUI_parameter(
418424
if (ImGui::IsItemHovered()) {
419425
ImGui::BeginTooltip();
420426
if (isArray) {
421-
const auto idx = pVal.getAsObjectIndex();
427+
const auto idx = pVal.getAsObjectIndex();
422428
const auto &a = *ctx.getObject<Array>(idx);
423429
ImGui::Text(" idx: [%zu]", idx);
424430
const auto t = a.type();

0 commit comments

Comments
 (0)