{"id":63,"date":"2017-02-06T13:02:14","date_gmt":"2017-02-06T18:02:14","guid":{"rendered":"http:\/\/www.vicdebaie.com\/blog\/?p=63"},"modified":"2019-04-17T14:14:35","modified_gmt":"2019-04-17T18:14:35","slug":"hello-world-a-k-a-let-us-begin","status":"publish","type":"post","link":"http:\/\/www.vicdebaie.com\/blog\/hello-world-a-k-a-let-us-begin\/","title":{"rendered":"Hello World! &#8211; A.k.a &#8220;Let us begin&#8221;"},"content":{"rendered":"<p><a href=\"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2017\/02\/img_3934.jpg\"><img data-attachment-id=\"108\" data-permalink=\"http:\/\/www.vicdebaie.com\/blog\/hello-world-a-k-a-let-us-begin\/img_3934-jpg\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2017\/02\/img_3934.jpg?fit=526%2C492\" data-orig-size=\"526,492\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}\" data-image-title=\"\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2017\/02\/img_3934.jpg?fit=300%2C281\" data-large-file=\"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2017\/02\/img_3934.jpg?fit=526%2C492\" decoding=\"async\" loading=\"lazy\" class=\"size-large wp-image-108 alignnone\" title=\"\" src=\"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2017\/02\/img_3934.jpg?resize=526%2C492\" alt=\"\" width=\"526\" height=\"492\" srcset=\"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2017\/02\/img_3934.jpg?w=526 526w, https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2017\/02\/img_3934.jpg?resize=300%2C281 300w\" sizes=\"(max-width: 526px) 100vw, 526px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>Here is my first posting for this experiment &#8211; &#8220;the blog&#8221;.<\/p>\n<p>For the last two weeks I have been mucking around with Python scripting within MotionBuilder. It has been an uphill battle. With the limited resources out there all I can really do is hack away at bits and pieces of code and decipher them into snippets that I then can use to build the Animation tools that I desire within MotionBuilder.<br \/>\nSo this first posting will be the above introduction along with the very first thing everyone needs to know when trying to Python script within MotionBuilder &#8211; &#8220;pyfbsdk&#8221;<\/p>\n<p><!--more--><\/p>\n<p><a href=\"http:\/\/awforsythe.com\/tutorials\/pyfbsdk-1\">Alex Forsythe<\/a> defines &#8220;pyfbsdk&#8221; as a module that grants you access to MotionBuilder&#8217;s API.<\/p>\n<p>An API is defined as &#8220;Application program interface (API) is a set of routines, protocols, and tools for building software applications. An API specifies how software components should interact. Additionally, APIs are used when programming graphical user interface (GUI) components.&#8221;<\/p>\n<p>So, let&#8217;s begin this experiment to learn Python scripting, create Animation Tools within MotionBuilder and wrap our heads around all that is &#8220;pyfbsdk&#8221;.<\/p>\n<p>First thing we need to do is import everything from the &#8220;pyfbsdk&#8221; (see line #1 of the code below). We use a &#8220;*&#8221; (wildcard) to import everything.<\/p>\n<p>Now on our third line we use the &#8220;print&#8221; command and follow it with &#8220;Let&#8217;s begin!&#8221;. You can change the text from &#8220;Let&#8217;s begin!&#8221; to &#8220;My First MotionBuilder Python Script!&#8221;, whatever liese between the quotation marks will be the message printed.<\/p>\n<pre><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfrom pyfbsdk import *\n\nprint &quot;Let's begin!&quot;\n<\/pre>\n<p>So, where does this all go? Well within the Python Editor window. \ud83d\ude42 In MotionBuilder goto your top menu bar and under the &#8220;Window&#8221; drop down choose &#8220;Python Editor&#8221;.<\/p>\n<p>The Python Editor is made up of two main sections, the &#8220;Console Area&#8221; and the &#8220;Work Area&#8221;:<\/p>\n<p>You can click <a href=\"http:\/\/help.autodesk.com\/view\/MOBPRO\/2017\/ENU\/?guid=GUID-B54F28EE-1261-4289-98F5-A9FBB4D59E02\">here<\/a> to see more about what makes up the MotionBuilder Python Editor.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/help.autodesk.com\/cloudhelp\/2017\/ENU\/MotionBuilder\/images\/GUID-B73F9CE9-8D0D-4C86-8B75-3E9733EACB43.png?w=678\" data-recalc-dims=\"1\"><\/p>\n<p>If you copy and paste the code:<\/p>\n<pre><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfrom pyfbsdk import *\n\nprint &quot;Let's begin!&quot;\n<\/pre>\n<p>Into the Work Area of the Python Editor and hit F5 you should see results within the Console Area.:)<\/p>\n<p><img data-attachment-id=\"74\" data-permalink=\"http:\/\/www.vicdebaie.com\/blog\/hello-world-a-k-a-let-us-begin\/printletsbegin\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2017\/02\/printletsbegin-e1486401072786.png?fit=330%2C423\" data-orig-size=\"330,423\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2017\/02\/printletsbegin-e1486401072786.png?fit=234%2C300\" data-large-file=\"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2017\/02\/printletsbegin-e1486401072786.png?fit=678%2C475\" decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-74\" src=\"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2017\/02\/printletsbegin-e1486401072786.png?resize=330%2C423\" alt=\"\" width=\"330\" height=\"423\" srcset=\"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2017\/02\/printletsbegin-e1486401072786.png?w=330 330w, https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2017\/02\/printletsbegin-e1486401072786.png?resize=234%2C300 234w\" sizes=\"(max-width: 330px) 100vw, 330px\" data-recalc-dims=\"1\" \/><\/p>\n<p>Ta da! My first post here and your first script.<\/p>\n<p>My other posts will be going over much larger things and not as in depth as this one. From here on in I will assume you know the basics of MotionBuilder and I will only focus on the Python Scripting elements within MotionBuilder to help speed up work flow and provide some information (as I learn it).<\/p>\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>Here is my first posting for this experiment &#8211; &#8220;the blog&#8221;. For the last two weeks I have been mucking around with Python scripting within MotionBuilder. It has been an uphill battle. With the limited resources out there all I can really do is hack away at bits and pieces of code and decipher them [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":108,"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],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2017\/02\/img_3934.jpg?fit=526%2C492","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8pltq-11","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":77,"url":"http:\/\/www.vicdebaie.com\/blog\/motionbuilder-python-where-to-start\/","url_meta":{"origin":63,"position":0},"title":"MotionBuilder Python &#8211; Where to start","author":"admin","date":"February 6, 2017","format":false,"excerpt":"Finding information for Python scripting in MotionBuilder can be an uphill battle. Here is a list of some of the resources that I have been able to find (thanks google). A lot of the listed links have valuable scripts in which one can hack through and decipher what each line\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\/16697171583_7c33584c4b.jpg?fit=500%2C333&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":645,"url":"http:\/\/www.vicdebaie.com\/blog\/motionbuilder-python-a-better-way-to-create-constraints\/","url_meta":{"origin":63,"position":1},"title":"MotionBuilder Python &#8211; A Better Way To Create Constraints","author":"admin","date":"November 14, 2018","format":false,"excerpt":"Update Thanks to\u00a0kilianeczka\u00a0for the heads up, there is even an EASIER easy way to create a constraint using MotionBuilder and Python [code language=\"python\"] import pyfbsdk as fb fb.FBConstraintManager().TypeCreateConstraint('Parent\/Child') [\/code] This omits the need to find the number of constraints and then search all the constraints for one that has the\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\/2018\/11\/Think^_Is_There_a_Better_Way_to_Do_it^_-_NARA_-_534256.jpg?fit=400%2C204&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":83,"url":"http:\/\/www.vicdebaie.com\/blog\/using-python-to-create-a-layer-on-the-current-selected-take-in-motionbuilder\/","url_meta":{"origin":63,"position":2},"title":"Using Python to Create a layer on the Current Selected Take in MotionBuilder.\u00a0","author":"admin","date":"February 9, 2017","format":false,"excerpt":"In MotionBuilder using animation layers are great for edits, blending, additives and in general adding quality passes to your animations. So below I'm going to demo how I learned to add layers\u00a0using Python. To create an Animation Layer on the Current Take script: [code language=\"python\"] from pyfbsdk import * lSystem\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":127,"url":"http:\/\/www.vicdebaie.com\/blog\/running-a-python-script-on-all-takes\/","url_meta":{"origin":63,"position":3},"title":"Running A Python Script On All Takes.\u00a0\ufeff","author":"admin","date":"February 18, 2017","format":false,"excerpt":"Being able to run a Python script on all takes within a MotionBuilder scene is a powerful time saver. Below I'm going to show how I learned to create a layer on every take within a MotionBuilder scene using Python. We are going to\u00a0use Python to create an Animation Layer\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":288,"url":"http:\/\/www.vicdebaie.com\/blog\/getting-information-on-motionbuilders-python-with-dir\/","url_meta":{"origin":63,"position":4},"title":"Getting information on MotionBuilder&#8217;s Python with dir","author":"admin","date":"March 13, 2017","format":false,"excerpt":"Trying to figure how things work in MotionBuilder's Python editor is tough. Google and the SDK Help that comes along with MotionBuilder are great, but there is still more help out there - the \"dir\"! :) What does \"dir\" do? The definition I was able to find is \"It gives\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":336,"url":"http:\/\/www.vicdebaie.com\/blog\/how-to-use-functions-with-motionbuilder-python\/","url_meta":{"origin":63,"position":5},"title":"How to use functions with MotionBuilder Python","author":"admin","date":"April 25, 2017","format":false,"excerpt":"Using functions will save you from re-writing and maintaining many of the same lines of code over and over. What is a Python Function? \"A function is a block of organized, reusable code that is used to perform a single, related action. Functions provide better modularity for your application and\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\/04\/c2c827b3a6ea16d024b6875b5610651c-e1493127532666.gif?fit=251%2C300&resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"http:\/\/www.vicdebaie.com\/blog\/wp-json\/wp\/v2\/posts\/63"}],"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=63"}],"version-history":[{"count":21,"href":"http:\/\/www.vicdebaie.com\/blog\/wp-json\/wp\/v2\/posts\/63\/revisions"}],"predecessor-version":[{"id":672,"href":"http:\/\/www.vicdebaie.com\/blog\/wp-json\/wp\/v2\/posts\/63\/revisions\/672"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.vicdebaie.com\/blog\/wp-json\/wp\/v2\/media\/108"}],"wp:attachment":[{"href":"http:\/\/www.vicdebaie.com\/blog\/wp-json\/wp\/v2\/media?parent=63"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.vicdebaie.com\/blog\/wp-json\/wp\/v2\/categories?post=63"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.vicdebaie.com\/blog\/wp-json\/wp\/v2\/tags?post=63"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}