Questions and discussion for this lecture live here. Fire away by hitting Reply below ![]()
Hi Sean, I have noticed that it’s far too easy to forget to merge nodes and apply transformations before exporting our model. In the exporting script after imports, we can just add the following lines so that we don’t have to remember to perform those operations manually.
previous_mode = bpy.context.object.mode
if bpy.context.object.mode != 'EDIT':
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_all(action = 'SELECT')
bpy.ops.mesh.remove_doubles()
bpy.ops.mesh.select_all(action='DESELECT')
if bpy.context.mode != 'OBJECT':
bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.transform_apply(location = True, rotation = True, scale = True)
bpy.ops.object.mode_set(mode=previous_mode)
Nice work @Oliviero ![]()
Seán
1 Like
Hi Dr Sean,
I noticed that my csv files had blank rows in between the data lines after running the script. After some research I found that adding “newline=’ '” as follows “with open(filename, ‘w’, newline=‘’) as csvfile:” fixed my issue.
Regards,
Kabo
1 Like