Hello,
I recently watched your video about Max remoting and found it very interesting. I'm using Max 2015 and it seemed to work alright, except I've hit an issue now, converting my IObject (RObject?) to ITriObject (RTriObject?). The following code works when I load my assembly in Max. The node is of type editable mesh.
IManager manager = (IManager) Activator.GetObject((typeof (Autodesk.Max.Remoting.RManager)), "tcp://localhost:9995/Manager");
IINode node = manager.Global.COREInterface.GetSelNode(0);
IObjectState os = node.EvalWorldState(manager.Global.COREInterface.Time, true);
IObject osObj = os.Obj;
string osObjClassName = osObj.ClassName; //Editable Mesh
uint partA = osObj.ClassID.PartA; // 3830386867 (B is 0)
ITriObject obj = (ITriObject)osObj; //Unable to cast transparent proxy to type 'Autodesk.Max.ITriObject'.
So the last line where I cast osObj to ITriObject is where the exception is thrown. I've tried a few other things too:
ITriObject obj = (Autodesk.Max.Remoting.RTriObject)osObj; // Unable to cast transparent proxy to type 'Autodesk.Max.Remoting.RTriObject'.
ITriObject obj = (dynamic)osObj; // Cannot implicitly convert type 'Autodesk.Max.Remoting.RObject' to 'Autodesk.Max.ITriObject'. An explicit conversion exists (are you missing a cast?)
I also tried this with Max 2012 and it also fails. Do you have any idea what I can do here?
Thanks!
Vin