Add CLI render options and terminal integration#321
Conversation
- Add open_terminal_in_directory() for cross-platform terminal opening with optional command execution (Windows/Linux/macOS) - Add "Render Previous File" action to run blender -b --open-last -a in terminal, accessible via context menu or Ctrl+Shift+Launch - Add "Open in Terminal" context menu action for build directories - Enhance Launch button with dynamic icon states for modifier keys - Add blender.svg and render_animation.svg icons with size scaling
| terminals = [ | ||
| ["gnome-terminal", "--", "bash", "-c", shell_cmd], | ||
| ["konsole", "-e", "bash", "-c", shell_cmd], | ||
| ["xfce4-terminal", "-e", f"bash -c {quoted_cmd}"], |
There was a problem hiding this comment.
These are also very common terminals we could check
| ["xfce4-terminal", "-e", f"bash -c {quoted_cmd}"], | |
| ["xfce4-terminal", "-e", f"bash -c {quoted_cmd}"], | |
| ["alacritty", "-e", "bash", "-c", shell_cmd], | |
| ["kitty", "-e", "bash", "-c", shell_cmd], | |
| ["foot", "-e", "bash", "-c", shell_cmd], |
| def load_icon(color, name): | ||
| def load_icon(color, name, size=None): | ||
| pixmap = QPixmap(base_path + name + "") | ||
|
|
There was a problem hiding this comment.
Should probably resize the svgs themselves instead of making this special case
There was a problem hiding this comment.
I am gonna be real I don't think this looks good or is necessary 😭
Willing for a second opinion from @Victor-IX during the weekend
There was a problem hiding this comment.
i think if the text alignment were adjusted it wouldnt be as bad. i only added them to be consistent with the icon being present for loading the previous file. im fine with there not being any icons in the buttons. either way :)
There was a problem hiding this comment.
I'm not a huge fan of the Blender icon in the launcher button. It doesn't convey any additional information to the user. We have the play arrow icon for the Quick Launch there, but adding an icon on all the builds seems unnecessary. Also, we support Bforartists builds, and those don't use the Blender Official icon.
The Blender icon is copyrighted if I'm not mistaken, so it's better not to use it in the app.
| @@ -0,0 +1 @@ | |||
| <svg height="1700" viewBox="0 0 1700 1700" width="1700" xmlns="http://www.w3.org/2000/svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"><sodipodi:namedview pagecolor="#303030" showgrid="true"><inkscape:grid id="grid5" units="px" spacingx="100" spacingy="100" color="#4772b3" opacity="0.2" visible="true" /></sodipodi:namedview><g fill="#fff"><path d="m202 473c-3.86007 0-7 3.13993-7 7s3.13993 7 7 7 7-3.13993 7-7-3.13993-7-7-7zm0 1c1.09865 0 2 .90135 2 2s-.90135 2-2 2-2-.90135-2-2 .90135-2 2-2zm-4 4c1.09865 0 2 .90135 2 2s-.90135 2-2 2-2-.90135-2-2 .90135-2 2-2zm8 0c1.09865 0 2 .90135 2 2s-.90135 2-2 2-2-.90135-2-2 .90135-2 2-2zm-4 1c.54636 0 1 .45364 1 1s-.45364 1-1 1-1-.45364-1-1 .45364-1 1-1zm0 3c1.09865 0 2 .90135 2 2s-.90135 2-2 2-2-.90135-2-2 .90135-2 2-2zm4.96484 4a.50005.50005 0 0 0 -.47265.49219.50005.50005 0 0 0 .50781.50781h.5c.83333 0 1.14655.35353 1.64648.85352a.50005.50005 0 1 0 .70704-.70704c-.49997-.50001-1.18685-1.14648-2.35352-1.14648h-.5a.50005.50005 0 0 0 -.0352 0z" transform="matrix(100 0 0 100 -19400.351 -47200.351)"/></g></svg> No newline at end of file | |||
There was a problem hiding this comment.
I edited this, here's the same svg with the proper scale, and with a little bit more padding to make it fit in more with the Previous image used in a similar context
| <svg height="1700" viewBox="0 0 1700 1700" width="1700" xmlns="http://www.w3.org/2000/svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"><sodipodi:namedview pagecolor="#303030" showgrid="true"><inkscape:grid id="grid5" units="px" spacingx="100" spacingy="100" color="#4772b3" opacity="0.2" visible="true" /></sodipodi:namedview><g fill="#fff"><path d="m202 473c-3.86007 0-7 3.13993-7 7s3.13993 7 7 7 7-3.13993 7-7-3.13993-7-7-7zm0 1c1.09865 0 2 .90135 2 2s-.90135 2-2 2-2-.90135-2-2 .90135-2 2-2zm-4 4c1.09865 0 2 .90135 2 2s-.90135 2-2 2-2-.90135-2-2 .90135-2 2-2zm8 0c1.09865 0 2 .90135 2 2s-.90135 2-2 2-2-.90135-2-2 .90135-2 2-2zm-4 1c.54636 0 1 .45364 1 1s-.45364 1-1 1-1-.45364-1-1 .45364-1 1-1zm0 3c1.09865 0 2 .90135 2 2s-.90135 2-2 2-2-.90135-2-2 .90135-2 2-2zm4.96484 4a.50005.50005 0 0 0 -.47265.49219.50005.50005 0 0 0 .50781.50781h.5c.83333 0 1.14655.35353 1.64648.85352a.50005.50005 0 1 0 .70704-.70704c-.49997-.50001-1.18685-1.14648-2.35352-1.14648h-.5a.50005.50005 0 0 0 -.0352 0z" transform="matrix(100 0 0 100 -19400.351 -47200.351)"/></g></svg> | |
| <svg height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"><g fill="#ffffff" transform="matrix(0.01119476,0,0,0.01119476,0.4844528,0.4844528)" id="g1"><path d="m 202,473 c -3.86007,0 -7,3.13993 -7,7 0,3.86007 3.13993,7 7,7 3.86007,0 7,-3.13993 7,-7 0,-3.86007 -3.13993,-7 -7,-7 z m 0,1 c 1.09865,0 2,0.90135 2,2 0,1.09865 -0.90135,2 -2,2 -1.09865,0 -2,-0.90135 -2,-2 0,-1.09865 0.90135,-2 2,-2 z m -4,4 c 1.09865,0 2,0.90135 2,2 0,1.09865 -0.90135,2 -2,2 -1.09865,0 -2,-0.90135 -2,-2 0,-1.09865 0.90135,-2 2,-2 z m 8,0 c 1.09865,0 2,0.90135 2,2 0,1.09865 -0.90135,2 -2,2 -1.09865,0 -2,-0.90135 -2,-2 0,-1.09865 0.90135,-2 2,-2 z m -4,1 c 0.54636,0 1,0.45364 1,1 0,0.54636 -0.45364,1 -1,1 -0.54636,0 -1,-0.45364 -1,-1 0,-0.54636 0.45364,-1 1,-1 z m 0,3 c 1.09865,0 2,0.90135 2,2 0,1.09865 -0.90135,2 -2,2 -1.09865,0 -2,-0.90135 -2,-2 0,-1.09865 0.90135,-2 2,-2 z m 4.96484,4 a 0.50005,0.50005 0 0 0 -0.47265,0.49219 A 0.50005,0.50005 0 0 0 207,487 h 0.5 c 0.83333,0 1.14655,0.35353 1.64648,0.85352 a 0.50005,0.50005 0 1 0 0.70704,-0.70704 C 209.35355,486.64647 208.66667,486 207.5,486 H 207 a 0.50005,0.50005 0 0 0 -0.0352,0 z" transform="matrix(100,0,0,100,-19400.351,-47200.351)" /></g></svg> |
|
It would be nice to have a setting to use a custom terminal, for example, I prefer using PowerShell over Cmd. This could be made later in a separate PR, but feel free to add that if you want. Also, can you move the |
Summary
Implements command-line rendering workflow improvements as requested in #134.
New Features
blender -b --open-last -ato render the last opened file in background modeNew Icons & UI Enhancements
blender.svg) as the default Launch button iconrender_animation.svg) for render actionsload_icon()Platform Support
open_terminal_in_directory()function in_platform.pywith cross-platform support:Minor Fixes
PopupWindowimport in library_widget.py'subversionLabel'→"subversionLabel")Closes #134
Test plan