0
$\begingroup$

I have looked into batch exporting scripts and they seem to come in every format except ply. I'm having trouble understanding how to edit the template batch export script blender provides to export with proper ply properties.

I only need the script to export with vertex colors enabled, forward set to Y and up set to Z with scale at 1. How would I be able to translate that into code?

$\endgroup$

1 Answer 1

0
$\begingroup$

As stated in the template you only have to change this line

bpy.ops.export_scene.fbx(filepath=fn + ".fbx", use_selection=True)

with this line

bpy.ops.export_mesh.ply(filepath=fn + ".ply", use_selection=True, axis_forward="Y", global_scale=1, use_colors=True)

The keywords arguments can be inferred by hovering over the operator properties when you execute the operator using the UI.

First enable the python tooltips

enter image description here

Go to File > Export > ply

Hover over the field you want to tweak and note the attribute name. Here it's axis_forward.

enter image description here

If you want to know the expected value, change it using the interface and open an Info editor. The value will be written there. Don't mind the left part of the equal sign, it's garbage.

enter image description here

The operator python command can be found by hovering over the menu entry in File > Export.

enter image description here

$\endgroup$

You must log in to answer this question.

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