Example #1
0
        public static H3D IdentifyAndOpen(string FileName, H3DDict <H3DBone> Skeleton = null)
        {
            H3D Output = null;

            using (FileStream FS = new FileStream(FileName, FileMode.Open)){
                Output = IdentifyAndOpen(FS, Skeleton);
            }

            if (Output == null)
            {
                Output = FormatIdentifier.IdentifyAndOpen(FileName, Skeleton);
            }

            return(Output);
        }
Example #2
0
        public static H3D Merge(string[] FileNames, Renderer Renderer, H3D Scene = null)
        {
            if (Scene == null)
            {
                //Renderer.DeleteAll();

                Scene = new H3D();
            }

            int OpenFiles = 0;

            using (FrmLoading Form = new FrmLoading(FileNames.Length))
                foreach (string FileName in FileNames)
                {
                    Form.Proceed(FileName);

                    H3DDict <H3DBone> Skeleton = null;

                    if (Scene.Models.Count > 0)
                    {
                        Skeleton = Scene.Models[0].Skeleton;
                    }

                    H3D Data = FormatIdentifier.IdentifyAndOpen(FileName, Skeleton);

                    if (Data != null)
                    {
                        Scene.Merge(Data);

                        Renderer.Merge(Data);

                        OpenFiles++;
                    }
                }

            if (OpenFiles == 0)
            {
                MessageBox.Show(
                    "Unsupported file format!",
                    "Can't open file!",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Exclamation);
            }

            return(Scene);
        }
Example #3
0
        public static H3D Merge(string[] FileNames, Renderer Renderer, H3D Scene = null)
        {
            int OpenFiles = 0;

            foreach (string FileName in FileNames)
            {
                H3DDict <H3DBone> Skeleton = null;

                if (Scene != null && Scene.Models.Count > 0)
                {
                    Skeleton = Scene.Models[0].Skeleton;
                }

                H3D Data = FormatIdentifier.IdentifyAndOpen(FileName, Skeleton);

                if (Data != null)
                {
                    if (Scene == null)
                    {
                        Scene = Data;
                    }
                    else
                    {
                        Scene.Merge(Data);
                    }

                    Renderer.Merge(Data);

                    OpenFiles++;
                }
            }

            if (OpenFiles == 0)
            {
                MessageBox.Show(
                    "Unsupported file format!",
                    "Can't open file!",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Exclamation);
            }

            return(Scene);
        }
Example #4
0
        public static H3D Merge(string[] FileNames, Renderer Renderer, H3D Scene = null)
        {
            if (Scene == null)
            {
                //Renderer.DeleteAll();

                Scene = new H3D();
            }

            int OpenFiles = 0;

            foreach (string FileName in FileNames)
            {
                H3DDict <H3DBone> Skeleton = null;

                if (Scene.Models.Count > 0)
                {
                    Skeleton = Scene.Models[0].Skeleton;
                }

                H3D Data = FormatIdentifier.IdentifyAndOpen(FileName, Skeleton);

                if (Data != null)
                {
                    Scene.Merge(Data);

                    Renderer.Merge(Data);

                    OpenFiles++;
                }
            }
            // string[] names =
            // {
            //     "FightingAction1",
            //     "FightingAction2",
            //     "FightingAction4",
            //     "FightingAction5",
            //     "FightingAction6",
            //     "FightingAction9",
            //     "FightingAction13",
            //     "FightingAction17",
            //     "FightingAction18",
            //     "PetAction1-Pose",
            //     "PetAction5-Falling Asleep",
            //     "PetAction6-Sleepy",
            //     "PetAction7-Sleepy Awaken",
            //     "PetAction8-Sleeping",
            //     "PetAction9-Awaken",
            //     "PetAction10-Refuse",
            //     "PetAction12-Agree",
            //     "PetAction13-Happy",
            //     "PetAction14-Very Happy",
            //     "PetAction15-Look Around",
            //     "PetAction17-Comfortable",
            //     "PetAction19-Sad",
            //     "PetAction20-Salutate",
            //     "PetAction22-Angry",
            //     "PetAction23-Begin Eating",
            //     "PetAction24-Eating",
            //     "PetAction25-Eating Finished",
            //     "PetAction26-No Eating",
            //     "MapAction1",
            //     "MapAction3",
            //     "MapAction4"
            // };
            // for (var i = 0; i < Scene.SkeletalAnimations.Count; i++)
            // {
            //     Scene.SkeletalAnimations[i].Name = names[i];
            // }

            if (OpenFiles == 0)
            {
                MessageBox.Show(
                    "Unsupported file format!",
                    "Can't open file!",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Exclamation);
            }

            return(Scene);
        }