Example #1
0
        private void Load(string fileName)
        {
            B3DPath        = fileName;
            PathBlock.Text = fileName;
            //setup link button
            if (fileName.StartsWith(Workspace))
            {
                bool linked = AnimationDatabase.GetEntryByB3DPath(fileName.Remove(0, Workspace.Length + 1)) != null;
                if (linked)
                {
                    LinkToGLB.IsEnabled = false;
                    LinkToGLB.Content   = "Already Linked";
                }
                else
                {
                    LinkToGLB.IsEnabled = true;
                    LinkToGLB.Content   = "Link to GLB file";
                }
                LinkToGLB.Visibility = Visibility.Visible;
            }
            FileName = System.IO.Path.GetFileNameWithoutExtension(fileName);
            var obj = StinkyFile.Blitz3D.B3D.B3D_Loader.Load(fileName);

            TreeHost = new BlitzTreeVisualizer(obj.LoadedObjects, obj.RootObject);
            LoadedObjectsText.Text = "\nLoaded Objects: " + obj.LoadedObjects.Count;
            DrawTree();
        }
Example #2
0
        private void LinkToGLB_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new LinkageDialog(FileName, B3DPath, Workspace, Workspace);

            dialog.ShowDialog();
            if (dialog.DialogResult.Value)
            {
                AnimationDatabase.AddLinkage(dialog.LinkageName, dialog.B3DPath, dialog.GLBPath);
            }
        }
        private void ActivateMannequinContext(string contextName, Character character, ControllerDefinition controllerDefinition, AnimationDatabase animationDatabase)
        {
            var entity = Entity;

            var scopeContextId = controllerDefinition.FindScopeContext(contextName);

            //If the id < 0 it means it's invalid.
            if (scopeContextId < 0)
            {
                Log.Error <CharacterAnimator>("Failed to find {0} scope context id in controller definition for Entity {1}.", contextName, Entity.Name);
                return;
            }

            // Setting Scope contexts can happen at any time, and what entity or character instance we have bound to a particular scope context
            // can change during the lifetime of an action controller.
            _actionController.SetScopeContext((uint)scopeContextId, entity, character, animationDatabase);
        }
 private void Awake()
 {
     AnimDatabase = this;
 }