1
$\begingroup$

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")

bpy.ops.export_scene.obj(filepath='test.obj')

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!

$\endgroup$
  • $\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 Mar 14 at 10:33
1
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.