Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2015-10-05 19:56:33 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-10-05 19:56:33 +0300
commit2955d801d5900c7846b006dc9d44792e1515c664 (patch)
treefb8a6565c0509154f1f21508ec984c79cc90dc19 /io_import_images_as_planes.py
parent30b619e76529a5ca99f96683f1b4a512d18cd519 (diff)
Fix T46383: "Import Images as Planes" should reload image datablock before importing.
There is now an option to force reloading existing images. But main bug was elsewhere - that addon would always create new image datablocks, and yet use same (already existing) texture afterwards, that was rather bad, fixed using new 'check_existing' option of load_image helper just added to master.
Diffstat (limited to 'io_import_images_as_planes.py')
-rw-r--r--io_import_images_as_planes.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/io_import_images_as_planes.py b/io_import_images_as_planes.py
index 8e54c91b..27e8424b 100644
--- a/io_import_images_as_planes.py
+++ b/io_import_images_as_planes.py
@@ -19,8 +19,8 @@
bl_info = {
"name": "Import Images as Planes",
"author": "Florian Meyer (tstscr), mont29, matali",
- "version": (2, 0, 2),
- "blender": (2, 74, 0),
+ "version": (2, 0, 3),
+ "blender": (2, 76, 1),
"location": "File > Import > Images as Planes or Add > Mesh > Images as Planes",
"description": "Imports images and creates planes with the appropriate aspect ratio. "
"The images are mapped to the planes.",
@@ -179,6 +179,9 @@ class IMPORT_OT_image_to_plane(Operator, AddObjectHelper):
align_offset = FloatProperty(name="Offset", min=0, soft_min=0, default=0.1, description="Space between Planes")
+ force_reload = BoolProperty(name="Force Reload", default=False,
+ description="Force reloading of the image if already opened elsewhere in Blender")
+
# Callback which will update File window's filter options accordingly to extension setting.
def update_extensions(self, context):
if self.extension == DEFAULT_EXT:
@@ -269,6 +272,8 @@ class IMPORT_OT_image_to_plane(Operator, AddObjectHelper):
box.prop(self, "align_offset")
row = box.row()
+ row.prop(self, "force_reload")
+ row = box.row()
row.active = bpy.data.is_saved
row.prop(self, "relative")
box.prop(self, "match_len")
@@ -327,7 +332,8 @@ class IMPORT_OT_image_to_plane(Operator, AddObjectHelper):
engine = context.scene.render.engine
import_list, directory = self.generate_paths()
- images = tuple(load_image(path, directory) for path in import_list)
+ images = tuple(load_image(path, directory, check_existing=True, force_reload=self.force_reload)
+ for path in import_list)
for img in images:
self.set_image_options(img)