What is the common way for incrementing/decrementing one or more attributes that belong to a common node?

So I have been experimenting with draggerContext, a simple command, that can be used to for example increment or decrement a value repeatedly as the user drags left or right.
I really like to this kind of utility and so I want to build a few of them, all in the same vain; increment or decrement one or more attribute values.

I am now trying to wrap my head head around a common generic, and even, efficient ways of doing implementing section, that is the “get the attribute value and then set attribute value”.

Speaking from a point of view of someone that has little experience with Maya programming conventions, are getAttr and setAttr the way forward here? Just from pure speculation, I am thinking that since I am dealing with high a fidelity control (mouse movements) there could be slow downs, since I would need to getAttr, then setArr for every potential attribute.

Am on Maya 2026. Thank you for any sight or help.

does dragAttrContext not do what you need? it seems like draggerContext, but for attributes.

Also, the behavior you describe is already available in the channel box for the default attrs. Select 1 or more attrs and MMB drag. Not sure if you are aware (I wasn’t, for years)

1 Like

dragAttrContext alsmost gave me what I needed, I could adjust multiple attributes with it and recall it as needed, but sadly it does not respect the channels box’s “speed” setting, the middle icon shown on the top right corner of the channel box.

it seems once dragAttrContext context is defined, it has nothing to do with the channel box.

In any case, the peformance concern I had with the getAttr/SetAttr did not bear out. I pllaning to design a method of adjusting attributes using hardware such as a hyperscroll wheel, shuttle whel, etc. But surprisingly enough Maya kept up…

Thanks for the help Mambo4.