Skip to content

Commit

Permalink
Fixes error of trying to access user preferences before they are avai…
Browse files Browse the repository at this point in the history
…lable
  • Loading branch information
RayMairlot committed Jun 9, 2017
1 parent 1ef61eb commit c86c76e
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions timecode.py
Expand Up @@ -320,16 +320,9 @@ def register():
bpy.utils.register_class(TimecodePreferences)
bpy.types.Scene.timecode = bpy.props.PointerProperty(type=TimecodeProperties)
bpy.app.handlers.frame_change_post.append(timecodeUpdate)

preferences = bpy.context.user_preferences.addons['timecode'].preferences

if preferences.display_in_3d_view:

handle = bpy.types.SpaceView3D.draw_handler_add(drawTimecode, (), 'WINDOW', 'POST_PIXEL')

if preferences.display_in_header:

bpy.types.TIME_HT_header.append(TimecodeMenu)
handle = bpy.types.SpaceView3D.draw_handler_add(drawTimecode, (), 'WINDOW', 'POST_PIXEL')
bpy.types.TIME_HT_header.append(TimecodeMenu)



Expand Down

0 comments on commit c86c76e

Please sign in to comment.