Skip to content

Instantly share code, notes, and snippets.

Created October 18, 2015 14:26
Show Gist options
  • Save anonymous/0aa8e9f9560d185e8316 to your computer and use it in GitHub Desktop.
Save anonymous/0aa8e9f9560d185e8316 to your computer and use it in GitHub Desktop.
test
import bpy
bl_info = {
"name": "Refresh Images",
"version": (0, 1),
"blender": (2, 76, 0),
"description": "Refresh images",
"category": "3D View"
}
class SimpleImageUpdater(bpy.types.Operator):
"""Tooltip"""
bl_idname = "view3d.refresh_images"
bl_label = "Image Refresher"
def execute(self, context):
for img in bpy.data.images:
img.reload()
bpy.context.scene.update()
bpy.ops.wm.redraw_timer(type='DRAW_WIN_SWAP', iterations=1)
return {'FINISHED'}
def register():
bpy.utils.register_class(SimpleImageUpdater)
def unregister():
bpy.utils.unregister_class(SimpleImageUpdater)
if __name__ == "__main__":
register()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment