BigRoy / usd-qtpy

Python Qt components for building custom USD tools.
MIT License
57 stars 8 forks source link

Enhancement: Render / Turntable #30

Closed BigRoy closed 6 months ago

BigRoy commented 7 months ago

Feature

Implements a draft for playblasting/rendering using the USD api.


Opening this draft so I can comment on some code as we go

Sasbom commented 7 months ago

Thank you for opening the draft! Seems like a good idea.

Sasbom commented 7 months ago

Should be good to go. I implemented the majority of the suggestions! Thank you for grading my homework!

Sasbom commented 7 months ago

framingcam_data framingview01 00 snapshotframecam

framing cam logic is finally implemented with extensive commenting. I feel like table turning and turn tabling should just be a Xform prim or something on 0,0,0 doing a turn for some amount of frames, so I'll look into generating animation data.

The Kitchen scene is actually a hard scenario to test, because it is Z-up.

Sasbom commented 7 months ago

framingview01 00_fit1 0 framingview01 00_fit1 5 Added fit parameter upon request, fit = 1 vs fit = 1.5

Sasbom commented 7 months ago

turningtableview_1 turnturntableturntbaletableturn turntablecam_data cube_parent2prim turntableturntableturntableturntableturntableturntableturntableturntableturntableturntableturntable

Sasbom commented 7 months ago

centered_turningtableview_1 turntableturntableturntableturntableturntableturntableturntableturntableturntableturntableturntableturn

now gloriously centered by ensuring that double transformation doesn't take place!

Sasbom commented 7 months ago

Shameless TODO list (feel free to suggest additions):

Sasbom commented 7 months ago

I figured it out. I'm going to have to do some referential trickery.

I'm creating a new scene, and then use references to place everything in the right spot. Over the Turntable.usda, from Prism:

#usda 1.0

over "turntable_reference" (
    prepend references = @X:\VAULT_PROJECTS\COLORBLEED\Kitchen_set\Turntable.usda@
)
{
    over "parent"
    {
        over "subject_reference" (
            prepend references = @X:\VAULT_PROJECTS\COLORBLEED\Kitchen_set\Kitchen_set.usd@
        )
        {
        }
    }
}

One thing that i'd like to do, is scale the subject to defined bounds and make it conform to scene up, because at the moment, that's not happening.

image As you see, the files are loaded into an external usd file just fine.

mergedscene_ref_notconform The small white dot in the middle is the turntable scene, completely overwhelmed by the enormous kitchen.

The plan now is:

I might wrap this up in a context wrapper but I don't know.

I would very much like to start writing a transformations module too, as it would come in very handy to start applying transformations in a neat way.

Sasbom commented 7 months ago
fit_to_bounding_cube

Stages that use a reference to a file can now be generated succesfully.

First I'll commit to implementing cleanup.

Sasbom commented 7 months ago

turntable_preset turntableturntableturnturnturn

Sasbom commented 7 months ago

playblastmenu_test1

Sasbom commented 7 months ago
image

TODO:

Sasbom commented 7 months ago
playblast_menu_selectres

progress_bar

playblast_menu_complete

image

Playblasting works. And it has a progress bar! The wonders of modern technology.

Sasbom commented 7 months ago

kitchen_0002

viewerkitchen_0002

Confirmed that framing camera and viewer camera works as well. The viewer camera option is not available if the viewer is opened without it's viewer!

Large scenes like the kitchen tend to lag the main window, so unfortunatly the progressbar won't be perfectly happy with very complicated scenes.

Sasbom commented 7 months ago
image image

After adding in some hooks to the normal playblast dialog, I have started implementing a turntable dialog. It exposes essentially all turntable functionality to the user, even searching through the file for cameras. You can see that the frame dialog is different, there is no longer a place to select single frames, nor frame ranges, there is just starting frame, and length, to make things as easy as possible.

I might add a refresh button next to the camera box, for when the turntable textbox is typed in, or listen in on some changed event. I don't want to do this too often though as reading the cameras requires opening the file.

Sasbom commented 7 months ago

image

image

Implemented all 3 modes of turntabling:

BigRoy commented 6 months ago

I seemed to be unable to push into this branch - unfortunately. So I've opened a replacement branch with this PR included and some more cosmetic tweaks done on top of it. Closing this in favor of https://github.com/BigRoy/usd-qtpy/pull/43