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.
This commit is contained in:
Bastien Montagne 2019-09-19 18:28:38 +02:00
parent d5af86076f
commit c06154e38a
Notes: blender-bot 2023-02-14 19:07:45 +01:00
Referenced by issue #69895, X3D Import and Export returns error on meshes with vertex colors
3 changed files with 5 additions and 5 deletions

View File

@ -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",

View File

@ -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.

View File

@ -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')