From d1fe2d0dce43fd1e16d2683dc4541b2e4e78065e Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel <brechtvanlommel@gmail.com> Date: Mon, 20 May 2019 08:28:29 +0200 Subject: [PATCH] Fix T64853: FBX fail to export after recent changes --- io_import_gimp_image_to_scene.py | 2 +- io_import_images_as_planes.py | 2 +- io_scene_fbx/export_fbx_bin.py | 2 +- io_scene_x3d/import_x3d.py | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/io_import_gimp_image_to_scene.py b/io_import_gimp_image_to_scene.py index 60e10fac5..f967caaac 100644 --- a/io_import_gimp_image_to_scene.py +++ b/io_import_gimp_image_to_scene.py @@ -395,7 +395,7 @@ def main(report, File, Path, LayerViewers, MixerViewers, LayerOffset, Img = bpy.data.images.new(NameShort+'_A', 128, 128) Img.source = 'FILE' - Img.alpha_mode = 'IGNORE' + Img.alpha_mode = 'NONE' Img.filepath = '%s%s_A%s' % (PathSaveRaw, Name, ExtSave) Tex.image = Img diff --git a/io_import_images_as_planes.py b/io_import_images_as_planes.py index d610bff5d..bed61ce3f 100644 --- a/io_import_images_as_planes.py +++ b/io_import_images_as_planes.py @@ -939,7 +939,7 @@ class IMPORT_IMAGE_OT_to_plane(Operator, AddObjectHelper): def apply_image_options(self, image): if self.use_transparency == False: - image.alpha_mode = 'IGNORE' + image.alpha_mode = 'NONE' else: image.alpha_mode = self.alpha_mode diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py index ef2c8d54a..915dda16c 100644 --- a/io_scene_fbx/export_fbx_bin.py +++ b/io_scene_fbx/export_fbx_bin.py @@ -1336,7 +1336,7 @@ def fbx_data_texture_file_elements(root, blender_tex_key, scene_data): elem_data_single_string_unicode(fbx_tex, b"RelativeFilename", fname_rel) alpha_source = 0 # None - if img.alpha_mode != 'IGNORE': + if img.alpha_mode != 'NONE': # ~ if tex.texture.use_calculate_alpha: # ~ alpha_source = 1 # RGBIntensity as alpha. # ~ else: diff --git a/io_scene_x3d/import_x3d.py b/io_scene_x3d/import_x3d.py index a843a7506..e2f79ad0c 100644 --- a/io_scene_x3d/import_x3d.py +++ b/io_scene_x3d/import_x3d.py @@ -2775,7 +2775,7 @@ def appearance_LoadImageTexture(imageTexture, ancestry, node): # as transparent. Need alpha channel. if bpyima.depth not in {32, 128}: - bpyima.alpha_mode = 'IGNORE' + bpyima.alpha_mode = 'NONE' return bpyima @@ -2823,7 +2823,7 @@ def appearance_LoadTexture(tex_node, ancestry, node): def appearance_ExpandCachedMaterial(bpymat): if 0 and bpymat.texture_slots[0] is not None: bpyima = bpymat.texture_slots[0].texture.image - tex_has_alpha = bpyima.alpha_mode not in {'IGNORE', 'CHANNEL_PACKED'} + tex_has_alpha = bpyima.alpha_mode not in {'NONE', 'CHANNEL_PACKED'} return (bpymat, bpyima, tex_has_alpha) return (bpymat, None, False) @@ -2862,7 +2862,7 @@ def appearance_Create(vrmlname, material, tex_node, ancestry, node, is_vcol): bpymat.use_vertex_color_paint = True if 0 and bpyima: - tex_has_alpha = bpyima.alpha_mode not in {'IGNORE', 'CHANNEL_PACKED'} + tex_has_alpha = bpyima.alpha_mode not in {'NONE', 'CHANNEL_PACKED'} texture = bpy.data.textures.new(bpyima.name, 'IMAGE') texture.image = bpyima @@ -2973,7 +2973,7 @@ def appearance_LoadPixelTexture(pixelTexture, ancestry): bpyima = bpy.data.images.new("PixelTexture", w, h, has_alpha, True) if not has_alpha: - bpyima.alpha_mode = 'IGNORE' + bpyima.alpha_mode = 'NONE' # Conditional above the loop, for performance if plane_count == 3: # RGB -- GitLab