I am importing a x3d file and then exporting in obj format using this simple script

import bpy,os

bpy.ops.import_scene.x3d(filepath='field.x3d', axis_forward='Z', axis_up='Y', filter_glob="*.x3d;*.wrl")


However the resulting obj file contains the default cube! This is the x3d file:

enter image description here

This is the object file after the export: enter image description here

Why that cube appears ? Does someone know how to avoid the cube in the object file?

Thank you very much for your help!

  • $\begingroup$ Can't test so I wont answer. Most import scene operators leave the newly imported objects as selected. Most exporters have a use_selected property. Hence can deselect all, import, export selected, [remove selected] in a loop. $\endgroup$
    – batFINGER
    Commented Mar 14, 2019 at 10:33

1 Answer 1


Have a look at the outliner in your first pic, the cube is there. Just delete the cube and it will no longer be exported.

Just because it isn't on a visible layer doesn't mean it wont be exported.


You must log in to answer this question.

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