I'm not sure where to start - I've set up sliders that are driven from 0-1 based on the animations running on my rig, but I'd also like to pump those slider values into spinners in the material editor.

Are callbacks the way to go?

denisT

09 September 2009, 12:11 AM

I'm not sure where to start - I've set up sliders that are driven from 0-1 based on the animations running on my rig, but I'd also like to pump those slider values into spinners in the material editor.

Are callbacks the way to go?

do you want to change some material parameters with your spinners?
could you explain what you want to do a little clear?

Rick Stirling

09 September 2009, 07:15 AM

I want to change material editor spinner strengths with the sliders that I constructed in the viewport. My primary use for this is to control normal map blending for animated normals.

The sliders are simply circle shapes inside a rectangle that move between 0 to 1 in parent space.

Rick Stirling

09 September 2009, 03:37 PM

I've had some success with this - I have it working, but it's not pretty.

I was using registerRedrawViewsCallback to run a function that updated the specular value in a shader in the material editor, but a redrawview callback seems very ugly.

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.

One other thing that I noticed is that viewport effect of the shader changing (when I was using the screenredraw callback) only happened when the material editor was open - this may or may not be down to our custom shaders, or perhaps it's a max optimisation.

magicm

09 September 2009, 05:32 PM

Maybe I'm misunderstanding the question, but couldn't you just link the slider to the parameter by wiring it, or using a script controller?

I dont want to send max file so this maxscript should do:
1.line create box assign material from material editor slot 1
2.line create slider
3.line wire slider value to material propertie -specular level (wire it to your blending strenght)
If I have done it right then object material and material in material editor are reacting to slider.

Rick Stirling

09 September 2009, 05:48 PM

MagicM, Stefan - thanks so much! I'd not checked the Wireparameters, and indeed you can link up to the shader values. That's probably the answer.

Unfortunately at the minute our custom shader has no wireparameter material editor hook for the specular inputs, only offsets, but I'll see if they can add that.

Thanks again, hopefully this is what we were after.

CGTalk Moderation

09 September 2009, 05:48 PM

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.

Follow Us On:

The CGSociety

The CGSociety is the most respected and accessible global organization for creative digital artists. The CGS supports artists at every level by offering a range of services to connect, inform, educate and promote digital artists worldwide. More about us on TheArtSociety.com