{"id":81,"date":"2017-02-09T13:25:31","date_gmt":"2017-02-09T18:25:31","guid":{"rendered":"http:\/\/www.vicdebaie.com\/blog\/?p=81"},"modified":"2017-11-07T16:37:14","modified_gmt":"2017-11-07T21:37:14","slug":"plotting-character-animation-with-a-motionbuilder-python-script","status":"publish","type":"post","link":"http:\/\/www.vicdebaie.com\/blog\/plotting-character-animation-with-a-motionbuilder-python-script\/","title":{"rendered":"Plotting Character Animation With A MotionBuilder Python Script .\u00a0"},"content":{"rendered":"<p><img decoding=\"async\" class=\"alignnone\" src=\"https:\/\/i0.wp.com\/help.autodesk.com\/cloudhelp\/2017\/ENU\/MotionBuilder\/images\/GUID-79BDC26E-C118-4F5C-A4E8-72C044A59144.png?w=678\" alt=\"Image result for motionbuilder plot to control rig\" data-recalc-dims=\"1\" \/><\/p>\n<p>Let&#8217;s go over how to use Python to plot animation onto a character&#8217;s Control Rig. The interesting part of this is\u00a0the &#8220;plot options&#8221; and how we call back on them when we plot.<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nfrom pyfbsdk import *\r\n\r\n# Defining our Characater as the currnetly selected one\r\nlCharacter = FBApplication().CurrentCharacter\r\n\r\n# Defining the Plot option that will be used        \r\nPlotCtrlRigTakeOptions = FBPlotOptions()\r\n# To use Constant Key Reduction on the plot (True or False) \r\nPlotCtrlRigTakeOptions.ConstantKeyReducerKeepOneKey = False\r\n# To go through all takes in the scene and plot the data (True or False) \r\nPlotCtrlRigTakeOptions.PlotAllTakes = False\r\n# Do you wish to plot onto frames (True or False) \r\nPlotCtrlRigTakeOptions.PlotOnFrame = True\r\n# Set the plot period \r\nPlotCtrlRigTakeOptions.PlotPeriod = FBTime( 0, 0, 0, 1 )\r\nPlotCtrlRigTakeOptions.PlotTranslationOnRootOnly = False\r\nPlotCtrlRigTakeOptions.PreciseTimeDiscontinuities = False\r\n# What filter to use on the plot (Unroll, GimabalKill or None)\r\nPlotCtrlRigTakeOptions.RotationFilterToApply = FBRotationFilter.kFBRotationFilterUnroll\r\n# Use Constant Kye Reduction (True or False)\r\nPlotCtrlRigTakeOptions.UseConstantKeyReducer = False\r\n\r\n# Plotting to the selected character - note &quot;kFBCharacterPlotOnControlRig&quot; and &quot;PlotCtrlRigTakeOptions&quot;. \r\nlCharacter.PlotAnimation (FBCharacterPlotWhere.kFBCharacterPlotOnControlRig,PlotCtrlRigTakeOptions )\r\n<\/pre>\n<p>These are the settings I use when I am processing large motion capture data down to smaller performances.<\/p>\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s go over how to use Python to plot animation onto a character&#8217;s Control Rig. The interesting part of this is\u00a0the &#8220;plot options&#8221; and how we call back on them when we plot. &nbsp; from pyfbsdk import * # Defining our Characater as the currnetly selected one lCharacter = FBApplication().CurrentCharacter # Defining the Plot option [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":182,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[4],"tags":[5,7],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2017\/02\/img_3948.jpg?fit=320%2C160","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8pltq-1j","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":292,"url":"http:\/\/www.vicdebaie.com\/blog\/mirroring-motionbuilder-character-animation-with-python\/","url_meta":{"origin":81,"position":0},"title":"Mirroring MotionBuilder Character Animation with Python","author":"admin","date":"March 13, 2017","format":false,"excerpt":"In a previous post I went over \"Plotting and Plot Options\" as well as \"dir\" where we exposed the \"MirrorMode\" of a Character. Now with all that information exposed I will show you how I created a simple script that will mirror a\u00a0Character's animation, first by setting the \"MirrorMode\" to\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"http:\/\/www.vicdebaie.com\/blog\/category\/python\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2017\/02\/img_4039-1.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":747,"url":"http:\/\/www.vicdebaie.com\/blog\/motionbuilder-python-mirror-character-animation-through-story-mode\/","url_meta":{"origin":81,"position":1},"title":"MotionBuilder Python &#8211; Mirror Character Animation Through Story Mode","author":"admin","date":"November 21, 2019","format":false,"excerpt":"A quick script that will mirror animations via Story Mode.","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"http:\/\/www.vicdebaie.com\/blog\/category\/python\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2019\/11\/Mirror-Cap.jpg?fit=960%2C640&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2019\/11\/Mirror-Cap.jpg?fit=960%2C640&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2019\/11\/Mirror-Cap.jpg?fit=960%2C640&resize=700%2C400 2x"},"classes":[]},{"id":175,"url":"http:\/\/www.vicdebaie.com\/blog\/%ef%bb%bfplotting-selected-properties-using-motionbuilders-python\/","url_meta":{"origin":81,"position":2},"title":"\ufeffPlotting selected properties using MotionBuilder&#8217;s Python.","author":"admin","date":"February 17, 2017","format":false,"excerpt":"I ran\u00a0the script I created in \"Animating and setting keys with MotionBuilder's Python Editor\"\u00a0and decided that I would use the scene it creates\u00a0to learn how to plot on selected properties in MotionBuilder's Python Editor. Update: I found a work around for the bug and it is covered in my \"lock-and-plot-selected-properties-using-motionbuilders-python\"\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"http:\/\/www.vicdebaie.com\/blog\/category\/python\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":216,"url":"http:\/\/www.vicdebaie.com\/blog\/lock-and-plot-selected-properties-using-motionbuilders-python\/","url_meta":{"origin":81,"position":3},"title":"Lock and Plot selected properties using MotionBuilder\u2019s Python.","author":"admin","date":"February 21, 2017","format":false,"excerpt":"\u00a0 I ran into a bug in my previous post\u00a0about Plotting Selected properties - a bug that occurs in MotionBuilder 2015. I got in touch with Discreet and they said it would be easy enough for them to fix the\u00a0bug in an update\/hot fix, but I really wanted to solve\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"http:\/\/www.vicdebaie.com\/blog\/category\/python\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2017\/02\/motionbuilder_locked_fcurve.jpg?fit=737%2C271&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2017\/02\/motionbuilder_locked_fcurve.jpg?fit=737%2C271&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2017\/02\/motionbuilder_locked_fcurve.jpg?fit=737%2C271&resize=700%2C400 2x"},"classes":[]},{"id":686,"url":"http:\/\/www.vicdebaie.com\/blog\/save-all-story-clips-to-new-takes-with-motionbuilder-python-script\/","url_meta":{"origin":81,"position":4},"title":"Save All Story Clips To New Takes with MotionBuilder Python Script","author":"admin","date":"May 2, 2019","format":false,"excerpt":"UPDATED: A quick update that will now allow the script to maintain all of the original tracks within the story. The story will look exactly as it was pre-processing. Thanks Simon Kay Below is a script that I wrote, It goes through all you Story tracks and clips and then\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"http:\/\/www.vicdebaie.com\/blog\/category\/python\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2019\/05\/StoryTrackClips.png?fit=851%2C304&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2019\/05\/StoryTrackClips.png?fit=851%2C304&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2019\/05\/StoryTrackClips.png?fit=851%2C304&resize=700%2C400 2x"},"classes":[]},{"id":253,"url":"http:\/\/www.vicdebaie.com\/blog\/move-a-character-in-motionbuilder-to-the-worlds-center-with-python\/","url_meta":{"origin":81,"position":5},"title":"Move a Character in MotionBuilder to the World&#8217;s Center with Python","author":"admin","date":"March 7, 2018","format":false,"excerpt":"\u200eWith a dozen takes in my Motionbuilder scene and my Character placed at different locations on each take, I decided Python would help me move my Character to the World's Center. With raw Mocap data your Character's Wold Position is all based on the Actors position within the volume during\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"http:\/\/www.vicdebaie.com\/blog\/category\/python\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2017\/02\/IMG_4056.jpg?fit=800%2C600&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2017\/02\/IMG_4056.jpg?fit=800%2C600&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2017\/02\/IMG_4056.jpg?fit=800%2C600&resize=700%2C400 2x"},"classes":[]}],"_links":{"self":[{"href":"http:\/\/www.vicdebaie.com\/blog\/wp-json\/wp\/v2\/posts\/81"}],"collection":[{"href":"http:\/\/www.vicdebaie.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.vicdebaie.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.vicdebaie.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.vicdebaie.com\/blog\/wp-json\/wp\/v2\/comments?post=81"}],"version-history":[{"count":9,"href":"http:\/\/www.vicdebaie.com\/blog\/wp-json\/wp\/v2\/posts\/81\/revisions"}],"predecessor-version":[{"id":453,"href":"http:\/\/www.vicdebaie.com\/blog\/wp-json\/wp\/v2\/posts\/81\/revisions\/453"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.vicdebaie.com\/blog\/wp-json\/wp\/v2\/media\/182"}],"wp:attachment":[{"href":"http:\/\/www.vicdebaie.com\/blog\/wp-json\/wp\/v2\/media?parent=81"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.vicdebaie.com\/blog\/wp-json\/wp\/v2\/categories?post=81"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.vicdebaie.com\/blog\/wp-json\/wp\/v2\/tags?post=81"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}