Exemplo n.º 1
0
        public virtual void OpenFile(string file, bool models = true, bool animations = true, bool etc = true)
        {
            ResourceNode node = null;

            try
            {
                if ((node = NodeFactory.FromFile(null, file)) != null)
                {
                    _openedFiles.Add(node);
                    ModelPanel.AddReference(node);

                    if (models)
                    {
                        LoadModels(node);
                    }
                    if (animations)
                    {
                        LoadAnimations(node);
                    }
                    if (etc)
                    {
                        LoadEtc(node);
                    }
                }
                else
                {
                    MessageBox.Show(this, "Unable to recognize input file.");
                }
            }
            catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error loading from file."); }
        }
Exemplo n.º 2
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            modelPanel1.ClearTargets();
            modelPanel1.AddReference(_internalModel);
            GetBaseInfluence();
        }
Exemplo n.º 3
0
        private bool LoadExternal()
        {
            dlgOpen.Filter = "All Compatible Files (*.pac, *.pcs, *.brres, *.chr0, *.srt0, *.pat0, *.vis0, *.shp0, *.scn0, *.clr0, *.mrg)|*.pac;*.pcs;*.brres;*.chr0;*.srt0;*.pat0;*.vis0;*.shp0;*.scn0;*.clr0;*.mrg";
            if (dlgOpen.ShowDialog() == DialogResult.OK)
            {
                ResourceNode node = null;
                leftPanel.listAnims.BeginUpdate();
                try
                {
                    if ((node = NodeFactory.FromFile(null, dlgOpen.FileName)) != null)
                    {
                        if (!CloseExternal())
                        {
                            return(false);
                        }

                        if (!leftPanel.LoadAnims(node, TargetAnimType))
                        {
                            MessageBox.Show(this, "No animations could be found in external file.", "Error");
                        }
                        else
                        {
                            _externalAnimationsNode = node;
                            node = null;
                            //txtExtPath.Text = Path.GetFileName(dlgOpen.FileName);

                            ModelPanel.AddReference(_externalAnimationsNode);

                            return(true);
                        }
                    }
                    else
                    {
                        MessageBox.Show(this, "Unable to recognize input file.");
                    }
                }
                catch (Exception x) { MessageBox.Show(this, x.ToString()); }
                finally
                {
                    if (node != null)
                    {
                        node.Dispose();
                    }
                    leftPanel.listAnims.EndUpdate();
                }
            }
            return(false);
        }
Exemplo n.º 4
0
 private void pnlAnim_ReferenceLoaded(ResourceNode node)
 {
     modelPanel1.AddReference(node);
 }