[Closed] Controller Callback
Do we have any callback notification mechanism for controllers? Let say I have a bezier controller and I want to get notified when value is changed or keyframe added.
when construct works for any controller…
geometry, topology, parameters… those are for sure
Um… I don’t think we can track changes to the value of the controller by using When construct. Would you please show me an example?
Actually I want to create a two-way connection between a Max controller and a WPF spinner, writing the code inside C# also would be great.So I really appreciate if you help me to know whether is it possible also in C# or not.
Thanks!
I’m thinking about using Autodesk.Max, overriding IControl set-get of the Value property.
It depends.
Change handlers are called only for user initiated events, and not for changes resulting from a change in controller values. For example, a change handler on the transform attribute of a node would be called when the user moves the node. If the position of the node is animated, and you play back the animation, the transform attribute change handler is not called
Actually I need both cases for different interactions, user Initiated and all changes.Mostly all.
Perhaps some trick, but you should explain what you are controlling and what should happen when changed.
I just created a WPF spinner and I want to create a property exactly like the built-in Max’s Spinner.controller property.
Updates are something like two-way binding in WPF. Cases are:
- Controller value change -> Spinner value update.
- User input value to spinner -> Controller value update.
- Spinner value change by code not user -> Controller will not change.
- Controller has keyframe -> spinner border will be red.
in general case you can’t make the true connection of a max controller and a wpf ui controller.
in other case you have to rewrite a lot of system base classes
you can write your own controller which will be able to send messages to a specified ui controller, but again… you can’t do it for any built-in controller
do you see any example in max UI (.net, wpf, qt, etc.) except built-in rollout controllers where a controller connected to a controller (or a subanim)? The answer is NO. Because it’s practically impossible.
the best (and only) you can do is to use all available built-in callbacks, events, and notifications (units change, time change, etc.) to update your “connected” UI control.
another why is connect a controller to a rollout control and use kindof ‘native window’, or ‘window monitor’, or system hooks to monitor messages of this rollout controls,. and update yours
And you have to understand that this ‘fake’ connection will be very slow