Esempio n. 1
0
        void SetFieldsFromInfo(AnimationGroup info)
        {
            if (info != null)
            {
                nameTextBox.Enabled  = true;
                startTextBox.Enabled = true;
                endTextBox.Enabled   = true;
                nameTextBox.Text     = info.Name.ToString();
                startTextBox.Text    = info.FrameStart.ToString();
                endTextBox.Text      = info.FrameEnd.ToString();

                // a color can still be red after setting the string:
                // possible if we change a name, don't confirm and switch to another item with the same name
                ResetChangedTextBoxColors();

                MaxNodeTree.BeginUpdate();
                //here we garanty retrocompatibility
                MaxNodeTree.QueueSetNodes(info.NodeGuids.ToHandles(), false);
                List <uint> handles;
                MaxNodeTree.ApplyQueuedChanges(out handles, false);
                MaxNodeTree.EndUpdate();

                // if the nodes changed on max' side, even though the data has not changed, the list may be different (e.g. deleted nodes)
                // since we haven't loaded the list before, we can't compare it to the node tree
                // thus, we save it, and the property checks for actual differences (and set isdirty to true)
                info.NodeGuids = handles.ToGuids();

                if (info.IsDirty)
                {
                    InfoChanged?.Invoke(info);
                }
            }
            else
            {
                nameTextBox.Enabled  = false;
                startTextBox.Enabled = false;
                endTextBox.Enabled   = false;
                nameTextBox.Text     = "";
                startTextBox.Text    = "";
                endTextBox.Text      = "";

                MaxNodeTree.BeginUpdate();
                MaxNodeTree.QueueSetNodes(null, false);
                List <uint> handles;
                MaxNodeTree.ApplyQueuedChanges(out handles, false);
                MaxNodeTree.EndUpdate();
            }
        }
Esempio n. 2
0
        void SetFieldsFromInfo(AnimationGroup info)
        {
            if (info != null)
            {
                nameTextBox.Enabled  = true;
                startTextBox.Enabled = true;
                endTextBox.Enabled   = true;
                nameTextBox.Text     = info.Name.ToString();
                startTextBox.Text    = info.FrameStart.ToString();
                endTextBox.Text      = info.FrameEnd.ToString();

                MaxNodeTree.BeginUpdate();
                MaxNodeTree.QueueSetNodes(info.NodeHandles, false);
                MaxNodeTree.ApplyQueuedChanges(out List <uint> handles, false);
                MaxNodeTree.EndUpdate();

                // if the nodes changed on max' side, even though the data has not changed, the list may be different (e.g. deleted nodes)
                // since we haven't loaded the list before, we can't compare it to the node tree
                // thus, we save it, and the property checks for actual differences (and set isdirty to true)
                info.NodeHandles = handles;

                if (info.IsDirty)
                {
                    InfoChanged?.Invoke(info);
                }
            }
            else
            {
                nameTextBox.Enabled  = false;
                startTextBox.Enabled = false;
                endTextBox.Enabled   = false;
                nameTextBox.Text     = "";
                startTextBox.Text    = "";
                endTextBox.Text      = "";

                MaxNodeTree.BeginUpdate();
                MaxNodeTree.QueueSetNodes(null, false);
                MaxNodeTree.ApplyQueuedChanges(out List <uint> handles, false);
                MaxNodeTree.EndUpdate();
            }
        }