Esistono diversi overload del metodo Scene.save che accettano un’istanza SaveOptions. Questa dovrebbe essere un’istanza di una classe derivata dalla classe SaveOptions. Ogni formato di salvataggio ha una classe corrispondente che contiene le opzioni di salvataggio per quel formato di salvataggio, ad esempio c' è ColladaSaveOptions per il formato di salvataggio FileFormat.COLLADA.
Utilizzo di Collada Opzioni di salvataggio
Il codice seguente mostra come impostare le opzioni di salvataggio prima di salvare un file 3D in formato Collada.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Il codice seguente mostra come impostare le opzioni di salvataggio prima di salvare un file 3D in un formato Discreet 3DS.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Il codice seguente mostra come impostare le opzioni di salvataggio prima di salvare un file 3D in un formato FBX.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Il codice seguente mostra come impostare le opzioni di salvataggio prima di salvare un file 3D in un formato Obj.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Il codice seguente mostra come impostare le opzioni di salvataggio prima di salvare un file 3D in formato STL.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Il codice seguente mostra come impostare le opzioni di salvataggio prima di salvare un documento in formato U3D.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Questa funzione è supportata dalla versione 19.8 o maggiore.
Il codice seguente mostra come impostare le opzioni di salvataggio prima di salvare un documento in formato glTF.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scene.getRootNode().createChildNode("sphere", new Sphere());
// Set glTF saving options. The code example embeds all assets into the target file usually a glTF file comes with some dependencies, a bin file for model's vertex/indices, two .glsl files for vertex/fragment shaders
// Use opt.EmbedAssets to tells the Aspose.3D API to export scene and embed the dependencies inside the target file.
GLTFSaveOptions opt = new GLTFSaveOptions(FileContentType.ASCII);
opt.setEmbedAssets(true);
// Use KHR_materials_common extension to define the material, thus no GLSL files are generated.
opt.setUseCommonMaterials(true);
// Customize the name of the buffer file which defines model
È inoltre possibile utilizzare il metodo setPrettyPrint della classe GLTFSaveOptions per la stampa JSON comprensibile per l’uomo. Il codice seguente mostra come utilizzare questa funzionalità.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Salva le dipendenze di una scena 3D nel file system reale
Gli sviluppatori potrebbero richiedere di salvare tutte le dipendenze della scena 3D nel file system reale. Possono definire il percorso di una directory locale, salvare nell’oggetto MemoryFileSystem o semplicemente scartare le dipendenze. La proprietà FileSystem viene aggiunta nelle classi di tutte le opzioni di salvataggio.
Scartare il salvataggio dei file materiali
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Salvare le dipendenze nell’istanza MemoryFileSystem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Utilizzo delle opzioni di salvataggio Google Draco (.DRC)
Il codice seguente mostra come impostare le opzioni di salvataggio prima di salvare un modello 3D in formato DRC.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Il codice seguente mostra come impostare le opzioni di salvataggio prima di salvare un modello 3D in formato RVM.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters