<?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: ScriptJob = Frame selection in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/scriptjob-frame-selection/m-p/11475981#M1908</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11712848"&gt;@Kahylan&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;The publication of this post became more and more profound but very didactic.&lt;BR /&gt;The noChildren(noc) option I can't get it to work, I didn't manage to apply it.&lt;BR /&gt;Surely I am missing something.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;cmds.viewFit( 'persp1', noc=True )&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dg3duy_0-1665519472145.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1126097iB998D3189642A57C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dg3duy_0-1665519472145.png" alt="dg3duy_0-1665519472145.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Oct 2022 20:18:50 GMT</pubDate>
    <dc:creator>dg3duy</dc:creator>
    <dc:date>2022-10-11T20:18:50Z</dc:date>
    <item>
      <title>ScriptJob = Frame selection</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/scriptjob-frame-selection/m-p/11470694#M1903</link>
      <description>&lt;P&gt;I am investigating how to select the objects on screen and keep them centered on the screen, the closest I found is this.&lt;BR /&gt;With the current option I am using I have to deselect the element and select a new one for the scriptjob to act, I would like it to be activated every time I select an object on the screen.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;I would like to be able to use the &lt;STRONG&gt;SelectionChanged&lt;/STRONG&gt; option, but I don't know how to use it.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;import maya.cmds as cmds
jobNum = cmds.scriptJob( ct= ["SomethingSelected","cmds.viewFit()"])

#cmds.scriptJob( kill=jobNum, force=True)&lt;/LI-CODE&gt;&lt;P&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6313502968112w960h540r612" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6313502968112" data-account="6057940548001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6057940548001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6313502968112w960h540r612');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://forums.autodesk.com/t5/video/gallerypage/video-id/6313502968112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Oct 2022 23:59:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/scriptjob-frame-selection/m-p/11470694#M1903</guid>
      <dc:creator>dg3duy</dc:creator>
      <dc:date>2022-10-08T23:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: ScriptJob = Frame selection</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/scriptjob-frame-selection/m-p/11471154#M1904</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to be honest, I think the constant view jumping would make me throw up if I had this on all the time.&lt;/P&gt;&lt;P&gt;But here is how you do it, have fun:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import maya.cmds as cmds
jobNum = cmds.scriptJob( e = ["SelectionChanged","cmds.viewFit()"])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope it helps!&lt;/P&gt;</description>
      <pubDate>Sun, 09 Oct 2022 11:35:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/scriptjob-frame-selection/m-p/11471154#M1904</guid>
      <dc:creator>Kahylan</dc:creator>
      <dc:date>2022-10-09T11:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: ScriptJob = Frame selection</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/scriptjob-frame-selection/m-p/11471287#M1905</link>
      <description>&lt;P&gt;It is excellent!&lt;/P&gt;</description>
      <pubDate>Sun, 09 Oct 2022 14:22:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/scriptjob-frame-selection/m-p/11471287#M1905</guid>
      <dc:creator>dg3duy</dc:creator>
      <dc:date>2022-10-09T14:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: ScriptJob = Frame selection</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/scriptjob-frame-selection/m-p/11473484#M1906</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11712848"&gt;@Kahylan&lt;/a&gt;&amp;nbsp;I forget the idea that it can be done without the on-screen jump, it's a losing battle I'm looking for?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 19:07:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/scriptjob-frame-selection/m-p/11473484#M1906</guid>
      <dc:creator>dg3duy</dc:creator>
      <dc:date>2022-10-10T19:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: ScriptJob = Frame selection</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/scriptjob-frame-selection/m-p/11473713#M1907</link>
      <description>&lt;P&gt;I looked it up and the viewFit command does have a flag for animated transitions.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import maya.cmds as cmds
jobNum = cmds.scriptJob( e = ["SelectionChanged","cmds.viewFit(an = True)"])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;you might also want use the fitfactor or center flag. depending on what you have in mind&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/cloudhelp/2022/ENU/Maya-Tech-Docs/CommandsPython/viewFit.html" target="_blank"&gt;https://help.autodesk.com/cloudhelp/2022/ENU/Maya-Tech-Docs/CommandsPython/viewFit.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 21:50:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/scriptjob-frame-selection/m-p/11473713#M1907</guid>
      <dc:creator>Kahylan</dc:creator>
      <dc:date>2022-10-10T21:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: ScriptJob = Frame selection</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/scriptjob-frame-selection/m-p/11475981#M1908</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11712848"&gt;@Kahylan&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;The publication of this post became more and more profound but very didactic.&lt;BR /&gt;The noChildren(noc) option I can't get it to work, I didn't manage to apply it.&lt;BR /&gt;Surely I am missing something.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;cmds.viewFit( 'persp1', noc=True )&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dg3duy_0-1665519472145.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1126097iB998D3189642A57C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dg3duy_0-1665519472145.png" alt="dg3duy_0-1665519472145.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 20:18:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/scriptjob-frame-selection/m-p/11475981#M1908</guid>
      <dc:creator>dg3duy</dc:creator>
      <dc:date>2022-10-11T20:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: ScriptJob = Frame selection</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/scriptjob-frame-selection/m-p/11476118#M1909</link>
      <description>&lt;P&gt;The noc flag is True by default, so you don't see any change when setting it True, only when setting it to False&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 21:28:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/scriptjob-frame-selection/m-p/11476118#M1909</guid>
      <dc:creator>Kahylan</dc:creator>
      <dc:date>2022-10-11T21:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: ScriptJob = Frame selection</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/scriptjob-frame-selection/m-p/11476124#M1910</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;import maya.cmds as cmds
jobNum = cmds.scriptJob( ct = ["SomethingSelected","cmds.viewFit(an = True),cmds.viewFit(c = True),cmds.viewFit( f=0.5 )"]),cmds.scriptJob( e= ["SelectionChanged","cmds.select( clear=True ),cmds.undo()"])

##cmds.scriptJob(kill=jobNum)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11712848"&gt;@Kahylan&lt;/a&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;I want to show you what I was able to do based on your great help.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 21:32:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/scriptjob-frame-selection/m-p/11476124#M1910</guid>
      <dc:creator>dg3duy</dc:creator>
      <dc:date>2022-10-11T21:32:46Z</dc:date>
    </item>
  </channel>
</rss>

