cpichard / usdtweak

Universal Scene Description standalone editor
Apache License 2.0
232 stars 23 forks source link

compiling with dev branch of USD #11

Closed meshula closed 4 months ago

meshula commented 1 year ago

Hi, usdtweak compiles and runs with top of tree USD dev branch, with this tweak. Maybe it'd be possible to do something like this guarded on a version check or something?

git diff src/viewport/Playblast.cpp
diff --git a/src/viewport/Playblast.cpp b/src/viewport/Playblast.cpp
index 0221dcc..20af183 100644
--- a/src/viewport/Playblast.cpp
+++ b/src/viewport/Playblast.cpp
@@ -79,13 +79,20 @@ void PlayblastModalDialog::Draw() {
         _recorder.SetColorCorrectionMode(TfToken("sRGB"));
         _recorder.SetComplexity(1.0);
         UsdGeomCamera camera(_stage->GetPrimAtPath(_cameraPath));
+        std::string aov = "color";
+        std::vector<UsdTimeCode> tc;
+        tc.push_back(UsdTimeCode::Default());
+        std::vector<std::string> of;
+        of.push_back("");
         if (isSequence) {
             for (int i = start; i <= end; ++i) {
                 std::string frameName = filenamePrefix + "." + std::to_string(i) + ".jpg";
                 fs::path outputFrame(directory);
                 if (fs::is_directory(outputFrame)) {
                     outputFrame /= frameName;
-                    _recorder.Record(_stage, camera, UsdTimeCode(i), outputFrame.string());
+                    tc[0] = UsdTimeCode(i);
+                    of[0] = outputFrame.string();
+                    _recorder.Record(_stage, camera, tc, of, aov);
                 }
             }
         } else {
@@ -93,7 +100,8 @@ void PlayblastModalDialog::Draw() {
             fs::path outputFrame(directory);
             if (fs::is_directory(outputFrame)) {
                 outputFrame /= frameName;
-                _recorder.Record(_stage, camera, UsdTimeCode::Default(), outputFrame.string());
+                of[0] = outputFrame.string();
+                _recorder.Record(_stage, camera, tc, of, aov);
             }
         }
         CloseModal();
cpichard commented 1 year ago

Thanks for the patch @meshula ! I'll update usdtweak this week-end (or feel free to make a PR if you want). It looks like the recorder can process multiple frames now ? I haven't checked yet but may be it is possible to directly pass the vector of frames to process, I'll try. Thanks again !

meshula commented 1 year ago

@jonny-apple says he was able to compile without this patch, maybe I'm the one who's out of date. Maybe hold off spending time on it until I can confirm?

cpichard commented 1 year ago

sure ! In any case I'll setup a compilation of usd head this week-end, this can be useful to keep track of the changes.

expenses commented 7 months ago

I just compiled usdtweak, and the only change for the dev branch I had to make is the following:

diff --git a/src/viewport/Viewport.cpp b/src/viewport/Viewport.cpp
index c4eb9a4..515c36d 100644
--- a/src/viewport/Viewport.cpp
+++ b/src/viewport/Viewport.cpp
@@ -601,7 +601,7 @@ void Viewport::Render() {
         CameraUtilFraming framing(displayWindow, dataWindow);
         _renderer->SetRenderBufferSize(renderSize);
         _renderer->SetFraming(framing);
-        _renderer->SetOverrideWindowPolicy(std::make_pair(true, CameraUtilConformWindowPolicy::CameraUtilMatchVertically));
+        _renderer->SetOverrideWindowPolicy(std::make_optional(CameraUtilConformWindowPolicy::CameraUtilMatchVertically));

         // If using a usd camera, use SetCameraPath renderer.SetCameraPath(sceneCam.GetPath())
         // else set camera state
cpichard commented 7 months ago

Thanks @expenses ! I'll update UT this week-end.

BigRoy commented 4 months ago

Was this issue resolved with https://github.com/cpichard/usdtweak/commit/e01216de08fdc64721c7fa14c56fced9276186d6 ?

If so, I suppose this issue can be closed?

meshula commented 4 months ago

Yes, I think its fine to close.