Last active
January 18, 2019 14:40
-
-
Save iCyP/94312768917c943e7f5fd35fb6e4d46d to your computer and use it in GitHub Desktop.
for blender2.79
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":"Image_reloader", | |
"author": "iCyP", | |
"version": (0, 1), | |
"blender": (2, 79, 0), | |
"location": "ImageEditor->Tools", | |
"description": "image reloader", | |
"warning": "", | |
"support": "TESTING", | |
"wiki_url": "", | |
"tracker_url": "", | |
"category": "Tools" | |
} | |
class ICYP_Image_reload_all(bpy.types.Operator): | |
bl_idname = "image.reload_all" | |
bl_label = "All image reload" | |
bl_description = "all image reload" | |
bl_options = {'REGISTER'} | |
def execute(self,context): | |
for img in bpy.data.images: | |
if img.filepath != "": | |
img.reload() | |
return {"FINISHED"} | |
class ICYP_Image_reload_all_UI(bpy.types.Panel): | |
bl_space_type = 'IMAGE_EDITOR' | |
bl_region_type = "TOOLS" | |
bl_category = "IMAGE RELOAD" | |
bl_label = "All image reload" | |
@classmethod | |
def poll(cls,context): | |
return True | |
@staticmethod | |
def draw(self,context): | |
layout = self.layout | |
layout.operator("image.reload_all") | |
cls=( | |
ICYP_Image_reload_all, | |
ICYP_Image_reload_all_UI | |
) | |
def register(): | |
for c in cls: | |
bpy.utils.register_class(c) | |
def unregister(): | |
for c in cls: | |
bpy.utils.unregister_class(c) | |
if __name__ == "__main__": | |
register() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment