Tuesday, January 2, 2024

Set Default Tool

Hey there! I am back. First of all. Happy New Year! I hope to keep posting things. 

This post will be brief. Some times we need to set a default values for float or integer attributes on the channel box. Maya doesn't have a tool to do that, you need to do it by cmds. This is particularly useful when the default value is not 0. We can use the next command to query the default value, to reset the attribute.

dValue = mc.addAttr(source + '.' + attr, q=1,dv=1)

mc.setAttr(source + '.' +attr, dValue)

So, I built a simple tool for that. You just need to select a custom attribute float or integer and press the button. The value won't change, but internally the default value will.

The code:

I hope you find this helpful. Thanks

No comments:

Post a Comment