I am trying to export a DAE centered at the point around a selection with a Python script. When I do this manually with the export Wizard, I select "Center" to calculate the global offset. The exported file then contains information with small numbers for the float_arrays, as it appears to have been centered correctly:
<float_array id="GeometrySource2-array" count="150">-1.274902462959289 0 5.1300048828125 -0.6110070943832397 0 4.382179498672486 -0.6110070943832397 2 4.382179498672486...[etc]</float_array>
When I imitate this with the following export options through python, it does not appear that the selection is being centered. Can anyone advise me about the correct way to center a selection programmatically?
def exportDae(toExport, directory, name):
settings = DAEExportModelSettings()
settings.setOutputPath(directory)
settings.setBaseName(name)
settings.setCOLLADAVersion(colladaVersion)
settings.setCreateShapeGroups(True)
settings.setMeshGranularity("INSTANCED")
settings.setMeshGranularity("PER_MATERIAL")
position = ce.getPosition(toExport)
settings.setGlobalOffset(position)
settings.setTerrainLayers("TERRAIN_ALL_SELECTED")
settings.setFileGranularity("MEMORY_BUDGET")
settings.setExportGeometry("MODEL_GEOMETRY_FALLBACK")
settings.setExistingFiles("OVERWRITE")
settings.setShapeNameDelimiter("_")
settings.setWriteLog(True)
ce.export(toExport, settings)
This will contain float arrays with MUCH larger values, corresponding to the location of the shapefile, which indicates to me that "zeroing" my selection for the export was unsuccessful:
<float_array id="GeometrySource0-array" count="72">543176.7597654069 0 -3.281641101196114e6 543177.5401077866 0 -3.281641726548671e6 ...[etc]</float_array>
How can I implement the functionality of the "Center" button on the collada export dialogue in python?
Thanks!