-
-
Save zeffii/6189c3be154ad67f1592 to your computer and use it in GitHub Desktop.
test
This file contains hidden or 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() # not strictly needed | |
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