# ScriptJob when changing active uv-set

**URL:** https://forum.highend3d.com/t/scriptjob-when-changing-active-uv-set/4449
**Category:** Maya
**Tags:** mel
**Created:** [April 14, 2004, 1:19pm UTC](https://forum.highend3d.com/t/scriptjob-when-changing-active-uv-set/4449 "2004-04-14T13:19:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![wix](https://forum.highend3d.com/user_avatar/forum.highend3d.com/wix/32/54734_2.png) [@wix](https://forum.highend3d.com/u/wix)
#### Post date: [April 14, 2004, 1:19pm UTC](https://forum.highend3d.com/t/scriptjob-when-changing-active-uv-set/4449/1 "2004-04-14T13:19:39Z")

</div>

Hey guys!

Is there a way to setup a scriptJob for when the active uvSet is changed? Or some other way to call a proc when the user selects a different uv-set?

cheers!

---

<div class="post-metadata">

### Author: ![warpcat](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/w/c89c15/32.png) [@warpcat](https://forum.highend3d.com/u/warpcat)
#### Post date: [April 20, 2004, 11:20pm UTC](https://forum.highend3d.com/t/scriptjob-when-changing-active-uv-set/4449/2 "2004-04-20T23:20:08Z")

</div>

sure. You write some proc that says:

global proc UVsetPicked  
{  
if(selection = "mySetsName")  
 run "myProc"  
}

myProc is another procedure that does whatever it is you want to do.

The scriptjob would then be:

scriptJob -kws -e "SelectionChanged" UVsetPicked;

Note that this means that the scriptjob will run whenever you pick ANYTHING, but it should be really quick, and not impact anything. I've used something similar for years and not seen any performance hit

---

<div class="post-metadata">

### Author: ![sboy](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/s/ac8455/32.png) [@sboy](https://forum.highend3d.com/u/sboy)
#### Post date: [April 20, 2004, 11:50pm UTC](https://forum.highend3d.com/t/scriptjob-when-changing-active-uv-set/4449/3 "2004-04-20T23:50:30Z")

</div>

Hey Warpcat...

Did you have success using the "SelectionChanged" event when switching UV sets? I couldn't get it to trigger. Don't know if I was doing something wrong or not?

Thanks!

Shawn

---

<div class="post-metadata">

### Author: ![warpcat](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/w/c89c15/32.png) [@warpcat](https://forum.highend3d.com/u/warpcat)
#### Post date: [April 20, 2004, 11:54pm UTC](https://forum.highend3d.com/t/scriptjob-when-changing-active-uv-set/4449/4 "2004-04-20T23:54:37Z")

</div>

well, I didn't actually try the code with UV sets, just basing it on an example I use (when picking objects in the scene). However, I realize that it won't execute when changing UV sets. The code will execute if you physically select the UV set node though. I think I misinterpreted the original post. D'oh!
