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

glTF importer using cgltf library #835

Merged
merged 2 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
15 changes: 15 additions & 0 deletions cmake/ports/cgltf/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# header-only library

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO jkuhlmann/cgltf
REF de399881c65c438a635627c749440eeea7e05599
SHA512 753923116b92642848ff2bda70695ddd0e7be6db43ed3cfc37aff4cba90a29a92e3dbda139a5f2c80cad1d2cdaf81e1383e4ea7a12195f61fe8cfeb105e53ea2
HEAD_REF master
)

file(COPY "${SOURCE_PATH}/cgltf.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include")
file(COPY "${SOURCE_PATH}/cgltf_write.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include")

# Handle copyright
configure_file("${SOURCE_PATH}/LICENSE" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" COPYONLY)
7 changes: 7 additions & 0 deletions cmake/ports/cgltf/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "cgltf",
"version": "1.13",
"description": "Single-file glTF 2.0 loader and writer written in C99",
"homepage": "https://github.com/jkuhlmann/cgltf",
"license": "MIT"
}
2 changes: 1 addition & 1 deletion cmake/ports/hifi-deps/CONTROL
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
Source: hifi-deps
Version: 0.1.5-github-actions
Description: Collected dependencies for High Fidelity applications
Build-Depends: bullet3, draco, etc2comp, glad, glm, node, nvtt, openexr (!android), openssl (windows), opus, polyvox, tbb (!android), vhacd, webrtc (!android|!(linux&arm)), zlib
Build-Depends: bullet3, cgltf, draco, etc2comp, glad, glm, node, nvtt, openexr (!android), openssl (windows), opus, polyvox, tbb (!android), vhacd, webrtc (!android|!(linux&arm)), zlib
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ hfm::Model::Pointer ModelLoader::load(const hifi::ByteArray& data, const hifi::V
if (!serializer) {
return hfm::Model::Pointer();
}
qDebug() << "ModelLoader::load: " << url;
Copy link
Member

Choose a reason for hiding this comment

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

near the end, hifi tried to remove all instances of directly printing model URLs from the logs as a basic security measure, so I would vote for removing this or just commenting it out

Copy link
Member Author

@ksuprynowicz ksuprynowicz Feb 26, 2024

Choose a reason for hiding this comment

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

Thanks! That was indeed intended to be removed and I forgot. What do you think about urls in error messages? Maybe for broken models it would make sense to log url?

Copy link
Member

Choose a reason for hiding this comment

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

yeah I think in error messages it's helpful, I believe hifi left some of those around too

return serializer->read(data, mapping, url);
}
Loading
Loading