-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for Blender 4.3 (with Brush Asset Shelf)
- Loading branch information
Showing
11 changed files
with
746 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
if 'bpy' in locals(): | ||
import importlib | ||
importlib.reload(preferences) | ||
importlib.reload(tool_wheel_operator) | ||
importlib.reload(tool_data) | ||
else: | ||
from . import preferences | ||
from . import tool_wheel_operator | ||
from . import tool_data | ||
|
||
import bpy | ||
|
||
|
||
# Inits | ||
def addon_init(): | ||
# Blender ready to assign hotkey? | ||
if bpy.context.window_manager.keyconfigs.active is None: | ||
# Keep interval timer alive | ||
return 0.2 | ||
|
||
# Set default preferences (when needed) | ||
preferences.set_default_preferences() | ||
|
||
# Assign hotkey to tool wheel operator | ||
preferences.assign_hotkey_to_tool_wheel() | ||
|
||
# Add brush asset context menu item | ||
preferences.add_brush_asset_context_menu_item() | ||
|
||
# Load tool icons | ||
tool_data.tool_data.get_tool_icon_textures() | ||
|
||
|
||
# Addon registration | ||
def register(): | ||
bpy.utils.register_class(preferences.GPToolWheel_PG_tool) | ||
bpy.utils.register_class(preferences.GPToolWheel_PG_mode_order) | ||
bpy.utils.register_class(preferences.GPToolWheelPreferences) | ||
bpy.utils.register_class(preferences.GPTOOLWHEEL_UL_ModeList) | ||
bpy.utils.register_class(preferences.GPTOOLWHEEL_OT_MoveItem) | ||
bpy.utils.register_class(preferences.GPTOOLWHEEL_OT_AssignHotkey) | ||
bpy.utils.register_class(preferences.GPTOOLWHEEL_OT_SavePrefDefinition) | ||
bpy.utils.register_class(preferences.GPTOOLWHEEL_OT_LoadPrefDefinition) | ||
bpy.utils.register_class(preferences.GPENCIL_OT_link_brush_to_gp_tool_wheel) | ||
bpy.utils.register_class(tool_wheel_operator.GPENCIL_OT_tool_wheel) | ||
|
||
# Delayed inits | ||
bpy.app.timers.register(addon_init, first_interval=0.2) | ||
|
||
|
||
def unregister(): | ||
bpy.utils.unregister_class(preferences.GPToolWheel_PG_tool) | ||
bpy.utils.unregister_class(preferences.GPToolWheel_PG_mode_order) | ||
bpy.utils.unregister_class(preferences.GPToolWheelPreferences) | ||
bpy.utils.unregister_class(preferences.GPTOOLWHEEL_UL_ModeList) | ||
bpy.utils.unregister_class(preferences.GPTOOLWHEEL_OT_MoveItem) | ||
bpy.utils.unregister_class(preferences.GPTOOLWHEEL_OT_AssignHotkey) | ||
bpy.utils.unregister_class(preferences.GPTOOLWHEEL_OT_SavePrefDefinition) | ||
bpy.utils.unregister_class(preferences.GPTOOLWHEEL_OT_LoadPrefDefinition) | ||
bpy.utils.unregister_class(preferences.GPENCIL_OT_link_brush_to_gp_tool_wheel) | ||
bpy.utils.unregister_class(tool_wheel_operator.GPENCIL_OT_tool_wheel) | ||
|
||
# Remove hotkey | ||
preferences.remove_hotkey_of_tool_wheel() | ||
|
||
# Remove brush asset context menu item | ||
preferences.remove_brush_asset_context_menu_item() | ||
|
||
|
||
if __name__ == "__main__": | ||
register() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
bl_info = { | ||
"name": "GP Tool Wheel", | ||
"author": "Sietse Brouwer", | ||
"version": (1, 0, 6), | ||
"blender": (3, 0, 0), | ||
"description": "Extended pie menu for selecting Grease Pencil tools quickly.", | ||
"doc_url": "https://github.com/SietseB/GP-Tool-Wheel", | ||
"tracker_url": "https://github.com/SietseB/GP-Tool-Wheel/issues", | ||
"category": "3D View" | ||
} | ||
|
||
|
||
if 'bpy' in locals(): | ||
import importlib | ||
importlib.reload(preferences) | ||
importlib.reload(tool_wheel_operator) | ||
importlib.reload(tool_data) | ||
else: | ||
from . import preferences | ||
from . import tool_wheel_operator | ||
from . import tool_data | ||
|
||
import bpy | ||
|
||
|
||
# Inits | ||
def addon_init(): | ||
# Blender ready to assign hotkey? | ||
if bpy.context.window_manager.keyconfigs.active is None: | ||
# Keep interval timer alive | ||
return 0.2 | ||
|
||
# Set default preferences (when needed) | ||
preferences.set_default_preferences() | ||
|
||
# Assign hotkey to tool wheel operator | ||
preferences.assign_hotkey_to_tool_wheel() | ||
|
||
# Add brush asset context menu item | ||
preferences.add_brush_asset_context_menu_item() | ||
|
||
# Load tool icons | ||
tool_data.tool_data.get_tool_icon_textures() | ||
|
||
|
||
# Addon registration | ||
def register(): | ||
bpy.utils.register_class(preferences.GPToolWheel_PG_tool) | ||
bpy.utils.register_class(preferences.GPToolWheel_PG_mode_order) | ||
bpy.utils.register_class(preferences.GPToolWheelPreferences) | ||
bpy.utils.register_class(preferences.GPTOOLWHEEL_UL_ModeList) | ||
bpy.utils.register_class(preferences.GPTOOLWHEEL_OT_MoveItem) | ||
bpy.utils.register_class(preferences.GPTOOLWHEEL_OT_AssignHotkey) | ||
bpy.utils.register_class(preferences.GPTOOLWHEEL_OT_SavePrefDefinition) | ||
bpy.utils.register_class(preferences.GPTOOLWHEEL_OT_LoadPrefDefinition) | ||
bpy.utils.register_class(preferences.GPENCIL_OT_link_brush_to_gp_tool_wheel) | ||
bpy.utils.register_class(tool_wheel_operator.GPENCIL_OT_tool_wheel) | ||
|
||
# Delayed inits | ||
bpy.app.timers.register(addon_init, first_interval=0.2) | ||
|
||
|
||
def unregister(): | ||
bpy.utils.unregister_class(preferences.GPToolWheel_PG_tool) | ||
bpy.utils.unregister_class(preferences.GPToolWheel_PG_mode_order) | ||
bpy.utils.unregister_class(preferences.GPToolWheelPreferences) | ||
bpy.utils.unregister_class(preferences.GPTOOLWHEEL_UL_ModeList) | ||
bpy.utils.unregister_class(preferences.GPTOOLWHEEL_OT_MoveItem) | ||
bpy.utils.unregister_class(preferences.GPTOOLWHEEL_OT_AssignHotkey) | ||
bpy.utils.unregister_class(preferences.GPTOOLWHEEL_OT_SavePrefDefinition) | ||
bpy.utils.unregister_class(preferences.GPTOOLWHEEL_OT_LoadPrefDefinition) | ||
bpy.utils.unregister_class(preferences.GPENCIL_OT_link_brush_to_gp_tool_wheel) | ||
bpy.utils.unregister_class(tool_wheel_operator.GPENCIL_OT_tool_wheel) | ||
|
||
# Remove hotkey | ||
preferences.remove_hotkey_of_tool_wheel() | ||
|
||
# Remove brush asset context menu item | ||
preferences.remove_brush_asset_context_menu_item() | ||
|
||
|
||
if __name__ == "__main__": | ||
register() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.