Skip to content
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

Support running Blender: Run Script with single button 🔥 #200

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Mateusz-Grzelinski
Copy link
Collaborator

@Mateusz-Grzelinski Mateusz-Grzelinski commented Sep 8, 2024

This branch is continuation of #199 but with focus on Blender: Run Script. Lets deal with 199 first, here I also made many changes.

  • Improvements for Blender: Run Script:
    • When no Blender instances are running, run Blender: Start and then immediately run Blender: Run Script
    • When Blender instances are running, just run the script on all available instances (old behavior)
    • Specify default Blender: Start configuration in settings using isBlenderRunScriptDefault in blender.executables
    • Run Blender: Run Script using single button by adding snippet to keybindings.json.
  {
    "key": "ctrl+shift+enter",
    "command": "blender.runScript",
    "args": {
       // optional, must be absolute path, defaults to current open file
      "path": "E:\\BlenderProjects\\leagacy_and_extension\\i.py"
    },
    "when": "editorLangId == 'python'"
  }

TODO:

  • more testing needed, also on different platforms, especially different commands
  • when blender fails to start we need to clear registered callbacks
    • blender can be run with launchDebug: add identifier to debug config to know which instance to clean
    • or launch: we can track task._id to know when to clear callbacks using tasks.onDidEndTaskProcess
  • specify optional file to run
  • RunningBlenders might have invalid BlenderInstance - actually they are never cleared

@Mateusz-Grzelinski
Copy link
Collaborator Author

after recent commits should work good enough, some testing (especially with other commands) is welcome

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.

1 participant