diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2013-01-02 00:22:49 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2013-01-02 00:22:49 +0400 |
commit | 8c6997be41d3a391ca25ef3f94283c099124f9e7 (patch) | |
tree | 2dc7ddedbfaa94aeed5f1f909df1f1ddda65c6f1 | |
parent | 4146b91fa2051d4ad6da5f8f98302b23601d13ad (diff) |
Another fix to import image as plane, due to recent alpha refactor in blender code (thanks to meta-androcto for the report on IRC).
-rw-r--r-- | io_import_images_as_planes.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/io_import_images_as_planes.py b/io_import_images_as_planes.py index 05d535c8..5f872e12 100644 --- a/io_import_images_as_planes.py +++ b/io_import_images_as_planes.py @@ -247,8 +247,9 @@ class IMPORT_OT_image_to_plane(Operator, AddObjectHelper): # -------------- # Image Options. - t = bpy.types.Image.bl_rna.properties["use_premultiply"] - use_premultiply = BoolProperty(name=t.name, default=False, description=t.description) + t = bpy.types.Image.bl_rna.properties["alpha_mode"] + alpha_mode_items = tuple((e.identifier, e.name, e.description) for e in t.enum_items) + alpha_mode = EnumProperty(name=t.name, items=alpha_mode_items, default=t.default, description=t.description) t = bpy.types.IMAGE_OT_match_movie_length.bl_rna match_len = BoolProperty(name=t.name, default=True, description=t.description) @@ -285,7 +286,7 @@ class IMPORT_OT_image_to_plane(Operator, AddObjectHelper): box.label("Material Settings: (Blender)", icon='MATERIAL') box.prop(self, "use_shadeless") box.prop(self, "use_transparency") - box.prop(self, "use_premultiply") + box.prop(self, "alpha_mode") row = box.row() row.prop(self, "transparency_method", expand=True) box.prop(self, "use_transparent_shadows") @@ -453,14 +454,14 @@ class IMPORT_OT_image_to_plane(Operator, AddObjectHelper): return material def set_image_options(self, image): - image.use_premultiply = self.use_premultiply + image.alpha_mode = self.alpha_mode image.use_fields = self.use_fields if self.relative: image.filepath = bpy.path.relpath(image.filepath) def set_texture_options(self, context, texture): - texture.use_alpha = self.use_transparency + texture.image.use_alpha = self.use_transparency texture.image_user.use_auto_refresh = self.use_auto_refresh if self.match_len: ctx = context.copy() |