03-11-2021, 03:09 PM
I am loading in OBJ models and rotating them, i then export to FBX using assimp exporter, i am exporting the viewport that contains the model because if i just try to export the model the transform is not saved, this is probably down to me doing something wrong.
I have attached a screenshot of a model i have exported and loaded back in as you can see from the info it is a Model3DGroup with 3 items all i want is to export the Transformed model how can i do this?
code for exporting (VB.NET)
I have attached a screenshot of a model i have exported and loaded back in as you can see from the info it is a Model3DGroup with 3 items all i want is to export the Transformed model how can i do this?
code for exporting (VB.NET)
Code:
Private Function ExportViewport3D(ByVal fileName As String, ByVal exportFormatId As String, ByVal viewport3D As Viewport3D, ByVal namedObjects As Dictionary(Of String, Object)) As Boolean
Dim assimpWpfExporter = New AssimpWpfExporter()
Dim ModelPath As String = Path.GetDirectoryName(_fileName)
If exportFormatId = "x" Then
assimpWpfExporter.ExportFullTexturePaths = False
End If
assimpWpfExporter.NamedObjects = _namedObjects
assimpWpfExporter.AddViewport3D(_viewport3D)
Dim isExported As Boolean
Try
Dim MyFileName As String = Path.GetFileNameWithoutExtension(_fileName)
Dim MyExt As String = MyFileName & "." & _selectedExportFormatId
SFD_Export.Filter = "3D model file (*.*)|*.*"
SFD_Export.FileName = MyExt
If SFD_Export.ShowDialog = DialogResult.OK Then
isExported = assimpWpfExporter.Export(SFD_Export.FileName, exportFormatId)
ExportedFileName = SFD_Export.FileName
Else
End If
If Not isExported Then MsgBox("Asset Not exported", vbOKOnly & vbCritical, "Export Error")
Catch ex As Exception
MsgBox("Error exporting:" & vbCrLf & ex.Message, vbOKOnly & vbCritical, "Export Error")
isExported = False
Me.Close()
End Try
If isExported = True Then
MsgBox("Model exported : " + SFD_Export.FileName, vbOKOnly & vbInformation, "Export Completed")
End If
ContentVisual.Children.Remove(ContentWireframeVisual)
Return isExported
End Function
Kevan Hampson

