I’m building a dotnet form (dotnetobject “MaxCustomControls.Maxform” actually), and when I call the function that builds the form from the listener, it works fine. When I call the same exact function from a Maxscript Custom Attribute (button pressed event), it builds the form but none of the events work. I’m using dotNet.setLifetimeControl() to keep Max from garbage collecting the events, so I’m not sure what’s going on.
The events even work from the same rollout if it’s in a rollout floater that’s NOT launched from a custom attribute. But the same rollout embedded in a CA won’t hook the events up.
Has anyone ever experienced this before? Any workarounds/solutions?
I had posted a thread on the cgtalk forum last week, but I’m afraid it got lost since I had never posted there before, and had to have it approved before it posted, and by that time I think it was marked “read” for most people.
http://forums.cgsociety.org/showthread.php?f=98&t=910111.
I pretty much managed to workaround this weird issue I was experiencing with this same scripted system. I wasn’t able to addrange a bunch of dotnet controls in an array to a form, it was telling me they couldn’t be converted to System.Windows.Forms.Control, but then other controls could be added. I re-arranged some of the code and it started working, but I’m still not sure why.