I would like to know how can I modify the location of the 3d model that I'm exporting without modifying the original one, I'm using this code:
if SceneObj.type == 'MESH':
if hasattr(SceneObj, 'data'):
#Clone Object
depsgraph = bpy.context.evaluated_depsgraph_get()
ob_for_convert = SceneObj.evaluated_get(depsgraph)
try:
MeshObject = ob_for_convert.to_mesh()
except RuntimeError:
MeshObject = None
if MeshObject is None:
continue
#Apply Rotation Matrix
MeshObject.transform(EXPORT_GLOBAL_MATRIX @ SceneObj.matrix_world)
if EXPORT_FLIP_POLYGONS:
MeshObject.flip_normals()
The idea would be that independently of the location and rotation of the original object, the exported one has the location (0,0,0) and the rotation (0,0,0), but I don't know how to do it.
This exporter I'm working on is for an external program, so all of those things must be done in the exporter.
.to_mesh()– jms2505 Feb 25 '21 at 08:44