Exemple #1
0
 /// <summary>
 /// Saves selected pieces of the model from a scenario_structure_bsp tag to disk.
 /// </summary>
 /// <param name="Filename">The full path and filename to save to.</param>
 /// <param name="Cache">The CacheFile containing the scenario_structure_bsp tag.</param>
 /// <param name="Tag">The scenario_structure_bsp tag.</param>
 /// <param name="Format">The format to save the model in.</param>
 /// <param name="ClusterIndices">A List containing the indices of the scenario_structure_bsp.Clusters to save.</param>
 /// <param name="InstanceIndices">A List containing the indices of the scenario_structure_bsp.GeomInstances to save.</param>
 public static void SaveBSPParts(string Filename, CacheBase Cache, scenario_structure_bsp BSP, ModelFormat Format, List<int> ClusterIndices, List<int> InstanceIndices)
 {
     switch (Format)
     {
         case ModelFormat.OBJ:
             ModelFunctions.WriteOBJ(Filename, Cache, BSP, ClusterIndices, InstanceIndices);
             break;
         case ModelFormat.EMF:
             ModelFunctions.WriteEMF3(Filename, Cache, BSP, ClusterIndices, InstanceIndices);
             break;
         default:
             ModelFunctions.WriteAMF(Filename, Cache, BSP, ClusterIndices, InstanceIndices);
             break;
     }
 }
        /// <summary>
        /// Saves selected pieces of the model from a render_model tag to disk.
        /// </summary>
        /// <param name="Filename">The full path and filename to save to.</param>
        /// <param name="Cache">The CacheFile containing the render_model tag.</param>
        /// <param name="Tag">The render_model tag.</param>
        /// <param name="Format">The format to save the model in.</param>
        /// <param name="SplitMeshes">Whether to split the pieces into individual submeshes. Only applies when saving in EMF format.</param>
        /// <param name="PartIndices">A List containing the indices of the render_model.ModelParts to save.</param>
        public static void SaveModelParts(string Filename, CacheBase Cache, render_model Model, ModelFormat Format, List <int> PartIndices, bool SplitMeshes)
        {
            switch (Format)
            {
            case ModelFormat.EMF:
                ModelFunctions.WriteEMF3(Filename, Cache, Model, SplitMeshes, PartIndices);
                break;

            case ModelFormat.JMS:
                ModelFunctions.WriteJMS(Filename, Cache, Model, PartIndices);
                break;

            case ModelFormat.OBJ:
                ModelFunctions.WriteOBJ(Filename, Cache, Model, PartIndices);
                break;

            case ModelFormat.AMF:
                ModelFunctions.WriteAMF(Filename, Cache, Model, PartIndices);
                break;
            }
        }