System Information
Operating system: Windows 10 Pro 64-bit
Graphics card: NVIDIA GeForce RTX 2070
Blender Version
Broken: 2.8+
.wrl file import does not show colors.
Working: 2.79
Short description of error
The cause of that is return in 2699th line of code in import_x3d.py which returns the method. Moreover, the color vectors need alpha value to be added.
fix:
def appearance_CreateMaterial(vrmlname, mat, ancestry, is_vcol):
bpymat = bpy.data.materials.new(vrmlname)
diff_color = mat.getFieldAsFloatTuple('diffuseColor', [0.5, 0.5, 0.5, 1], ancestry)
if(len(diff_color) == 3):
# .wrl does not have alpha, we need to add 4th element
diff_color = diff_color+[1]
bpymat.diffuse_color = diff_color
bpymat.specular_color = mat.getFieldAsFloatTuple('specularColor', [0.0, 0.0, 0.0], ancestry)
if False and is_vcol:
bpymat.use_vertex_color_paint = True
return bpymat