Point3Controller as IControl

 
 
 
Posted by:Vincentt
Data created:17 January 2015

Hello,

 

I'm trying to animate vertex movement. I found out I need to utilize the MasterPointController and add sub controllers to it per vertex (at least that's what I think is the correct way). However I'm struggling to create the subcontrollers. They need to be of SClass_ID: 'ctrlPoint3'. So far I have this:

var newControl = m_Global.Point3Controller;
var sclassId = newControl.SclassId;

var asControlMaybe = newControl as IControl;
var asAnimatableMaybe = newControl as IAnimatable;
var toControllerMaybe = m_Global.PositionController.ToController;

But this isn't working: 'sclasId' is ctrlPoint3, so this is correct, but 'asControlMaybe' and 'asAnimatbleMaybe' are both null and 'toControllerMaybe' crashes with the following error message:

'System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.'

I need to have an IControl though to pass to 'masterPointController.AddSubController(IControl control)'

 

Is there maybe another way to create Point3controller? 
Thanks in advance,
Vin

 

 

When looking through the SDK cpp/h files I noticed a method called:

 This one doesn't seem to exist in the wrapper. Can I find it elsewhere? Or is there a different way to create one? 

 

Thanks,

Vin

It should typically be under GlobalInterface.Instance.NewDefaultPoint3Controller but that doesn't seem to be the case, strange.

Marsel Khadiyev (Software Developer, EPHERE Inc.)

Ah, I was thinking I was going crazy :)

I've checked with the Object Browser and NewDefaultPoint3Controller is nowhere to be seen. Except GlobalInterface.Instance.Point3Controller, however this gives me a IMAXSuperClass object, and I have no idea what to do with that one... 

Thanks for looking! 
Vin

Perhaps you can try coreInterface.CreateInstance(...) to instantiate the controller?

Marsel Khadiyev (Software Developer, EPHERE Inc.)