Add support for additional arguments in keybinding commands#255
Conversation
There was a problem hiding this comment.
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
StartCommandArgumentstype to include an optionaladditionalArgumentsparameter - Threaded the new parameter through the command execution chain (
COMMAND_start→LaunchAny/LaunchAnyInteractive→launch→getBlenderLaunchArgs) - 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.
|
oh, new face. hello. from a quick look - ok.
|
|
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? |
|
Override - glad we agree. Leave user-facing name as is. In implementation you can name it overrides or whatever.
well we can support passing |
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.startopening the default scene