import bpy frame = bpy.context.scene.frame_current #bpy.types.UserPreferencesSystem.gl_clip_alpha(0.1) def animathing(scene): def main(context): frame = bpy.context.scene.frame_current prefs = context.user_preferences.system # Want clipping to be 0 at 450, 0.1 at 550. clipping = ((float(frame) - 450) / 100.0)*0.025 print(clipping) prefs.gl_clip_alpha = float(clipping) main(bpy.context) # Run the script every time the frame has changed bpy.app.handlers.frame_change_pre.append(animathing) #main(bpy.context)