Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for display of VtArray<bool> to Hydra scene browser #187

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/adskHydraSceneBrowser/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ foreach(SOURCE IN ITEMS ${SOURCES})
set(SET_EXPANDED_REPLACEMENT "setExpanded\(true\);")
string(REGEX REPLACE "${SET_EXPANDED_REGEX}" "${SET_EXPANDED_REPLACEMENT}" FILE_CONTENTS "${FILE_CONTENTS}")

# Patch in support for VtArray<bool>. Arbitrarily place it after support
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somewhat ugly to do this in a loop that goes over all files, but convenient.

# for VtArray<GfVec2f>. For simplicity we run this on each file, even
# though it is relevant only for dataSourceValueTreeView.cpp
set(VTARRAY_TARGET_REGEX "return new Hdui_TypedArrayValueItemModel<GfVec2f>\\(value, parent\\);[\r\n\t ]+}")
set(VTARRAY_TARGET_REPLACEMENT "return new Hdui_TypedArrayValueItemModel<GfVec2f>(value, parent);\n }\n\n if (value.IsHolding<VtArray<bool>>()) {\n return new Hdui_TypedArrayValueItemModel<bool>(value, parent);\n }")
string(REGEX REPLACE "${VTARRAY_TARGET_REGEX}" "${VTARRAY_TARGET_REPLACEMENT}" FILE_CONTENTS "${FILE_CONTENTS}")

# Patch in '#include <QString>' to make sure we can use QLatin1StringView
prepend_include(FILE_CONTENTS "#include <QString>")

Expand Down