# Setting Paint Weight Tool Options Through Mel

**URL:** https://forum.highend3d.com/t/setting-paint-weight-tool-options-through-mel/2426
**Category:** Maya
**Tags:** mel
**Created:** [February 22, 2007, 8:17pm UTC](https://forum.highend3d.com/t/setting-paint-weight-tool-options-through-mel/2426 "2007-02-22T20:17:58Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![rgkovach](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/r/13edae/32.png) [@rgkovach](https://forum.highend3d.com/u/rgkovach)
#### Post date: [February 22, 2007, 8:17pm UTC](https://forum.highend3d.com/t/setting-paint-weight-tool-options-through-mel/2426/1 "2007-02-22T20:17:58Z")

</div>

I'm trying to write a simple MEL script that essentially toggles the Paint Skin Weights Tool between Add and Subtract mode by setting positive and negative values in the Value and Min/Max Value fields.

I'm running into a small glitch however while setting the Value field. The Value field can only be a number that exists between the Min and Max Values, so it follows I need to set those before I can set the Value field. However, this very simple example doesn't work.

CODE  
artAttrSkinPaintCtx -e -minvalue -1 -maxvalue 0 `currentCtx`;  
artAttrSkinPaintCtx -e -value -0.1 `currentCtx`;  
// Result: artAttrSkinContext //

The Min/Max Value fields get updated correctly, but the Value field goes to 0.  
If I run each line separately, it works.

CODE  
artAttrSkinPaintCtx -e -minvalue -1 -maxvalue 0 `currentCtx`;  
// Result: artAttrSkinContext //   
artAttrSkinPaintCtx -e -value -0.1 `currentCtx`;  
// Result: artAttrSkinContext //

Whats stumping me is why when i execute the two lines together, I get one result rather that one result for each line.
