Skip to content

Add support for additional arguments in keybinding commands#255

Open
zachEastin wants to merge 1 commit into
JacquesLucke:masterfrom
zachEastin:Allow-Additional-Arguments-to-be-Passed-to-Keybindings
Open

Add support for additional arguments in keybinding commands#255
zachEastin wants to merge 1 commit into
JacquesLucke:masterfrom
zachEastin:Allow-Additional-Arguments-to-be-Passed-to-Keybindings

Conversation

@zachEastin

Copy link
Copy Markdown
Contributor

This allows users to add the cli arguments to key bindings in order to create more custom keybindings for their workflows.

Use as follows:

{
    "key": "ctrl+shift+h",
    "command": "blender.start",
    "args": {
    "additionalArguments": ["--open-last"]
    }
}

This will open the last file opened by blender, leaving the normal calls to blender.start opening the default scene

Copilot AI review requested due to automatic review settings December 3, 2025 19:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for passing additional CLI arguments to Blender through VS Code keybindings, enabling users to create custom keybinding configurations with specific Blender command-line options (e.g., --open-last to open the most recently used file).

Key Changes:

  • Extended the StartCommandArguments type to include an optional additionalArguments parameter
  • Threaded the new parameter through the command execution chain (COMMAND_startLaunchAny/LaunchAnyInteractivelaunchgetBlenderLaunchArgs)
  • Modified argument assembly logic to append keybinding-provided arguments after existing configuration-based arguments

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/extension.ts Added additionalArguments field to StartCommandArguments type and threaded it through the COMMAND_start function to launch functions
src/blender_executable.ts Updated function signatures throughout the launch chain and modified getBlenderLaunchArgs to append passthrough arguments in both file-path and no-file-path scenarios

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Mateusz-Grzelinski

Copy link
Copy Markdown
Collaborator

oh, new face. hello.
And since when do we have copilot?

from a quick look - ok.

additionalArguments - I am torn a little bit. Design is a bit unclear to me.

  • additionalArguments are already taken from config - for most people this will be enough (IMO)
  • because the name is the same, i think the behavior should be override instead of append,
  • maybe rename? maybe fancy templating?

@zachEastin

Copy link
Copy Markdown
Contributor Author

The thought behind this is to allow for non-normal use customization. Most of the time I want to open blender a specific way. But often enough I want to open it up in a very specific way (like after crashes) and it's often enough that I don't want to have to change my prefs in the blender extension just to do it (ie open the last opened file, enable certain debug features).

This change would allow such fine-tuned behavior.

I can rename it, though I chose that name for users to connect the two and understand what it is doing without having to dig in to any docs.

I agree. Override instead of append makes more sense as well.

Thoughts on all this before I make any changes?

@Mateusz-Grzelinski

Mateusz-Grzelinski commented Dec 4, 2025

Copy link
Copy Markdown
Collaborator

Override - glad we agree.

Leave user-facing name as is. In implementation you can name it overrides or whatever.

open blender a specific way

well we can support passing additionalArguments in blenderExecutables list. Just an idea. you can have human readable name for the config, not a shortcut.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants