-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunch.py
More file actions
28 lines (21 loc) · 837 Bytes
/
launch.py
File metadata and controls
28 lines (21 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""Launch BlenderCode — run this via: blender --python launch.py"""
import sys
import site
# Ensure user site-packages (where httpx etc. live) is on sys.path
site.addsitedir(site.getusersitepackages())
sys.path.insert(0, r"C:\Users\aaron\Desktop\blendercode")
import bpy
# Install the add-on by adding to scripts path
import addon_utils
sys.path.insert(0, r"C:\Users\aaron\Desktop")
# Enable the add-on
addon_utils.enable("blendercode", default_set=True)
# Switch to 3D viewport and open the N-panel
for area in bpy.context.screen.areas:
if area.type == 'VIEW_3D':
for space in area.spaces:
if space.type == 'VIEW_3D':
# Show the sidebar
space.show_region_ui = True
break
print("BlenderCode loaded — open the N-panel (press N) and look for the BlenderCode tab")