public static void Discreet3DSSaveOption() { // ExStart:Discreet3DSSaveOption // The path to the documents directory. string MyDir = RunExamples.GetDataDir(); // Initialize an object Discreet3DSSaveOptions saveOpts = new Discreet3DSSaveOptions(); // The start base for generating new name for duplicated names. saveOpts.DuplicatedNameCounterBase = 2; // The format of the duplicated counter. saveOpts.DuplicatedNameCounterFormat = "NameFormat"; // The separator between object's name and the duplicated counter. saveOpts.DuplicatedNameSeparator = "Separator"; // Allows to export cameras saveOpts.ExportCamera = true; // Allows to export light saveOpts.ExportLight = true; // Flip the coordinate system saveOpts.FlipCoordinateSystem = true; // Prefer to use gamma-corrected color if a 3ds file provides both original color and gamma-corrected color. saveOpts.GammaCorrectedColor = true; // Use high-precise color which each color channel will use 32bit float. saveOpts.HighPreciseColor = true; // Configure the look up paths to allow importer to find external dependencies. saveOpts.LookupPaths = new List<string>(new string[] {MyDir}); // Set the master scale saveOpts.MasterScale = 1; // ExEnd:Discreet3DSSaveOption }
public static void Discreet3DSSaveOption() { // ExStart:Discreet3DSSaveOption // The path to the documents directory. string dataDir = RunExamples.GetDataDir(); // Initialize an object Discreet3DSSaveOptions saveOpts = new Discreet3DSSaveOptions(); // The start base for generating new name for duplicated names. saveOpts.DuplicatedNameCounterBase = 2; // The format of the duplicated counter. saveOpts.DuplicatedNameCounterFormat = "NameFormat"; // The separator between object's name and the duplicated counter. saveOpts.DuplicatedNameSeparator = "Separator"; // Allows to export cameras saveOpts.ExportCamera = true; // Allows to export light saveOpts.ExportLight = true; // Flip the coordinate system saveOpts.FlipCoordinateSystem = true; // Prefer to use gamma-corrected color if a 3ds file provides both original color and gamma-corrected color. saveOpts.GammaCorrectedColor = true; // Use high-precise color which each color channel will use 32bit float. saveOpts.HighPreciseColor = true; // Configure the look up paths to allow importer to find external dependencies. saveOpts.LookupPaths = new List <string>(new string[] { dataDir }); // Set the master scale saveOpts.MasterScale = 1; // ExEnd:Discreet3DSSaveOption }
///<Summary> /// Convert3dToFormat method to convert 3d to other format ///</Summary> public Response Convert3dToFormat(string fileName, string folderName, string outputType) { SaveOptions saveOptions = null; bool foundSaveOption = true; bool createZip = false; switch (outputType) { case "fbx": saveOptions = new FBXSaveOptions(Aspose.ThreeD.FileFormat.FBX7500Binary); break; case "obj": saveOptions = new ObjSaveOptions(); break; case "3ds": saveOptions = new Discreet3DSSaveOptions(); break; case "drc": saveOptions = new DracoSaveOptions(); break; case "amf": saveOptions = new AMFSaveOptions(); break; case "rvm": saveOptions = new RvmSaveOptions(); break; case "dae": saveOptions = new ColladaSaveOptions(); break; case "gltf": saveOptions = new GLTFSaveOptions(FileContentType.ASCII); createZip = true; break; case "glb": saveOptions = new GLTFSaveOptions(FileContentType.Binary); break; case "pdf": saveOptions = new PdfSaveOptions(); break; case "html": saveOptions = new HTML5SaveOptions(); createZip = true; break; case "ply": saveOptions = new PlySaveOptions(); break; case "stl": saveOptions = new STLSaveOptions(); break; case "u3d": saveOptions = new U3DSaveOptions(); break; case "att": RvmSaveOptions att = new RvmSaveOptions(); att.ExportAttributes = true; saveOptions = att; break; default: foundSaveOption = false; break; } if (foundSaveOption) { return(ProcessTask(fileName, folderName, "." + outputType, createZip, false, delegate(string inFilePath, string outPath, string zipOutFolder) { Scene scene = new Scene(inFilePath); scene.Save(outPath, saveOptions); })); } else { return(new Response { FileName = null, Status = "Output type not found", StatusCode = 500 }); } }