Created
October 18, 2015 14:26
-
-
Save anonymous/0aa8e9f9560d185e8316 to your computer and use it in GitHub Desktop.
test
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
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