SDK-C# Set transform controller value


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.");
                IMatrix3 matrix = globalInterface.Matrix3.Create(true);
                globalInterface.COREInterface.RedrawViews(time, RedrawFlags.Normal, null);

        public TestWindow()

What is wrong in my code?


have you tried…

selNode.SetNodeTM(time, matrix);


otherwise you need to know what controller you are going to be dealing with usually a PRS so you have to deal with the sub controllers e.g.

Control *c;
c = node->GetTMController()->GetPositionController();

I think the setvalue above would only work if you were using a dedicated tm controller


I want to save and load a pose for the entire rig, it may be biped or cat or max bones. SetNodeTM works globally, I need the local one. I’m just wondering why SetValue for the transform controller doesn’t work.


try the c# version of this…

SetXFormPacket pckt(destTM);
tmControl->SetValue(ip->GetTime(), &pckt);