0
$\begingroup$

I have created a WRL file, that I Import into Blender with the X3D importer.

Some very strange things happen:

  1. The object does not show in the editor. But if I go to Edit Mode, it suddenly shows up, and if I go back to Object Mode it is still there.

  2. When I render the scene, I get a grey image, with no objects in it, even though there is a lamp and camera on the imported object.

I tried adding a new Material to it, with no improvement: nothing shows in the render.

Neither eevee nor cycles show anything.

What went wrong with this import? Why does it not show? The render status is enabled for the object, as can be seen in the list of objects on the right.

No errors from the importer on stdout.

The WRL is a Transform node with a single Shape, which is an IndexedFaceSet with colorPerVertex set to FALSE, and a color specified for each face. All faces are triangles.

Blender: V2.80 Beta

OS: Ubuntu

enter image description here

So I decided to try this in Blender 2.79 as well....

The first problem does not happen here: the mesh is visible in the editor, without first going to Edit Mode.

But if I render this scene:

enter image description here

I get:

enter image description here

What's up with this ghost mesh? Why is it not showing?

$\endgroup$
2

1 Answer 1

1
$\begingroup$

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
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .