Status: In early development. Unpublished. Expect bugs.
In Blender addons, we often use pure strings to call operators from UI. This addon provides autocompletion for those strings.
Autocompletion is triggered if word operator
is present in current line, or line above in .py
files.
import bpy
class HelloWorldPanel(bpy.types.Panel):
"""Creates a Panel in the Object properties window"""
bl_label = "Hello World Panel"
bl_idname = "OBJECT_PT_hello"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "object"
def draw(self, context):
self.layout.operator("mesh.primitive_cube_add") # autocompletes this string
bpy.utils.register_class(HelloWorldPanel)
I hope to merge this addon Blender Development, but for now I am learning how to write VS addons with TypeScript.
The extension is installed like any other extension in Visual Studio Code.
- settings: set path to Blender executable
- autocomplete string with blender operators
- get and cache list of operators from Blender
- manually refresh list of operators
- optional: go to definition of operator
- include files in
C:\\Program Files\\Blender Foundation\\Blender 2.93\\2.93\\scripts\\startup\\bl_operators
- include custom addons
- include operators implemented in C - go to C source code (if provided) or website
- include files in
- optional: use language server instead of executing extenal commands
- add tests