示例#1
0
      public static void AssemblyMain()
      {
         ProcPostStart = new GlobalDelegates.Delegate5(PostStart);

         IGlobal global = MaxInterfaces.Global;
         global.RegisterNotification(ProcPostStart, null, SystemNotificationCode.SystemStartup);
      }
示例#2
0
      public static void Stop()
      {
         if (global != null && ProcColorChanged != null)
            global.UnRegisterNotification(ProcColorChanged, null, ColorTags.TagChanged);

         global = null;
         ProcColorChanged = null;
      }
示例#3
0
 public void RegisterNodeDeletedCallback()
 {
     if (!nodeDeleteCallback)
     {
         m_NodeDeleteDelegate = new GlobalDelegates.Delegate5(this.OnNodeDeleted);
         GlobalInterface.Instance.RegisterNotification(this.m_NodeDeleteDelegate, null, SystemNotificationCode.ScenePreDeletedNode);
         nodeDeleteCallback = true;
     }
 }
示例#4
0
        public void RegisterFilePreOpen()
        {
            if (!filePreOpenCallback)
            {
                m_FilePreOpenDelegate = new GlobalDelegates.Delegate5(this.InitializeBabylonGuids);
                GlobalInterface.Instance.RegisterNotification(this.m_FilePreOpenDelegate, null, SystemNotificationCode.FilePreOpen);

                filePreOpenCallback = true;
            }
        }
示例#5
0
 public SystemNotificationAnimHandler(SystemNotificationCode code)
 {
     Timer            = new DispatcherTimer();
     Timer.Interval   = TimeSpan.FromMilliseconds(10);
     Timer.Tick      += new EventHandler(OnTimerTick);
     Handles          = new List <UIntPtr>();
     EventProc        = new GlobalDelegates.Delegate5(SystemNotification);
     NotificationCode = code;
     RegisterNotification();
 }
示例#6
0
   public static void AssemblyMain() 
   {
      appMutex = new Mutex(true, "3dsmax", out appMutexCreated);
      
      ProcPostStart = new GlobalDelegates.Delegate5(PostStart);

      MaxInterfaces.Global.RegisterNotification( ProcPostStart
                                               , null
                                               , SystemNotificationCode.SystemStartup);
   }
示例#7
0
        private void RegisterFilePostOpen()
        {
            if (!filePostOpenCallback)
            {
                m_FilePostOpenDelegate = new GlobalDelegates.Delegate5(OnFilePostOpen);
                GlobalInterface.Instance.RegisterNotification(this.m_FilePostOpenDelegate, null, SystemNotificationCode.FilePostOpen);

                filePostOpenCallback = true;
            }
        }
示例#8
0
        public void RegisterPostSceneReset()
        {
            if (!postSceneResetCallback)
            {
                m_PostSceneResetCallback = new GlobalDelegates.Delegate5(this.InitializeBabylonGuids);
                GlobalInterface.Instance.RegisterNotification(this.m_PostSceneResetCallback, null, SystemNotificationCode.PostSceneReset);

                postSceneResetCallback = true;
            }
        }
示例#9
0
   public SelectionSetMode(TreeView tree) : base(tree)
   {
      proc_NamedSelSetCreated    = new GlobalDelegates.Delegate5(this.NamedSelSetCreated);
      proc_NamedSelSetDeleted    = new GlobalDelegates.Delegate5(this.NamedSelSetDeleted);
      proc_NamedSelSetPreModify  = new GlobalDelegates.Delegate5(this.NamedSelSetPreModify);
      proc_NamedSelSetPostModify = new GlobalDelegates.Delegate5(this.NamedSelSetPostModify);
      proc_NamedSelSetRenamed    = new GlobalDelegates.Delegate5(this.NamedSelSetRenamed);

      this.allObjectsSelSet = new AllObjectsSelectionSetWrapper();
      this.Tree.DragDropHandler = new TreeViewDragDropHandler();
   }
示例#10
0
   internal static void Start()
   {
      AutoInheritProperties.classID = MaxInterfaces.Global.Class_ID.Create(CID_A, CID_B);

      ProcLayerChanged = new GlobalDelegates.Delegate5(layerChanged);
      MaxInterfaces.Global.RegisterNotification(ProcLayerChanged, null, SystemNotificationCode.NodeLayerChanged);
      
      IISceneEventManager sceneEventMgr = MaxInterfaces.Global.ISceneEventManager;
      cbObject = new LayerCallbacks();
      cbKey = sceneEventMgr.RegisterCallback(cbObject, false, 100, true);
   }
示例#11
0
   /// <summary>
   /// Initializes a new instance of the LayerMode class.
   /// </summary>
   /// <param name="tree">The TreeView control to fill.</param>
   public LayerMode(TreeView tree) : base(tree) 
   {
      LayerModeConfigurationSection configuration = OutlinerGUP.Instance.Configuration.GetSection<LayerModeConfigurationSection>("LayerMode");
      this.showGroupContents = configuration.ShowGroupContents;

      proc_LayerRenamed        = new GlobalDelegates.Delegate5(this.LayerRenamed);
      proc_LayerCreated        = new GlobalDelegates.Delegate5(this.LayerCreated);
      proc_LayerDeleted        = new GlobalDelegates.Delegate5(this.LayerDeleted);
      proc_LayerParented       = new GlobalDelegates.Delegate5(this.LayerParented);
      proc_LayerCurrentChanged = new GlobalDelegates.Delegate5(this.LayerCurrentChanged);

      this.Tree.DragDropHandler = new TreeViewDragDropHandler();
   }
示例#12
0
        public void RegisterFilePostOpen()
        {
            if (!filePostOpenCallback)
            {
                m_FilePostOpenDelegate = new GlobalDelegates.Delegate5(this.FilePostOpen);
#if MAX2015
                GlobalInterface.Instance.RegisterNotification(this.m_FilePostOpenDelegate, null, SystemNotificationCode.NodeLinked);
#else
                GlobalInterface.Instance.RegisterNotification(this.m_FilePostOpenDelegate, null, SystemNotificationCode.FilePostOpen);
#endif
                filePostOpenCallback = true;
            }
        }
示例#13
0
        public void RegisterSceneClose()
        {
            if (!sceneCloseCallback)
            {
                m_sceneCloseDelegate = new GlobalDelegates.Delegate5(this.MaxClose);
#if MAX2015
                GlobalInterface.Instance.RegisterNotification(this.m_sceneCloseDelegate, null, SystemNotificationCode.NodeLinked);
#else
                GlobalInterface.Instance.RegisterNotification(this.m_sceneCloseDelegate, null, SystemNotificationCode.SystemShutdown);
#endif

                sceneCloseCallback = true;
            }
        }
示例#14
0
        public void RegisterNodeAddedCallback()
        {
            if (!nodeAddedCallback)
            {
                m_NodeAddedDelegate = new GlobalDelegates.Delegate5(this.OnNodeAdded);
#if MAX2015
                //bug on Autodesk API  SystemNotificationCode.SceneAddedNode doesn't work for max 2015-2016
                GlobalInterface.Instance.RegisterNotification(this.m_NodeAddedDelegate, null, SystemNotificationCode.NodeLinked);
#else
                GlobalInterface.Instance.RegisterNotification(this.m_NodeAddedDelegate, null, SystemNotificationCode.SceneAddedNode);
#endif
                nodeAddedCallback = true;
            }
        }
示例#15
0
        public void RegisterOnPostSaveScene()
        {
            if (!postSceneSave)
            {
                m_PostSceneSave = new GlobalDelegates.Delegate5(this.PostSceneSave);
#if MAX2015
                GlobalInterface.Instance.RegisterNotification(this.m_PostSceneSave, null, SystemNotificationCode.NodeLinked);
#else
                GlobalInterface.Instance.RegisterNotification(this.m_PostSceneSave, null, SystemNotificationCode.FilePostSave);
#endif

                postSceneSave = true;
            }
        }
        /// <summary>
        /// This method setups all possible callbacks to handle menus add/remove in various user actions. For example,
        /// if the user changes workspaces, the entire menu bar is updated, so this handles adding it in all workspaces as switched.
        /// The drawback is that 3ds Max calls some more than once, so you get some seemingly unnecessary add/remove. But it's safer
        /// if you always want your menu present.
        /// Of course you could also call the add/remove in other conexts and callbacks depending on the 3ds max state where
        /// you need your menu to display.
        /// </summary>
        public static void SetupMenuHandlers()
        {
            var global = GlobalInterface.Instance;

            m_MenuPostLoadDelegate  = new GlobalDelegates.Delegate5(MenuPostLoadHandler);
            m_MenuPreSaveDelegate   = new GlobalDelegates.Delegate5(MenuPreSaveHandler);
            m_MenuPostSaveDelegate  = new GlobalDelegates.Delegate5(MenuPostSaveHandler);
            m_SystemStartupDelegate = new GlobalDelegates.Delegate5(MenuSystemStartupHandler);
            global.RegisterNotification(m_MenuPostLoadDelegate, null, SystemNotificationCode.CuiMenusPostLoad);
            global.RegisterNotification(m_MenuPreSaveDelegate, null, SystemNotificationCode.CuiMenusPreSave);
            global.RegisterNotification(m_MenuPostSaveDelegate, null, SystemNotificationCode.CuiMenusPostSave);

            // this will add it at startup and for some scenerios is enough. But a commercial app shuold consider above for workspace switching.
            global.RegisterNotification(m_SystemStartupDelegate, null, SystemNotificationCode.SystemStartup);
        }
示例#17
0
        public void RegisterPostSceneReset()
        {
            if (!postSceneResetCallback)
            {
                m_PostSceneResetCallback  = new GlobalDelegates.Delegate5(this.InitializeBabylonGuids);
                m_PostSceneResetCallback2 = new GlobalDelegates.Delegate5(this.ResetScene);
#if MAX2015
                GlobalInterface.Instance.RegisterNotification(this.m_PostSceneResetCallback, null, SystemNotificationCode.NodeLinked);
                GlobalInterface.Instance.RegisterNotification(this.m_PostSceneResetCallback2, null, SystemNotificationCode.NodeLinked);
#else
                GlobalInterface.Instance.RegisterNotification(this.m_PostSceneResetCallback, null, SystemNotificationCode.PostSceneReset);
                GlobalInterface.Instance.RegisterNotification(this.m_PostSceneResetCallback2, null, SystemNotificationCode.PostSceneReset);
#endif

                postSceneResetCallback = true;
            }
        }
示例#18
0
   private static void Start()
   {
      if (GroupHelpers.closeGroupHeadsCbKey == 0)
      {
         CloseGroupHeadsNodeEventCb cb = new CloseGroupHeadsNodeEventCb();
         IISceneEventManager sceneEventMgr = MaxInterfaces.Global.ISceneEventManager;
         GroupHelpers.closeGroupHeadsCbKey = sceneEventMgr.RegisterCallback(cb, false, 50, true);
      }

      if (GroupHelpers.closeDelegate == null)
      {
         GroupHelpers.closeDelegate = new GlobalDelegates.Delegate5((param, info) => MaxInterfaces.COREInterface.ClearNodeSelection(false));
         IGlobal global = MaxInterfaces.Global;
         global.RegisterNotification(closeDelegate, null, SystemNotificationCode.SystemPreNew);
         global.RegisterNotification(closeDelegate, null, SystemNotificationCode.SystemPreReset);
         global.RegisterNotification(closeDelegate, null, SystemNotificationCode.FilePreOpen);
         global.RegisterNotification(closeDelegate, null, SystemNotificationCode.FilePreSave);
      }
   }
示例#19
0
   public static void Stop()
   {
      if (GroupHelpers.closeGroupHeadsCbKey != 0)
      {
         IISceneEventManager sceneEventMgr = MaxInterfaces.Global.ISceneEventManager;
         sceneEventMgr.UnRegisterCallback(GroupHelpers.closeGroupHeadsCbKey);
         GroupHelpers.closeGroupHeadsCbKey = 0;
      }

      if (GroupHelpers.closeDelegate != null)
      {
         IGlobal global = MaxInterfaces.Global;
         global.UnRegisterNotification(closeDelegate, null, SystemNotificationCode.SystemPreNew);
         global.UnRegisterNotification(closeDelegate, null, SystemNotificationCode.SystemPreReset);
         global.UnRegisterNotification(closeDelegate, null, SystemNotificationCode.FilePreOpen);
         global.UnRegisterNotification(closeDelegate, null, SystemNotificationCode.FilePreSave);
         GroupHelpers.closeDelegate = null;
      }

      if (GroupHelpers.openedGroupHeads != null)
         GroupHelpers.openedGroupHeads.Clear();
   }
示例#20
0
   /// <summary>
   /// Initializes a new instance of the TreeMode class.
   /// </summary>
   /// <param name="tree">The TreeView control which this TreeMode operates on.</param>
   protected TreeMode(TreeView tree)
   {
      Throw.IfNull(tree, "tree");

      proc_PausePreSystemEvent = new GlobalDelegates.Delegate5(this.PausePreSystemEvent);
      proc_ResumePostSystemEvent = new GlobalDelegates.Delegate5(this.ResumePostSystemEvent);
      proc_SelectionsetChanged = new GlobalDelegates.Delegate5(this.SelectionSetChanged);
      proc_NodeRenamed = new GlobalDelegates.Delegate5(this.NodeRenamed);
      proc_LayerHiddenChanged = new GlobalDelegates.Delegate5(this.LayerHiddenChanged);
      proc_LayerFrozenChanged = new GlobalDelegates.Delegate5(this.LayerFrozenChanged);
      proc_LayerPropChanged = new GlobalDelegates.Delegate5(this.LayerPropChanged);

      this.Tree = tree;
      this.treeNodes = new Dictionary<Object, ICollection<TreeNode>>();

      this.filters = new FilterCombinator<IMaxNode>(Functor.And);
      this.filters.Filters.Add(new InvisibleNodeFilter());
      this.filters.Filters.Add(new MaxNodeFilterCombinator() { Enabled = false });
      this.filters.FilterChanged += filters_FilterChanged;

      this.Started = false;
   }
示例#21
0
        public MainWindow()
        {
            this.InitializeComponent();

            if (Application.Current != null)
            {
                Application.Current.DispatcherUnhandledException -= AssemblyFunctions.Current_DispatcherUnhandledException;
            }

            ThemeManager.AddAccent("Dark", new Uri("pack://application:,,,/MeshInspector;component/Resources/Globals.xaml"));

            Accent   accent   = ThemeManager.GetAccent("Dark");
            AppTheme appTheme = ThemeManager.GetAppTheme("BaseDark");

            ThemeManager.ChangeAppStyle(this, accent, appTheme);

            MainWindow.ms_instance = this;
            NodeManager.Initialize();

            this.m_dataGrid.ItemsSource = NodeManager.CurrentNodes;

            // attach the delegates to methods
            this.m_delSelectionSetChanged = this.OnSelectionChanged;
            this.m_delSelectedNodeRenamed = this.OnNodeRenamed;
            this.m_delNodeDeleted         = this.OnNodeDeleted;
            this.m_delSceneReset          = this.OnSceneReset;

            this.RegisterNotifications(true);
            this.HandleEvents(true);

            this.m_groupSceneUtils.DataContext = this;
            this.KeepSelectedNodes             = false;

            this.SortByName();

            this.CanInspect = false;
        }
示例#22
0
 public static void Start()
 {
    ProcColorChanged = new GlobalDelegates.Delegate5(ColorChanged);
    global = MaxInterfaces.Global;
    global.RegisterNotification(ProcColorChanged, null, ColorTags.TagChanged);
 }
示例#23
0
 public XRefMode(TreeView tree) : base(tree) 
 {
    proc_XrefSceneFlagsChanged = new GlobalDelegates.Delegate5(this.XrefSceneFlagsChanged);
    proc_XrefSceneDeleted = new GlobalDelegates.Delegate5(this.XrefSceneDeleted);
    proc_XrefObjectRecordDeleted = new GlobalDelegates.Delegate5(this.XrefObjectRecordDeleted);
 }
 public SystemNotificationObjectHandler(SystemNotificationCode code)
 {
     EventProc        = new GlobalDelegates.Delegate5(SystemNotification);
     NotificationCode = code;
     RegisterNotification();
 }