from aspose.threed import Scene
from aspose.threed.formats import *
# Invoke the from_file method of the Scene class to open the scene from the given path.   
scene = Scene.from_file("/sample.obj")
# Create an instance of the AmfSaveOptions class.   
amfSaveOptions = AmfSaveOptions()
# The enable_compression property is used for compression to reduce the final file size, default value is true.
amfSaveOptions.enable_compression = True
# The encoding property sets the default encoding for text-based files. 
amfSaveOptions.encoding = ""
# Invoke the save method to save the file in AMF file format. 
scene.save("/output_out.amf", amfSaveOptions)