C# transform controller SetValue not working

C# transform controller SetValue not working

MehdiZangenehBar
Advocate Advocate
479 Views
1 Reply
Message 1 of 2

C# transform controller SetValue not working

MehdiZangenehBar
Advocate
Advocate

I’m trying to set value for a node’s transform controller, but not working:

using Autodesk.Max;
using System.Windows;

namespace TestLibrary
{
    public partial class TestWindow : Window
    {
        private readonly static IGlobal globalInterface = GlobalInterface.Instance;
        private readonly static IInterface coreInterface = globalInterface.COREInterface;

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            int time = coreInterface.Time;
            IINode selNode = coreInterface.GetSelNode(0);
            if (selNode == null) MessageBox.Show("Selection empty.");
            else
            {
                IMatrix3 matrix = globalInterface.Matrix3.Create(true);
                selNode.TMController.SetValue(time,matrix,true,GetSetMethod.Absolute);
                globalInterface.COREInterface.RedrawViews(time, RedrawFlags.Normal, null);
            }
        }

        public TestWindow()
        {
            InitializeComponent();
        }
    }
}
0 Likes
480 Views
1 Reply
Reply (1)
Message 2 of 2

738746223
Contributor
Contributor

g.SuspendAnimate();
g.AnimateOn();

 

//you set value code

node.SetNodeTM(t, node_tm);

 

g.ResumeAnimate();

0 Likes