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

Enhancement: Render / Turntable #30

Closed
wants to merge 101 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
cd7fc55
first commit, adding playblast module
Sasbom Nov 27, 2023
32b90dc
added utility and expanded on renderplayblast args and processing
Sasbom Nov 27, 2023
663f958
parsing complexity argument better, fixed walrus bugs
Sasbom Nov 28, 2023
eb84c53
slight refactor
Sasbom Nov 28, 2023
d04aad3
ConverFramePlaceholderblabla does internal None checking, so removed …
Sasbom Nov 28, 2023
bbac50c
Merge branch 'BigRoy:main' into enhancement/usdview_render_turntable
Sasbom Nov 28, 2023
8b9f7e6
Removed hardcoded complexity presets, added sanity checking for rende…
Sasbom Nov 28, 2023
b6c429c
Complete framerecorder initialization setup
Sasbom Nov 28, 2023
623f105
Merge branch 'BigRoy:main' into enhancement/usdview_render_turntable
Sasbom Nov 29, 2023
13f62c4
resources_rc added
Sasbom Nov 29, 2023
6d1e89e
added menu, functionality for snapshot. Doesn't work as intended with…
Sasbom Nov 29, 2023
94716ab
snapshot fix! Works now. Still needs major cleanup.
Sasbom Nov 29, 2023
14e5e00
Merge branch 'BigRoy:main' into enhancement/usdview_render_turntable
Sasbom Nov 29, 2023
028fdd4
changed logic in case no camera is selected to match usdrecord
Sasbom Nov 29, 2023
583f35b
Merge branch 'enhancement/usdview_render_turntable' of https://github…
Sasbom Nov 29, 2023
d7f4b9d
house cleaning, suggested bugfixes
Sasbom Nov 29, 2023
09a041b
slowly but surely adding methods to deal with cameras
Sasbom Nov 30, 2023
d69188d
added distance calculation function while downstairs neighbours are d…
Sasbom Nov 30, 2023
962ab0c
finished clipping planes function.
Sasbom Nov 30, 2023
b86915c
finished calculate camera position function.
Sasbom Nov 30, 2023
6b293db
cross platform catch for non-OGL native systems (macosx)
Sasbom Nov 30, 2023
1b934c1
Completed routine to add a framing camera!
Sasbom Nov 30, 2023
6cc9386
Merge branch 'BigRoy:main' into enhancement/usdview_render_turntable
Sasbom Nov 30, 2023
e0314a1
added fit parameter to add some padding
Sasbom Nov 30, 2023
f93c85b
micro commit to change a variable name in a function to something mor…
Sasbom Nov 30, 2023
4bbdb2d
Created render_util.turntable,
Sasbom Dec 1, 2023
271917b
bugfixes + exposed turntable render as temp functionality.
Sasbom Dec 1, 2023
60801ee
bugfix: adjusted transforms when framing camera as turntable camera
Sasbom Dec 1, 2023
b00d12f
added some utility to deal with the frame argument
Sasbom Dec 4, 2023
cdf43c0
made tuples_to_frames_string.tuple_gen way more sane
Sasbom Dec 4, 2023
9800a4b
made functions way less ridiculous
Sasbom Dec 4, 2023
218e7c1
refactored some things, added dialog helpers
Sasbom Dec 4, 2023
fa016b3
notes
Sasbom Dec 4, 2023
09a3104
top level function padding
Sasbom Dec 5, 2023
02be61e
Merge branch 'BigRoy:main' into enhancement/usdview_render_turntable
Sasbom Dec 5, 2023
38c53fa
Proposal: add traverse_prim_descendants to lib.usd
Sasbom Dec 5, 2023
8a1991f
cleaned up test
Sasbom Dec 5, 2023
fc4be96
struggling to do reparenting properly
Sasbom Dec 5, 2023
5f8ad2d
am no longer confused by reparenting, we're gonna do references.
Sasbom Dec 5, 2023
766e5c4
building out new reference based logic for turntable from file functi…
Sasbom Dec 6, 2023
3230460
fleshed out turntable_from_file to working order.
Sasbom Dec 6, 2023
bc8e23d
cleanup integration pass 1
Sasbom Dec 6, 2023
13a8545
Cleanup finalized
Sasbom Dec 6, 2023
8b46c65
cleared up some comments
Sasbom Dec 6, 2023
880e376
removed deprecated functions
Sasbom Dec 6, 2023
21b9868
updated comments
Sasbom Dec 6, 2023
e6289cb
updated comments
Sasbom Dec 6, 2023
290b14e
Merge branch 'enhancement/usdview_render_turntable' of https://github…
Sasbom Dec 6, 2023
8960936
A preset turntable USD file has been added.
Sasbom Dec 6, 2023
7123fdb
Cosmetics / cleanup
BigRoy Dec 6, 2023
3603058
Merge remote-tracking branch 'sasbom/enhancement/usdview_render_turnt…
BigRoy Dec 6, 2023
5125573
Merge pull request #2 from BigRoy/enhancement/usdview_render_turntabl…
Sasbom Dec 6, 2023
fbb7ab7
Changed template file to .usda, fixed up minor things in turntable.
Sasbom Dec 7, 2023
6730c38
division per element nessecary, fixed string error in dialog
Sasbom Dec 7, 2023
7568426
fix unwanted inclusion
Sasbom Dec 7, 2023
b19cf1e
Remove prims made in Render menu
Sasbom Dec 7, 2023
69ebc5d
clear bbox before stuffing it full of other things
Sasbom Dec 7, 2023
b6e5441
update gitignore to ignore temp folder
Sasbom Dec 7, 2023
1ef9f02
fix ignore of temp folder
Sasbom Dec 7, 2023
224de08
automated cleanup at the end of turntable render
Sasbom Dec 7, 2023
52bfb19
small changes, tiny checks for turntable from file functionality.
Sasbom Dec 8, 2023
da9e1e7
Added a guide to setting up your own turntable.
Sasbom Dec 8, 2023
910ff5c
Set up dialog and editor to dislay it
Sasbom Dec 8, 2023
6b65c0c
Merge branch 'enhancement/usdview_render_turntable' of https://github…
Sasbom Dec 8, 2023
8f81456
base layout style for PlayblastDialog
Sasbom Dec 8, 2023
cb2d3af
fleshing out dialog for playblasting
Sasbom Dec 8, 2023
5699639
further refined playblast menu
Sasbom Dec 8, 2023
d36af8e
added destination selection
Sasbom Dec 8, 2023
49866d2
added pre and post hooks to later hook into with the turntable
Sasbom Dec 8, 2023
5143d37
updated playblast dialog with area to select purposes
Sasbom Dec 8, 2023
38937ef
fixed some things, added progress bar and actual playblast functional…
Sasbom Dec 8, 2023
2918587
modified PlayblastDialog to be more flexible when inheriting
Sasbom Dec 9, 2023
e2060d1
Complexity combobox fixed and moved to be above render engine, sepera…
Sasbom Dec 9, 2023
25b84a2
added support for camera path argument in turntable_from_file
Sasbom Dec 9, 2023
160a512
Added search for cameras in stage from file
Sasbom Dec 9, 2023
09e1809
Pass along RenderReportable in turntable
Sasbom Dec 9, 2023
a8c4d35
started implementing turntable dialog
Sasbom Dec 9, 2023
ec89f96
added functionality for updating camera from file when finished typing.
Sasbom Dec 10, 2023
d6ede87
make sure playblast button on turntable doesn't do anything as it's n…
Sasbom Dec 10, 2023
52400cc
logic pass TurntableDialog
Sasbom Dec 11, 2023
0a6763e
adress minor fuckup
Sasbom Dec 11, 2023
65ca6b3
exposed fit parameter to dialog for generated framing cameras
Sasbom Dec 11, 2023
0e309e6
aux functionality for rendering turntables, laid out functionality
Sasbom Dec 11, 2023
3a58851
implemented stage rotation turntable in dialog
Sasbom Dec 12, 2023
f47ab3b
implemented camera rotation in dialog
Sasbom Dec 12, 2023
006a688
added better cleanup for camera around stage turntable in dialog, fix…
Sasbom Dec 12, 2023
2bf24b8
implemented turntable from file
Sasbom Dec 12, 2023
ec8d45a
cleaned up render menu in editor
Sasbom Dec 12, 2023
b543b86
minor cleanup
Sasbom Dec 12, 2023
f68ae5f
small fixes
Sasbom Dec 12, 2023
2feabcd
First pass of cleanup.
Sasbom Dec 13, 2023
4d0e808
added context managers for managing open scenes and deleting files
Sasbom Dec 13, 2023
5e85507
ExitStack shenanigans
Sasbom Dec 13, 2023
c104d5d
ExitStack shenanigans part 2: the big bugfix
Sasbom Dec 13, 2023
5fbaccb
fixed potential -1 index on camera box in playblast dialog
Sasbom Dec 13, 2023
daf480f
removed unneeded import to weakref
Sasbom Dec 13, 2023
30463db
exposed select functions in `__all__` and added missing stage context…
Sasbom Dec 14, 2023
184cc32
fixed spacing from top
Sasbom Dec 14, 2023
7f0720c
removed unnessecary import
Sasbom Dec 14, 2023
c51e2af
modified size, disallowed resizing of playblast/turntable dialogs
Sasbom Dec 14, 2023
57828f6
bugfix, making sure that right parameters get passed around and that …
Sasbom Dec 14, 2023
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
Prev Previous commit
Next Next commit
parsing complexity argument better, fixed walrus bugs
  • Loading branch information
Sasbom committed Nov 28, 2023
commit 663f9585160af96ad977a863951451ffaa1a34d1
18 changes: 16 additions & 2 deletions usd_qtpy/render_util/playblast.py
Original file line number Diff line number Diff line change
@@ -54,14 +54,28 @@ def camera_from_view(stage : Usd.Stage, stageview : Union[StageView, CustomStage
stageview.ExportFreeCameraToStage(stage,name)

def renderPlayblast(stage : Usd.Stage, outputpath : str, frames : str, width : int,
camera : UsdGeom.Camera = None, renderer : str = None, complexity = UsdAppUtils.complexityArgs.RefinementComplexities.HIGH):
camera : UsdGeom.Camera = None, renderer : str = None, complexity : Union[str,int] = "High"):
from pxr.UsdAppUtils.framesArgs import FrameSpecIterator, ConvertFramePlaceholderToFloatSpec
from pxr.UsdAppUtils.complexityArgs import RefinementComplexities as Complex

# rectify pathname for use in .format with path.format(frame = timeCode.getValue())
if outputpath is not None:
if outputpath := ConvertFramePlaceholderToFloatSpec(outputpath) is None:
if (outputpath := ConvertFramePlaceholderToFloatSpec(outputpath)) is None:
raise ValueError("Invalid filepath for rendering")

# ensure right complexity object is picked.
if (complex_t := type(complexity)) is str:
# ensure key correctness
complexity = complexity.lower() # set all to lowercase
complexity = complexity.title() # Uppercase Each Word (In Case Of "Very High")
if complexity not in ["Low", "Medium", "High", "Very High"]:
raise ValueError(f"Value: {complexity} entered for complexity is not valid.")

complex_level = Complex.fromName(complexity)
elif complex_t is int:
complexity = min(max(complexity,0),3) # clamp to range of 0-3, 4 elements
complex_level = Complex.ordered[complexity]


# TEMP: pick first found camera
if camera is None: