Open mattngc opened 3 weeks ago
@mattngc, what about passing as argument a node object defining the coordinate system you want the coordinates in? Default value could be local coordinates for backwards compatibility.
Yeah, agree it should default to local coordinates for backwards compaitibility. But the mesh already has a transform applied to it (effectively its own Node), we just need a toggle to include that transform. For example
def export_obj(mesh, filename, include_transform=False)
This would give the current behaviour for backwards compatibility but allow you to include the Node transform with a toggle.
Yeah, agree it should default to local coordinates for backwards compaitibility. But the mesh already has a transform applied to it (effectively its own Node), we just need a toggle to include that transform. For example
def export_obj(mesh, filename, include_transform=False)
This would give the current behaviour for backwards compatibility but allow you to include the Node transform with a toggle.
I think, passing the Node
only should be enough:
def export_obj(mesh, filename, node=None)
If the node is not specified, then no transformation is applied. Passing a parent node will apply the local transformation to the parent node, passing a root node will apply the transformation to global coordinates.
@vsnever , this is exactly what I meant. It would give you the freedom to select the coordinate system you want to export in.
Got it, ok. That makes sense I think.
The "export_obj()" function and related mesh export functions are useful for debugging scenes and viewing them in Meshlab or similar. I recently noticed in a use case that the export defaults to local mesh coordiantes. This is a bit unhelpful when trying to debug a scene where the mesh has a translation/rotation applied to it. Would be great if there is a toggle/flag that let's you set the export as happening in global coordinates instead. This fix is fairly simple.