<?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 Loading Character Animation through python in MotionBuilder Forum</title>
    <link>https://forums.autodesk.com/t5/motionbuilder-forum/loading-character-animation-through-python/m-p/6981338#M2322</link>
    <description>&lt;P&gt;I'm trying to figure out how to use python to load character animation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently what I'm looking to do is load a Character Animation onto my&amp;nbsp;rig without any pop ups and the method that is needed is to "Copy Animation (no retargetting)" and to the "Process Aniamtion" to be set to false.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;I've been getting a number of different errors when i try to use FBApplication().LoadAnimationOnCharacter and I can't seem&amp;nbsp;to figure out how to use FBCharacterLoadAnimationMethod.kFBCharacterLoadCopy.&lt;BR /&gt;&lt;BR /&gt;Any help would be greatly appreciated.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Mar 2017 13:51:30 GMT</pubDate>
    <dc:creator>vdebaie</dc:creator>
    <dc:date>2017-03-29T13:51:30Z</dc:date>
    <item>
      <title>Loading Character Animation through python</title>
      <link>https://forums.autodesk.com/t5/motionbuilder-forum/loading-character-animation-through-python/m-p/6981338#M2322</link>
      <description>&lt;P&gt;I'm trying to figure out how to use python to load character animation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently what I'm looking to do is load a Character Animation onto my&amp;nbsp;rig without any pop ups and the method that is needed is to "Copy Animation (no retargetting)" and to the "Process Aniamtion" to be set to false.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;I've been getting a number of different errors when i try to use FBApplication().LoadAnimationOnCharacter and I can't seem&amp;nbsp;to figure out how to use FBCharacterLoadAnimationMethod.kFBCharacterLoadCopy.&lt;BR /&gt;&lt;BR /&gt;Any help would be greatly appreciated.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 13:51:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/motionbuilder-forum/loading-character-animation-through-python/m-p/6981338#M2322</guid>
      <dc:creator>vdebaie</dc:creator>
      <dc:date>2017-03-29T13:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: Loading Character Animation through python</title>
      <link>https://forums.autodesk.com/t5/motionbuilder-forum/loading-character-animation-through-python/m-p/6984345#M2323</link>
      <description>&lt;P&gt;Hi vdebaie,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks the following code sample seem to do what you are looking for:&lt;/P&gt;
&lt;PRE&gt;lFbxOptions = FBFbxOptions( True )
lFbxOptions.TransferMethod = FBCharacterLoadAnimationMethod.kFBCharacterLoadCopy
lFbxOptions.ProcessAnimationOnExtension = False

lPlotOptions = FBPlotOptions()

lAnimFile = ...
lTargetCharacter = ...

FBApplication().LoadAnimationOnCharacter( lAnimFile, lTargetCharacter, lFbxOptions, lPlotOptions )
&lt;/PRE&gt;
&lt;P&gt;If not, please let me know.&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>Thu, 30 Mar 2017 13:10:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/motionbuilder-forum/loading-character-animation-through-python/m-p/6984345#M2323</guid>
      <dc:creator>brissef2</dc:creator>
      <dc:date>2017-03-30T13:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Loading Character Animation through python</title>
      <link>https://forums.autodesk.com/t5/motionbuilder-forum/loading-character-animation-through-python/m-p/6987488#M2324</link>
      <description>&lt;P&gt;That works! Thank you so much.&lt;/P&gt;&lt;P&gt;I'm trying to load a new scene and import a Character Rig and then have my animations load on to it, the problem now is the&amp;nbsp;script is asking me to load the animations before the scene gets merged and i get a "no character in scene error".&lt;/P&gt;&lt;P&gt;The script is wrote&amp;nbsp;as:&lt;/P&gt;&lt;PRE&gt;#Clear Scene and Merge in new Ctrl Rig
&amp;nbsp;
# New Scene
lfbApp.FileNew()
&amp;nbsp;
# Import our target Control rig
lfbMergeFilePath = r'the path to my CharacterRig.fbx'
&amp;nbsp;
#The name of the take used as source
lfbTakeSource = 'Take Source'
#The name of the take where the data must be imported
lfbTakeDest = 'Take 001'
&amp;nbsp;
#Init the FbxOptions
lfbMergeOptions = FBFbxOptions(True, lfbMergeFilePath)
&amp;nbsp;
#Disable base camera, camera switcher ...
lfbMergeOptions.BaseCameras = False
lfbMergeOptions.CameraSwitcherSettings = False
lfbMergeOptions.GlobalLightingSettings = False
lfbMergeOptions.CurrentCameraSettings = False
&amp;nbsp;
#Ensure that transport setting is enable. This elements contain the timeline parameters.
lfbMergeOptions.TransportSettings = False
&amp;nbsp;
#Pass thru all the takes to find the source take and change the destination and
#disable all the rest
lfbMergeTakeCount = lfbMergeOptions.GetTakeCount()
&amp;nbsp;
for i in range(lfbMergeTakeCount):
lfbMergeTakeName = lfbMergeOptions.GetTakeName(i)
if lfbMergeTakeName == lfbTakeSource:
lfbMergeOptions.SetTakeDestinationName(i, lfbTakeDest)
else:
lfbMergeOptions.SetTakeSelect(i, False)
&amp;nbsp;
#Set Name Space
lfbMergeOptions.NamespaceList = "the name space i want"
&amp;nbsp;
# Dissable merge popup window
lfbMergeOptions.ShowOptionsDialog = False
&amp;nbsp;
# Add to current scene
FBApplication().FileAppend(lfbMergeFilePath, True, lfbMergeOptions)
&amp;nbsp;
del (lfbMergeFilePath, lfbTakeSource, lfbTakeDest, lfbMergeOptions, lfbMergeTakeCount)
&amp;nbsp;
# Load Animation
&amp;nbsp;
lfbFbxOptions = FBFbxOptions( True )
lfbFbxOptions.TransferMethod = FBCharacterLoadAnimationMethod.kFBCharacterLoadCopy
lfbFbxOptions.ProcessAnimationOnExtension = False
lfbFbxOptions.ShowOptionsDialog = False
&amp;nbsp;
lfbPlotOptions = FBPlotOptions()
&amp;nbsp;
FBApplication().LoadAnimationOnCharacter( lfbSaveChrAnim, lfbApp.CurrentCharacter, lfbFbxOptions, lfbPlotOptions )&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;Any help would be greatly appreciated, thank you.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2017 14:54:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/motionbuilder-forum/loading-character-animation-through-python/m-p/6987488#M2324</guid>
      <dc:creator>vdebaie</dc:creator>
      <dc:date>2017-03-31T14:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: Loading Character Animation through python</title>
      <link>https://forums.autodesk.com/t5/motionbuilder-forum/loading-character-animation-through-python/m-p/6987580#M2325</link>
      <description>&lt;P&gt;Hi vdebaie,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't have this issue on my side as everything works fine.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As an example, set some of your variables in your script with the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;lfbMergeFilePath = r'C:\\Program Files\\Autodesk\\MotionBuilder 2017\\Tutorials\\mia_rigged.fbx'&lt;/P&gt;
&lt;P&gt;lfbTakeSource = 'Take 001'&lt;/P&gt;
&lt;P&gt;lfbMergeOptions.NamespaceList = "testNS"&lt;/P&gt;
&lt;P&gt;lfbSaveChrAnim = r'C:\\Program Files\\Autodesk\\MotionBuilder 2017\\Tutorials\walkaround.fbx'&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>Fri, 31 Mar 2017 15:26:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/motionbuilder-forum/loading-character-animation-through-python/m-p/6987580#M2325</guid>
      <dc:creator>brissef2</dc:creator>
      <dc:date>2017-03-31T15:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: Loading Character Animation through python</title>
      <link>https://forums.autodesk.com/t5/motionbuilder-forum/loading-character-animation-through-python/m-p/6988448#M2326</link>
      <description>After restarting MotionBuilder the script started to work properly. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;I have the load character animation pop up appear and wait for me to select "ok".&lt;BR /&gt;&lt;BR /&gt;I've tried a few things but still seem to have it appear.&lt;BR /&gt;&lt;BR /&gt;lOptions.ShowFileDialog= False&lt;BR /&gt;lOptions.ShowOptionsDialog= False&lt;BR /&gt;&lt;BR /&gt;Is there something else that I'm missing?&lt;BR /&gt;&lt;BR /&gt;Again, thank you so much for the help.&lt;BR /&gt;&lt;BR /&gt;Learning Python is a difficult task in Mobu, but so rewarding.</description>
      <pubDate>Fri, 31 Mar 2017 22:10:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/motionbuilder-forum/loading-character-animation-through-python/m-p/6988448#M2326</guid>
      <dc:creator>vdebaie</dc:creator>
      <dc:date>2017-03-31T22:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: Loading Character Animation through python</title>
      <link>https://forums.autodesk.com/t5/motionbuilder-forum/loading-character-animation-through-python/m-p/6991353#M2327</link>
      <description>&lt;P&gt;Hi vdebaie,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With the script you provided, and with the few variables I set on top of it, I don't see any pop-up, do you?&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, 03 Apr 2017 12:41:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/motionbuilder-forum/loading-character-animation-through-python/m-p/6991353#M2327</guid>
      <dc:creator>brissef2</dc:creator>
      <dc:date>2017-04-03T12:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: Loading Character Animation through python</title>
      <link>https://forums.autodesk.com/t5/motionbuilder-forum/loading-character-animation-through-python/m-p/6992429#M2328</link>
      <description>&lt;P&gt;Yea, it should work without the pop up but I&amp;nbsp;still get it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have more lines of script atop of what I posted here, which may be causing problems.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I know earlier when writing the script I caused MotionBuilder to prevent the "Load Character Animation..." pop up window from appearing all together (when clicking on the option form the character controls window) and it would stay vanished even when restarting the computer. The only way to get it back was to run part of the script again. So there is something in there that needs to be reworked(to say the least). I must of copied and pasted something from the forums that is not playing nice with what I am trying to do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2017 18:10:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/motionbuilder-forum/loading-character-animation-through-python/m-p/6992429#M2328</guid>
      <dc:creator>vdebaie</dc:creator>
      <dc:date>2017-04-03T18:10:20Z</dc:date>
    </item>
  </channel>
</rss>

