-
Notifications
You must be signed in to change notification settings - Fork 10
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
Conversation
….com/Sasbom/usd-qtpy into enhancement/usdview_render_turntable
Thank you for opening the draft! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some first remarks.
usd_qtpy/editor.py
Outdated
# Render menu | ||
|
||
render_menu = menubar.addMenu("Render") | ||
render_labels = "Playblast" , "Snapshot" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PEP8 - check your linter. :)
render_labels = "Playblast" , "Snapshot" | |
render_labels = "Playblast", "Snapshot" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PEP8 - check your linter. :)
I really should ; _ ;
On the topic of PEP8 on a different note, I know that snake_case is preferable for functions,
I just look at Qt and Usd and can't help but copy their style to maintain consistency.
That's my reasoning for naming functions the way I do. I will rename them all to be snake case, I will never more be tempted by the demons hiding in libraries.
Should be good to go. I implemented the majority of the suggestions! |
…rilling in walls. Might need to check this later.
You can even set the aspect ratio. Amazing. There is still some stuff to be done to make a turntable work, but this is an important step on the road there.
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. |
…ot implemented yet
…ed pattern matching for filename
Implemented all 3 modes of turntabling:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UIs look good.
Some code remarks added. Let me know what makes sense and whether you need me to refactor things instead.
usd_qtpy/render_util/dialog.py
Outdated
if opt_index == 0: | ||
return f"{start}" | ||
elif opt_index == 1: | ||
return playblast.get_frames_string(start,end,stride) | ||
elif opt_index == 2: | ||
if self._stageview: | ||
return playblast.get_stageview_frame(self._stageview) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like setting up constants in classes, especially not for this particular element since this element doesn't
stay the same when inherited, so I'll comment on it.
Normally I'd define an enum, if something is common.
usd_qtpy/render_util/dialog.py
Outdated
elif "Framing" in box_text: | ||
camera = framing_camera.create_framing_camera_in_stage( | ||
self._stage, | ||
name="Playblast_framingCam", | ||
fit=self.spinbox_fit.value(), | ||
width=width, | ||
height=height | ||
) | ||
return camera, True | ||
elif "Viewer" in box_text: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will match the full label, I've done something similar in other sections.
This was written when I wasn't yet sure about what to call the label yet, but I knew that it was going to have the keywords "Framing" and "Viewer" in there.
Will change in next push.
usd_qtpy/render_util/dialog.py
Outdated
playblast.render_playblast(self._stage, | ||
path, | ||
frames, | ||
self.spinbox_horresolution.value(), | ||
camera, | ||
self.cbox_complexity.currentText(), | ||
self.cbox_renderer.currentText(), | ||
"sRGB", | ||
self._gather_purposes(), | ||
self | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll seperate the getting of the arguments from their respective UI elements and store them,
and also name them, argname=argvariable
usd_qtpy/render_util/dialog.py
Outdated
# cleanup camera if needed | ||
if should_destroy: | ||
self._stage.RemovePrim(camera.GetPath()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have been thinking about that, but there are cases where a camera for example is not supposed to be deleted, because it exists in the stage and is pulled from there. I could make the contextmanager accept an argument that would delete the camera, but that wouldn't make that much of a difference.
Let me know if you'd still like to see a context manager for camera's, specifically.
What I think could definitely benefit from a context manager, is temporary scene and associated file operations. I do plenty of that in the turntabling setup, and have been thinking about wrapping those in a context manager.
TODO: context managers for temporary cameras/scenes
… manager in playblast.get_file_cameras
…data is collected before files are deleted.
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 #43 |
Feature
Implements a draft for playblasting/rendering using the USD api.
Opening this draft so I can comment on some code as we go