-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Convert UsdZip to C++ #2101
base: dev
Are you sure you want to change the base?
Convert UsdZip to C++ #2101
Conversation
Filed as internal issue #USD-7784 |
e51a439
to
b3e6768
Compare
Refactored to base on #2107 |
b3e6768
to
3d34f41
Compare
@meshula I wanted to revisit this PR and see what you think would be a good approach to get it in.
Anyway would love your thoughts since I'd love to have usdzip in my non-Python builds of USD for selfish reasons. |
Other non-python-centric groups such as gamedev are keen to have non-pythonic versions of the tools, so you're not the only one looking for C++ versions of these tools. Since you tagged me I feel compelled to have a cunning thought. What if you make an intermediate stage for your project, that doesn't lose functionality? name the c++ tool something else, like I dunno, now you can run Maybe it's practical to have usdzip and usdzip.py live side by side, so maybe the subterfuge of a renamed c++ variant is not needed. Not sure. |
Hmm I can give that a try and see what feels better, though I'm a little hesitant to introduce an extra file to the mix. The last round of C++ rewrites I did, the Pixar folks had said to go with a hard switchover for simplicit. Anyway, I'll try your suggestion out in addition to mine. The changes are minimal either way, so should be quick to try out. |
3d34f41
to
ab5d8df
Compare
Okay great, that simplifies things |
@meshula okay donesies. This is rebased to the latest dev commit as of this morning. I didn't end up using the Tf Python functions because I was getting random segfaults when trying to use it, that I couldn't unwind. Since this is a leaf utility, I ended up just using standard CPython functions. Let me know if there's any changes y'all recommend. Hopefully it's in a state that's acceptably mergeable. |
Excellent, all the tests passed. I always forget msvc doesn't support all the C keywords that clang and gcc do. |
This PR depends on #2090 , and follows up by converting usdzip to C++.
The files that are changed from that PR are:
pxr/usd/bin/usdzip/CMakeLists.txt
pxr/usd/bin/usdzip/usdzip.cpp
additionally a new
GetFileSize
function was added to thepxr/usd/bin/common.h/cpp
files.Some notes:
testUsdZipInputFiles2
fails because the order of the files listed from the UDSZ are in a different order. I'm not sure what to do here. I'm not sure what causes the files to be listed in a different order, but I don't see anything obvious. I'm getting the filelist in the same order as theUsdZipFile
provides it, but it looks likeUsdZipFile
gives it to me in a different order? specificallysrc/sub/c.png
andsrc/sub/d.txt
are returned in flipped positions.