<?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: Execute python script on selected takes in MotionBuilder Forum</title>
    <link>https://forums.autodesk.com/t5/motionbuilder-forum/execute-python-script-on-selected-takes/m-p/6958334#M2342</link>
    <description>&lt;P&gt;Hi Senorsean32,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here a sample script to iterate over all the selected takes, and prints its name:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;for aTake in FBSystem().Scene.Takes:
    if aTake.Selected:
        print aTake.Name&lt;/PRE&gt;
&lt;P&gt;Please let me know if it helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Francis&lt;/P&gt;</description>
    <pubDate>Mon, 20 Mar 2017 13:46:55 GMT</pubDate>
    <dc:creator>brissef2</dc:creator>
    <dc:date>2017-03-20T13:46:55Z</dc:date>
    <item>
      <title>Execute python script on selected takes</title>
      <link>https://forums.autodesk.com/t5/motionbuilder-forum/execute-python-script-on-selected-takes/m-p/6955723#M2341</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know how to access the selected takes via python script? &amp;nbsp;I have a script I wrote that I would only want to run on selected takes. &amp;nbsp;Ideally I would like to find the selected takes and iterate over them. &amp;nbsp;Conversely, I would settle for a way to manually run a script itself only on the selected takes. &amp;nbsp;Any info would be appreciated. &amp;nbsp;Thanks!!!&lt;/P&gt;</description>
      <pubDate>Sat, 18 Mar 2017 15:08:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/motionbuilder-forum/execute-python-script-on-selected-takes/m-p/6955723#M2341</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-18T15:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: Execute python script on selected takes</title>
      <link>https://forums.autodesk.com/t5/motionbuilder-forum/execute-python-script-on-selected-takes/m-p/6958334#M2342</link>
      <description>&lt;P&gt;Hi Senorsean32,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here a sample script to iterate over all the selected takes, and prints its name:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;for aTake in FBSystem().Scene.Takes:
    if aTake.Selected:
        print aTake.Name&lt;/PRE&gt;
&lt;P&gt;Please let me know if it helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Francis&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 13:46:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/motionbuilder-forum/execute-python-script-on-selected-takes/m-p/6958334#M2342</guid>
      <dc:creator>brissef2</dc:creator>
      <dc:date>2017-03-20T13:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: Execute python script on selected takes</title>
      <link>https://forums.autodesk.com/t5/motionbuilder-forum/execute-python-script-on-selected-takes/m-p/6958949#M2343</link>
      <description>&lt;P&gt;Thanks Francis. That totally helped. &amp;nbsp;I actually solved it before you responded to me in a less efficient, newb way haha. &amp;nbsp;I iterated through the components looking for the class_name to be FBTake. &amp;nbsp;Your solution is much cleaner. &amp;nbsp;I changed my code with it and it works great.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for the incredibly quick reply too. I'll be sure to keep this forum in mind when I hit the python-mobu wall again in the future &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Sean&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 16:30:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/motionbuilder-forum/execute-python-script-on-selected-takes/m-p/6958949#M2343</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-20T16:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: Execute python script on selected takes</title>
      <link>https://forums.autodesk.com/t5/motionbuilder-forum/execute-python-script-on-selected-takes/m-p/7027882#M2344</link>
      <description>&lt;P&gt;is there a way to have that sample script print an error if no takes are selected?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;for aTake in FBSystem().Scene.Takes:
    if aTake.Selected:
        print aTake.Name&lt;BR /&gt;    else:&lt;BR /&gt;        print "no take selected"&lt;BR /&gt;&lt;BR /&gt;this works, but prints it for every take in the scene. lol, thanks. :)&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Apr 2017 20:12:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/motionbuilder-forum/execute-python-script-on-selected-takes/m-p/7027882#M2344</guid>
      <dc:creator>vdebaie</dc:creator>
      <dc:date>2017-04-19T20:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: Execute python script on selected takes</title>
      <link>https://forums.autodesk.com/t5/motionbuilder-forum/execute-python-script-on-selected-takes/m-p/7027925#M2345</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4400628"&gt;@vdebaie&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here you go:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;takeSelected = False

for aTake in FBSystem().Scene.Takes:
    if aTake.Selected:
        print aTake.Name
        takeSelected = True


if not takeSelected:
        print "no take selected"&lt;/PRE&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Francis&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2017 20:38:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/motionbuilder-forum/execute-python-script-on-selected-takes/m-p/7027925#M2345</guid>
      <dc:creator>brissef2</dc:creator>
      <dc:date>2017-04-19T20:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: Execute python script on selected takes</title>
      <link>https://forums.autodesk.com/t5/motionbuilder-forum/execute-python-script-on-selected-takes/m-p/7029902#M2346</link>
      <description>&lt;P&gt;Great! thanks!!!!&lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 14:41:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/motionbuilder-forum/execute-python-script-on-selected-takes/m-p/7029902#M2346</guid>
      <dc:creator>vdebaie</dc:creator>
      <dc:date>2017-04-20T14:41:22Z</dc:date>
    </item>
  </channel>
</rss>

