Driving max materials via scene controller

Hey folks - does anyone have any experience driving values in the max material editor from scene controllers?

I’ve set up sliders that are driven by my rig moving, these sliders in turn drive shader values for animated normal maps. I’d like to replicate these in the viewport.

I’ve had some success with using redrawViews callbacks, but we’re convinced there must be a neater way to do this. One of our tools programmers had a look and he tried using a transform change handler. This works, but doesn’t take the mouse movement into account - I can rotate the bone but only the first part of the rotation is passed through.

Any ideas?

Unfortunately this is a common problem with controllers. Max will update a single order of dependency, such as if you move an object in the viewport it will update any controllers that reference that object. If you parent that object to something, and move the parent (which will change the transform of the object), controllers referencing it will not update. It will update when you change time, though.

You may be able to get around this by doing some sort of robust controller update code but it will probably depend on your scene. Though I feel like I’ve tried this and it didn’t work, I can’t remember. A redrawViewsCallback is a really crappy way of doing stuff but unfortunately it is a useful ‘catch all’ for things that are otherwise impossible (we wrote an entire interactive cloth simulation and we were forced to use it for the reasons above!).

Also, I’d really avoid using transform change handlers. They only work interactively and not when setting transforms through code, and have an absurd amount of strange behaviour and bugs. You should be driving a network of controllers (as you are now).

Thanks Rob - those transform handlers were almost a waste of time entirely.

I discovered via a post on 3dTalk that the wire parameters dialogue gives access to the material editor, which is where I should have looked in the first place.