Skip to content

Add CLI render options and terminal integration#321

Open
eisenbruch wants to merge 1 commit into
Victor-IX:mainfrom
eisenbruch:feat/cli-render-options
Open

Add CLI render options and terminal integration#321
eisenbruch wants to merge 1 commit into
Victor-IX:mainfrom
eisenbruch:feat/cli-render-options

Conversation

@eisenbruch
Copy link
Copy Markdown
Contributor

Summary

Implements command-line rendering workflow improvements as requested in #134.

New Features

  • Render Previous File: Opens terminal and runs blender -b --open-last -a to render the last opened file in background mode
    • Accessible via context menu or Ctrl+Shift+Launch shortcut
  • Open in Terminal: Context menu option to open a terminal/command prompt in the build directory

New Icons & UI Enhancements

  • Adds Blender logo icon (blender.svg) as the default Launch button icon
  • Adds render animation icon (render_animation.svg) for render actions
  • Launch button dynamically changes based on held modifier keys while hovering:
    • Default: "Launch" with Blender icon
    • Shift: "Previous" with file icon
    • Ctrl+Shift: "Render" with render icon
  • Adds size scaling support for icons in load_icon()

Platform Support

  • New open_terminal_in_directory() function in _platform.py with cross-platform support:
    • Windows: Opens CMD with optional command
    • Linux: Auto-detects terminal emulator (gnome-terminal, konsole, xfce4-terminal, mate-terminal, tilix, terminator, xterm)
    • macOS: Uses Terminal.app via AppleScript

Minor Fixes

  • Remove duplicate PopupWindow import in library_widget.py
  • Fix string quote consistency ('subversionLabel'"subversionLabel")

Closes #134

Test plan

  • Verify Launch button shows Blender icon by default
  • Verify Shift+hover changes button to "Previous" with file icon
  • Verify Ctrl+Shift+hover changes button to "Render" with render icon
  • Verify Ctrl+Shift+Launch triggers render in terminal
  • Verify "Open in Terminal" context menu opens correct directory
  • Verify "Render Previous File" context menu action works
  • Test on Windows (CMD)
  • Test on Linux (various terminal emulators)
  • Test on macOS (Terminal.app)

- 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}"],
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are also very common terminals we could check

Suggested change
["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],

Comment thread source/modules/icons.py
def load_icon(color, name):
def load_icon(color, name, size=None):
pixmap = QPixmap(base_path + name + "")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably resize the svgs themselves instead of making this special case

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 :)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Suggested change
<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>

@zeptofine zeptofine moved this from Backlog to In progress in Blender Launcher V2 Dec 21, 2025
@Victor-IX
Copy link
Copy Markdown
Owner

Victor-IX commented Dec 21, 2025

Open in Terminal would need a proper icon instead of using the folder one, and it would need to be after the "show config folder" button.

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 Render Previous File after Add to Favorites? I feel like this is a more niche feature for most users, so it doesn't make sense to have it in second position.

@zeptofine zeptofine moved this from In progress to Ready in Blender Launcher V2 Jan 25, 2026
@zeptofine zeptofine added invalid This doesn't seem right stale and removed invalid This doesn't seem right labels Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Ready

Development

Successfully merging this pull request may close these issues.

Open and Render in Command Line options

3 participants