[Bf-extensions-cvs] [c06154e3] master: Fix T69895: X3D Import and Export returns error on meshes with vertex colors.
Bastien Montagne
noreply at git.blender.org
Thu Sep 19 18:29:57 CEST 2019
Commit: c06154e38ac8c754f118b74befc8380b9a00e7ae
Author: Bastien Montagne
Date: Thu Sep 19 18:28:38 2019 +0200
Branches: master
https://developer.blender.org/rBAc06154e38ac8c754f118b74befc8380b9a00e7ae
Fix T69895: X3D Import and Export returns error on meshes with vertex colors.
2.8x materials don't have any indication they should use vcols anymore,
that should be handled at node-based shader level now. For now just
ignore, and always export/import active vcols.
===================================================================
M io_scene_x3d/__init__.py
M io_scene_x3d/export_x3d.py
M io_scene_x3d/import_x3d.py
===================================================================
diff --git a/io_scene_x3d/__init__.py b/io_scene_x3d/__init__.py
index 4aec9750..ee7dab6d 100644
--- a/io_scene_x3d/__init__.py
+++ b/io_scene_x3d/__init__.py
@@ -21,7 +21,7 @@
bl_info = {
"name": "Web3D X3D/VRML2 format",
"author": "Campbell Barton, Bart, Bastien Montagne, Seva Alekseyev",
- "version": (2, 2, 4),
+ "version": (2, 2, 5),
"blender": (2, 81, 6),
"location": "File > Import-Export",
"description": "Import-Export X3D, Import VRML2",
diff --git a/io_scene_x3d/export_x3d.py b/io_scene_x3d/export_x3d.py
index 2c606111..52b43931 100644
--- a/io_scene_x3d/export_x3d.py
+++ b/io_scene_x3d/export_x3d.py
@@ -583,7 +583,7 @@ def export(file,
# Py dict are sorted now, so we can use directly polygons_groups.items()
# and still get consistent reproducible outputs.
- is_col = (mesh.vertex_colors.active and (material is None or material.use_vertex_color_paint))
+ is_col = mesh.vertex_colors.active
mesh_loops_col = mesh.vertex_colors.active.data if is_col else None
# Check if vertex colors can be exported in per-vertex mode.
diff --git a/io_scene_x3d/import_x3d.py b/io_scene_x3d/import_x3d.py
index ffd1a3e0..92257211 100644
--- a/io_scene_x3d/import_x3d.py
+++ b/io_scene_x3d/import_x3d.py
@@ -2717,7 +2717,7 @@ def appearance_CreateMaterial(vrmlname, mat, ancestry, is_vcol):
bpymat.alpha = 1.0 - mat.getFieldAsFloat('transparency', 0.0, ancestry)
if bpymat.alpha < 0.999:
bpymat.use_transparency = True
- if is_vcol:
+ if False and is_vcol:
bpymat.use_vertex_color_paint = True
return bpymat
@@ -2869,10 +2869,10 @@ def appearance_Create(vrmlname, material, tex_node, ancestry, node, is_vcol):
if tex_node: # Texture caching inside there
bpyima = appearance_LoadTexture(tex_node, ancestry, node)
- if 0 & is_vcol:
+ if False and is_vcol:
bpymat.use_vertex_color_paint = True
- if 0 and bpyima:
+ if False and bpyima:
tex_has_alpha = bpyima.alpha_mode not in {'NONE', 'CHANNEL_PACKED'}
texture = bpy.data.textures.new(bpyima.name, 'IMAGE')
More information about the Bf-extensions-cvs
mailing list