<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Can I script job or HUD element have more than one event to trigger it? in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/can-i-script-job-or-hud-element-have-more-than-one-event-to/m-p/12541651#M509</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4515326"&gt;@FirespriteNate&lt;/a&gt;thanks for your reply, do you know how to write that same code in Mel I'm developing a Mel script for somebody.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Feb 2024 18:21:47 GMT</pubDate>
    <dc:creator>malcolm_341</dc:creator>
    <dc:date>2024-02-05T18:21:47Z</dc:date>
    <item>
      <title>Can I script job or HUD element have more than one event to trigger it?</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/can-i-script-job-or-hud-element-have-more-than-one-event-to/m-p/12540029#M507</link>
      <description>&lt;P&gt;Hi, I'm trying to use an event to update my HUD element, the problem is I need it to update in on selection change and also update on UV set change. Is there a way to assign two events to the same HUD or script job?&lt;/P&gt;</description>
      <pubDate>Sun, 04 Feb 2024 23:55:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/can-i-script-job-or-hud-element-have-more-than-one-event-to/m-p/12540029#M507</guid>
      <dc:creator>malcolm_341</dc:creator>
      <dc:date>2024-02-04T23:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: Can I script job or HUD element have more than one event to trigger it?</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/can-i-script-job-or-hud-element-have-more-than-one-event-to/m-p/12540666#M508</link>
      <description>&lt;P&gt;I don't think a &lt;STRONG&gt;ScriptJob&lt;/STRONG&gt; needs to support multiple events, because you just create multiple scriptJobs, one for each event you want to trigger it, but point them all to the same command.&amp;nbsp;&lt;/P&gt;&lt;P&gt;As for HUDs, are you using the&amp;nbsp;&lt;STRONG&gt;headsUpDisplay&lt;/STRONG&gt; command? That has an optional&amp;nbsp;&lt;STRONG&gt;-nodeChanges&lt;/STRONG&gt; flag that pairs with the&amp;nbsp;&lt;STRONG&gt;-event&lt;/STRONG&gt; flag for "&lt;STRONG&gt;SelectionChanged&lt;/STRONG&gt;" events, so that the update can be triggered on Selection changes OR any attribute changes on the selection. This should work for changing UV Sets.&lt;/P&gt;&lt;P&gt;For example, this Python code should print "TRIGGERING!" whenever you change selection, or change UVSet on any selection:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def dualTrigger():
    print('TRIGGERING!')

from maya import cmds
cmds.headsUpDisplay('exampleHUD_dualTriggers', command=dualTrigger, 
                    event='SelectionChanged', nodeChanges='attributeChange',
                    section=1, block=0, blockSize='medium', label='dual')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(The same should work fine in MEL too btw)&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 13:39:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/can-i-script-job-or-hud-element-have-more-than-one-event-to/m-p/12540666#M508</guid>
      <dc:creator>FirespriteNate</dc:creator>
      <dc:date>2024-02-05T13:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Can I script job or HUD element have more than one event to trigger it?</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/can-i-script-job-or-hud-element-have-more-than-one-event-to/m-p/12541651#M509</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4515326"&gt;@FirespriteNate&lt;/a&gt;thanks for your reply, do you know how to write that same code in Mel I'm developing a Mel script for somebody.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 18:21:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/can-i-script-job-or-hud-element-have-more-than-one-event-to/m-p/12541651#M509</guid>
      <dc:creator>malcolm_341</dc:creator>
      <dc:date>2024-02-05T18:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: Can I script job or HUD element have more than one event to trigger it?</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/can-i-script-job-or-hud-element-have-more-than-one-event-to/m-p/12541823#M510</link>
      <description>&lt;P&gt;sorry, I assumed that'd be the easy part&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt; - converting basic cmds from python to MEL (and vice versa) is pretty straightforward, all the flags and stuff is the same, just the syntax is a bit different:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;global proc dualTrigger()
{
    print "TRIGGERING!";
}

headsUpDisplay -command "dualTrigger"
               -event "SelectionChanged" -nodeChanges "attributeChange"
               -section 1 -block 0 -blockSize "medium" -label "dual" 
               "exampleHUD_dualTriggers";&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 19:43:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/can-i-script-job-or-hud-element-have-more-than-one-event-to/m-p/12541823#M510</guid>
      <dc:creator>FirespriteNate</dc:creator>
      <dc:date>2024-02-05T19:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: Can I script job or HUD element have more than one event to trigger it?</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/can-i-script-job-or-hud-element-have-more-than-one-event-to/m-p/12662242#M511</link>
      <description>&lt;P&gt;This is what ChatGPT is for!!!&amp;nbsp; LOL!&amp;nbsp; Couldn't resist.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Mar 2024 17:18:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/can-i-script-job-or-hud-element-have-more-than-one-event-to/m-p/12662242#M511</guid>
      <dc:creator>mcw0</dc:creator>
      <dc:date>2024-03-24T17:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can I script job or HUD element have more than one event to trigger it?</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/can-i-script-job-or-hud-element-have-more-than-one-event-to/m-p/12662259#M512</link>
      <description>&lt;P&gt;Oops I replied to the wrong message, sorry I thought we were on a different topic. I'll give it a try next time I need to convert something.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Mar 2024 17:36:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/can-i-script-job-or-hud-element-have-more-than-one-event-to/m-p/12662259#M512</guid>
      <dc:creator>malcolm_341</dc:creator>
      <dc:date>2024-03-24T17:36:27Z</dc:date>
    </item>
  </channel>
</rss>

