Skip to content

Commit

Permalink
-Changed a bit the code for the fix on the gizmo error that could mak…
Browse files Browse the repository at this point in the history
…e the bar color to stay on after animOffset is off
  • Loading branch information
aresdevo committed Feb 15, 2022
1 parent 9e24e91 commit a67f99f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"name": "AnimAide",
"description": "Helpful tools to manipulate keys on f-curves",
"author": "Ares Deveaux",
"version": (1, 0, 37),
"version": (1, 0, 37_1),
"blender": (2, 92, 0),
"location": "Graph Editor - Dope Sheet - Timeline - 3D View - sidebar and menu bar",
"warning": "This addon is still in development.",
Expand Down
3 changes: 0 additions & 3 deletions anim_offset/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ def execute(self, context):

if support.magnet_handlers not in bpy.app.handlers.depsgraph_update_post:
bpy.app.handlers.depsgraph_update_post.append(support.magnet_handlers)
utils.set_bar_color(0.5, 0.3, 0.2, 1)
utils.add_message(self.message)

# anim_offset_info = bpy.types.SpaceView3D.draw_handler_add(
Expand Down Expand Up @@ -136,7 +135,6 @@ def execute(self, context):

if support.magnet_handlers in bpy.app.handlers.depsgraph_update_post:
bpy.app.handlers.depsgraph_update_post.remove(support.magnet_handlers)
utils.reset_bar_color()
utils.remove_message()

scene = context.scene
Expand Down Expand Up @@ -424,7 +422,6 @@ def invoke(self, context, event):
anim_offset.user_scene_auto = scene.tool_settings.use_keyframe_insert_auto
support.store_user_timeline_ranges(context)
bpy.app.handlers.depsgraph_update_post.append(support.magnet_handlers)
utils.set_bar_color(0.5, 0.3, 0.2, 1)
utils.add_message(self.message)

scene.tool_settings.use_keyframe_insert_auto = False
Expand Down
2 changes: 2 additions & 0 deletions utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ def draw_text_callback(info):
blf.draw(font_id, info)

if text_handle is None:
set_bar_color(0.5, 0.3, 0.2, 1)
text_handle = bpy.types.SpaceView3D.draw_handler_add(
draw_text_callback, (message,),
'WINDOW', 'POST_PIXEL')
Expand All @@ -212,5 +213,6 @@ def draw_text_callback(info):
def remove_message():
global text_handle

reset_bar_color()
bpy.types.SpaceView3D.draw_handler_remove(text_handle, 'WINDOW')
text_handle = None

0 comments on commit a67f99f

Please sign in to comment.