diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2019-09-19 19:28:38 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2019-09-19 19:28:38 +0300 |
commit | c06154e38ac8c754f118b74befc8380b9a00e7ae (patch) | |
tree | a5cee03514bdaff4e181aa5dcfe1f6ba912d0b01 /io_scene_x3d | |
parent | d5af86076fd411724e631243e430125ddb840c3c (diff) |
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.
Diffstat (limited to 'io_scene_x3d')
-rw-r--r-- | io_scene_x3d/__init__.py | 2 | ||||
-rw-r--r-- | io_scene_x3d/export_x3d.py | 2 | ||||
-rw-r--r-- | io_scene_x3d/import_x3d.py | 6 |
3 files changed, 5 insertions, 5 deletions
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') |