{"id":469,"date":"2018-03-06T12:41:14","date_gmt":"2018-03-06T17:41:14","guid":{"rendered":"http:\/\/www.vicdebaie.com\/blog\/?p=469"},"modified":"2018-03-07T12:53:23","modified_gmt":"2018-03-07T17:53:23","slug":"running-a-python-script-on-every-motionbuilder-file-within-a-directory","status":"publish","type":"post","link":"http:\/\/www.vicdebaie.com\/blog\/running-a-python-script-on-every-motionbuilder-file-within-a-directory\/","title":{"rendered":"Running a Python Script On Every MotionBuilder File Within A Directory"},"content":{"rendered":"<p><img data-attachment-id=\"476\" data-permalink=\"http:\/\/www.vicdebaie.com\/blog\/running-a-python-script-on-every-motionbuilder-file-within-a-directory\/possibility\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2018\/03\/Possibility.jpg?fit=960%2C627\" data-orig-size=\"960,627\" 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\/2018\/03\/Possibility.jpg?fit=300%2C196\" data-large-file=\"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2018\/03\/Possibility.jpg?fit=678%2C443\" decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-476\" src=\"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2018\/03\/Possibility.jpg?resize=678%2C443\" alt=\"\" width=\"678\" height=\"443\" srcset=\"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2018\/03\/Possibility.jpg?w=960 960w, https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2018\/03\/Possibility.jpg?resize=300%2C196 300w, https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2018\/03\/Possibility.jpg?resize=768%2C502 768w, https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2018\/03\/Possibility.jpg?resize=612%2C400 612w\" sizes=\"(max-width: 678px) 100vw, 678px\" data-recalc-dims=\"1\" \/><\/p>\n<p>It&#8217;s been awhile since I have posted, We are approaching launch of my next game tittle and now that I have a free moment I thought I would demonstrate how to run a python script on multiple &#8220;.fbx&#8221; files. All the &#8220;.fbx&#8221; files for this demo will exist within the same directory.<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n\r\n##Set Your Root Dir Here\r\nroot = r&quot;D:\\lookaround&quot;\r\n\r\n'''\r\nBelow is a simple example on how to search a folder (the &quot;root&quot; variable listed above) for &quot;.fbx&quot; files\r\n'''\r\n##Creat A Function That Will Search The Root Dir for .fbx Files\r\ndef ListFolderContent():\r\nimport sys,os\r\npath = os.path.join(root, &quot;targetdirectory&quot;)\r\nfor path, subdirs, files in os.walk(root):\r\nfor name in files:\r\n##Set A Variable To Isolate Each Files Extension\r\nextension = os.path.splitext(name)&#x5B;1]\r\n##Define What To Do With Files That Have The Extention &quot;.fbx&quot;\r\nif extension == &quot;.fbx&quot;:\r\nlfbxfile = os.path.join(path, name)\r\n'''\r\nThis is where you state what you want to do to the .fbx file found.\r\nFor this example I will just print out the file's full path\r\n'''\r\n##Print The Path And File Name\r\nprint lfbxfile\r\n##Define What To Do With Files Found That Have Another Extension\r\nelse:\r\npass\r\n##Print Out The Total Number Of &quot;.fbx&quot; Files Found\r\nprint &quot;Number of FBX Files Found:&quot;, len( list ( enumerate(files) ) )\r\n\r\n##Run Function\r\nListFolderContent()\r\n\r\n<\/pre>\n<p>The above script prints out the following for me:<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n&gt;&gt;&gt; \r\nD:\\lookaround\\lookaround001.fbx\r\nD:\\lookaround\\lookaround002.fbx\r\nD:\\lookaround\\lookaround003.fbx\r\nD:\\lookaround\\lookaround004.fbx\r\nNumber of FBX Files Found: 4\r\n&gt;&gt;&gt; \r\n<\/pre>\n<p>By changing the variable root (found on line #2) to the drive and directory you want to search you should be able to get a list of your own.<\/p>\n<p>The above example print the file name if the existence of &#8220;.fbx&#8221; is found:<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n##Print The Path And File Name\r\nprint lfbxfile\r\n<\/pre>\n<p>That can be changed to anything you wish to do to the &#8220;.fbx&#8221; file, for instance if you wanted to open the fbx file and print out the name of every take (!!!I would not recommend doing this if you have a lot of &#8220;.fbx&#8221; files or if the file size are really big!!!):<\/p>\n<p>The full script would look like this:<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n##Set Your Root Dir   \r\nroot = r&quot;D:\\lookaround&quot;\r\n\r\n##A Simple Function That Will Open A File Within MotionBuilder And Print Out the Take Names\r\ndef OpenFileAndListTakes(files):\r\n    from pyfbsdk import FBApplication, FBSystem\r\n    ##Open .fbx file\r\n    FBApplication().FileOpen(files)\r\n    ##Pring File Name\r\n    print files\r\n    ##Print Take Names\r\n    for i in  FBSystem().Scene.Takes:\r\n        print i.Name\r\n    \r\n'''\r\nBelow is a simple example on how to search a folder (the &quot;root&quot; variable listed above) for &quot;.fbx&quot; files\r\n'''\r\n##Creat A Function That Will Search The Root Dir for .fbx Files    \r\ndef ListFolderContent():\r\n    import sys,os\r\n    path = os.path.join(root, &quot;targetdirectory&quot;)\r\n    for path, subdirs, files in os.walk(root):\r\n        ##Added Variables For Folders That We Want to Omit\r\n        '''\r\n        MotionBuilder Can Automatically Create (Backups And Media) folders, by skipping them it will allow us to not process unwanted data\r\n        '''\r\n        lFBM = &quot;.fbm&quot;\r\n        lBck = &quot;.bck&quot;\r\n        ##If The Folder Or Sub Folder Contains &quot;.fbm&quot; or &quot;.bck&quot; Within It\r\n        if lFBM in path or lBck in path:\r\n            pass\r\n        ##If The Folder Or Sub Folder Does Not Contain &quot;.fbm&quot; or &quot;.bck&quot; Within It\r\n        else:\r\n            for name in files:\r\n                ##Set A Variable To Isolate Each Files Extention\r\n                extension = os.path.splitext(name)&#x5B;1]\r\n                ##Define What To Do With Files That Have The Extention &quot;.fbx&quot;\r\n                if extension == &quot;.fbx&quot;:\r\n                    lfbxfile = os.path.join(path, name)\r\n                    '''\r\n                    This is where you state what you want to do to the .fbx file found.\r\n                    '''\r\n                    OpenFileAndListTakes(lfbxfile)\r\n                ##Define What To Do With Files Found That Have Another Extention    \r\n                else:\r\n                    pass \r\n\r\n##Run Function\r\nListFolderContent()\r\n<\/pre>\n<p>The above script printed the following out for me:<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n&gt;&gt;&gt; \r\nD:\\lookaround\\lookaround001.fbx\r\nTake 001\r\nTake 002\r\nTake 003\r\nTake 004\r\n&gt;&gt;&gt; \r\nD:\\lookaround\\lookaround002.fbx\r\nTake 001\r\nTake 002\r\nTake 003\r\nTake 004\r\n&gt;&gt;&gt; \r\nD:\\lookaround\\lookaround003.fbx\r\nTake 001\r\nTake 002\r\nTake 003\r\nTake 004\r\n&gt;&gt;&gt; \r\nD:\\lookaround\\lookaround004.fbx\r\nTake 001\r\nTake 002\r\nTake 003\r\nTake 004\r\n&gt;&gt;&gt; \r\n<\/pre>\n<p>This was a lot of fun to figure out, with this type of things your could get a count for every .fbx file you have or you could copy every .fbx file from one location to another, you could pretty much do any process you can think of within MotionBuilder and Python.<\/p>\n<p>I hope this helps.:)<\/p>\n<p><\/p><noscript class=\"ninja-forms-noscript-message\">\n\tNotice: JavaScript is required for this content.<\/noscript>\n<div id=\"nf-form-1-cont\" class=\"nf-form-cont\" aria-live=\"polite\" aria-labelledby=\"nf-form-title-1\" aria-describedby=\"nf-form-errors-1\" role=\"form\">\n\n    <div class=\"nf-loading-spinner\"><\/div>\n\n<\/div>\n        <!-- That data is being printed as a workaround to page builders reordering the order of the scripts loaded-->\n        <script>var formDisplay=1;var nfForms=nfForms||[];var form=[];form.id='1';form.settings={\"objectType\":\"Form Setting\",\"editActive\":\"\",\"title\":\"Contact Me\",\"key\":\"\",\"created_at\":\"2016-08-24 16:39:20\",\"default_label_pos\":\"above\",\"conditions\":[],\"show_title\":\"1\",\"clear_complete\":\"1\",\"hide_complete\":\"1\",\"wrapper_class\":\"\",\"element_class\":\"\",\"add_submit\":\"1\",\"logged_in\":\"\",\"not_logged_in_msg\":\"\",\"sub_limit_number\":\"\",\"sub_limit_msg\":\"\",\"calculations\":[],\"formContentData\":[\"name\",\"message\",\"submit\"],\"container_styles_background-color\":\"\",\"container_styles_border\":\"\",\"container_styles_border-style\":\"\",\"container_styles_border-color\":\"\",\"container_styles_color\":\"\",\"container_styles_height\":\"\",\"container_styles_width\":\"\",\"container_styles_font-size\":\"\",\"container_styles_margin\":\"\",\"container_styles_padding\":\"\",\"container_styles_display\":\"\",\"container_styles_float\":\"\",\"container_styles_show_advanced_css\":\"0\",\"container_styles_advanced\":\"\",\"title_styles_background-color\":\"\",\"title_styles_border\":\"\",\"title_styles_border-style\":\"\",\"title_styles_border-color\":\"\",\"title_styles_color\":\"\",\"title_styles_height\":\"\",\"title_styles_width\":\"\",\"title_styles_font-size\":\"\",\"title_styles_margin\":\"\",\"title_styles_padding\":\"\",\"title_styles_display\":\"\",\"title_styles_float\":\"\",\"title_styles_show_advanced_css\":\"0\",\"title_styles_advanced\":\"\",\"row_styles_background-color\":\"\",\"row_styles_border\":\"\",\"row_styles_border-style\":\"\",\"row_styles_border-color\":\"\",\"row_styles_color\":\"\",\"row_styles_height\":\"\",\"row_styles_width\":\"\",\"row_styles_font-size\":\"\",\"row_styles_margin\":\"\",\"row_styles_padding\":\"\",\"row_styles_display\":\"\",\"row_styles_show_advanced_css\":\"0\",\"row_styles_advanced\":\"\",\"row-odd_styles_background-color\":\"\",\"row-odd_styles_border\":\"\",\"row-odd_styles_border-style\":\"\",\"row-odd_styles_border-color\":\"\",\"row-odd_styles_color\":\"\",\"row-odd_styles_height\":\"\",\"row-odd_styles_width\":\"\",\"row-odd_styles_font-size\":\"\",\"row-odd_styles_margin\":\"\",\"row-odd_styles_padding\":\"\",\"row-odd_styles_display\":\"\",\"row-odd_styles_show_advanced_css\":\"0\",\"row-odd_styles_advanced\":\"\",\"success-msg_styles_background-color\":\"\",\"success-msg_styles_border\":\"\",\"success-msg_styles_border-style\":\"\",\"success-msg_styles_border-color\":\"\",\"success-msg_styles_color\":\"\",\"success-msg_styles_height\":\"\",\"success-msg_styles_width\":\"\",\"success-msg_styles_font-size\":\"\",\"success-msg_styles_margin\":\"\",\"success-msg_styles_padding\":\"\",\"success-msg_styles_display\":\"\",\"success-msg_styles_show_advanced_css\":\"0\",\"success-msg_styles_advanced\":\"\",\"error_msg_styles_background-color\":\"\",\"error_msg_styles_border\":\"\",\"error_msg_styles_border-style\":\"\",\"error_msg_styles_border-color\":\"\",\"error_msg_styles_color\":\"\",\"error_msg_styles_height\":\"\",\"error_msg_styles_width\":\"\",\"error_msg_styles_font-size\":\"\",\"error_msg_styles_margin\":\"\",\"error_msg_styles_padding\":\"\",\"error_msg_styles_display\":\"\",\"error_msg_styles_show_advanced_css\":\"0\",\"error_msg_styles_advanced\":\"\",\"currency\":\"\",\"unique_field_error\":\"A form with this value has already been submitted.\",\"ninjaForms\":\"Ninja Forms\",\"changeEmailErrorMsg\":\"Please enter a valid email address!\",\"changeDateErrorMsg\":\"Please enter a valid date!\",\"confirmFieldErrorMsg\":\"These fields must match!\",\"fieldNumberNumMinError\":\"Number Min Error\",\"fieldNumberNumMaxError\":\"Number Max Error\",\"fieldNumberIncrementBy\":\"Please increment by \",\"fieldTextareaRTEInsertLink\":\"Insert Link\",\"fieldTextareaRTEInsertMedia\":\"Insert Media\",\"fieldTextareaRTESelectAFile\":\"Select a file\",\"formErrorsCorrectErrors\":\"Please correct errors before submitting this form.\",\"formHoneypot\":\"If you are a human seeing this field, please leave it empty.\",\"validateRequiredField\":\"This is a required field.\",\"honeypotHoneypotError\":\"Honeypot Error\",\"fileUploadOldCodeFileUploadInProgress\":\"File Upload in Progress.\",\"fileUploadOldCodeFileUpload\":\"FILE UPLOAD\",\"currencySymbol\":\"$\",\"fieldsMarkedRequired\":\"Fields marked with an <span class=\\\"ninja-forms-req-symbol\\\">*<\\\/span> are required\",\"thousands_sep\":\",\",\"decimal_point\":\".\",\"siteLocale\":\"en\",\"dateFormat\":\"d\\\/m\\\/Y\",\"startOfWeek\":\"0\",\"of\":\"of\",\"previousMonth\":\"Previous Month\",\"nextMonth\":\"Next Month\",\"months\":[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],\"monthsShort\":[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],\"weekdays\":[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],\"weekdaysShort\":[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],\"weekdaysMin\":[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"],\"recaptchaConsentMissing\":\"reCaptcha validation couldn&#039;t load.\",\"recaptchaMissingCookie\":\"reCaptcha v3 validation couldn&#039;t load the cookie needed to submit the form.\",\"recaptchaConsentEvent\":\"Accept reCaptcha cookies before sending the form.\",\"embed_form\":\"\",\"currency_symbol\":\"\",\"beforeForm\":\"\",\"beforeFields\":\"\",\"afterFields\":\"\",\"afterForm\":\"\"};form.fields=[{\"objectType\":\"Field\",\"objectDomain\":\"fields\",\"editActive\":\"\",\"order\":1,\"label\":\"Name\",\"key\":\"name\",\"type\":\"textbox\",\"created_at\":\"2016-08-24 16:39:20\",\"label_pos\":\"above\",\"required\":1,\"placeholder\":\"\",\"default\":\"\",\"wrapper_class\":\"\",\"element_class\":\"\",\"container_class\":\"\",\"input_limit\":\"\",\"input_limit_type\":\"characters\",\"input_limit_msg\":\"Character(s) left\",\"manual_key\":\"\",\"disable_input\":\"\",\"admin_label\":\"\",\"help_text\":\"\",\"desc_text\":\"\",\"disable_browser_autocomplete\":\"\",\"mask\":\"\",\"custom_mask\":\"\",\"wrap_styles_background-color\":\"\",\"wrap_styles_border\":\"\",\"wrap_styles_border-style\":\"\",\"wrap_styles_border-color\":\"\",\"wrap_styles_color\":\"\",\"wrap_styles_height\":\"\",\"wrap_styles_width\":\"\",\"wrap_styles_font-size\":\"\",\"wrap_styles_margin\":\"\",\"wrap_styles_padding\":\"\",\"wrap_styles_display\":\"\",\"wrap_styles_float\":\"\",\"wrap_styles_show_advanced_css\":0,\"wrap_styles_advanced\":\"\",\"label_styles_background-color\":\"\",\"label_styles_border\":\"\",\"label_styles_border-style\":\"\",\"label_styles_border-color\":\"\",\"label_styles_color\":\"\",\"label_styles_height\":\"\",\"label_styles_width\":\"\",\"label_styles_font-size\":\"\",\"label_styles_margin\":\"\",\"label_styles_padding\":\"\",\"label_styles_display\":\"\",\"label_styles_float\":\"\",\"label_styles_show_advanced_css\":0,\"label_styles_advanced\":\"\",\"element_styles_background-color\":\"\",\"element_styles_border\":\"\",\"element_styles_border-style\":\"\",\"element_styles_border-color\":\"\",\"element_styles_color\":\"\",\"element_styles_height\":\"\",\"element_styles_width\":\"\",\"element_styles_font-size\":\"\",\"element_styles_margin\":\"\",\"element_styles_padding\":\"\",\"element_styles_display\":\"\",\"element_styles_float\":\"\",\"element_styles_show_advanced_css\":0,\"element_styles_advanced\":\"\",\"cellcid\":\"c3277\",\"id\":1,\"beforeField\":\"\",\"afterField\":\"\",\"value\":\"\",\"parentType\":\"textbox\",\"element_templates\":[\"textbox\",\"input\"],\"old_classname\":\"\",\"wrap_template\":\"wrap\"},{\"objectType\":\"Field\",\"objectDomain\":\"fields\",\"editActive\":\"\",\"order\":3,\"label\":\"Message\",\"key\":\"message\",\"type\":\"textarea\",\"created_at\":\"2016-08-24 16:39:20\",\"label_pos\":\"above\",\"required\":1,\"placeholder\":\"\",\"default\":\"\",\"wrapper_class\":\"\",\"element_class\":\"\",\"container_class\":\"\",\"input_limit\":\"\",\"input_limit_type\":\"characters\",\"input_limit_msg\":\"Character(s) left\",\"manual_key\":\"\",\"disable_input\":\"\",\"admin_label\":\"\",\"help_text\":\"\",\"desc_text\":\"\",\"disable_browser_autocomplete\":\"\",\"textarea_rte\":\"\",\"disable_rte_mobile\":\"\",\"textarea_media\":\"\",\"wrap_styles_background-color\":\"\",\"wrap_styles_border\":\"\",\"wrap_styles_border-style\":\"\",\"wrap_styles_border-color\":\"\",\"wrap_styles_color\":\"\",\"wrap_styles_height\":\"\",\"wrap_styles_width\":\"\",\"wrap_styles_font-size\":\"\",\"wrap_styles_margin\":\"\",\"wrap_styles_padding\":\"\",\"wrap_styles_display\":\"\",\"wrap_styles_float\":\"\",\"wrap_styles_show_advanced_css\":0,\"wrap_styles_advanced\":\"\",\"label_styles_background-color\":\"\",\"label_styles_border\":\"\",\"label_styles_border-style\":\"\",\"label_styles_border-color\":\"\",\"label_styles_color\":\"\",\"label_styles_height\":\"\",\"label_styles_width\":\"\",\"label_styles_font-size\":\"\",\"label_styles_margin\":\"\",\"label_styles_padding\":\"\",\"label_styles_display\":\"\",\"label_styles_float\":\"\",\"label_styles_show_advanced_css\":0,\"label_styles_advanced\":\"\",\"element_styles_background-color\":\"\",\"element_styles_border\":\"\",\"element_styles_border-style\":\"\",\"element_styles_border-color\":\"\",\"element_styles_color\":\"\",\"element_styles_height\":\"\",\"element_styles_width\":\"\",\"element_styles_font-size\":\"\",\"element_styles_margin\":\"\",\"element_styles_padding\":\"\",\"element_styles_display\":\"\",\"element_styles_float\":\"\",\"element_styles_show_advanced_css\":0,\"element_styles_advanced\":\"\",\"cellcid\":\"c3284\",\"id\":3,\"beforeField\":\"\",\"afterField\":\"\",\"value\":\"\",\"parentType\":\"textarea\",\"element_templates\":[\"textarea\",\"input\"],\"old_classname\":\"\",\"wrap_template\":\"wrap\"},{\"objectType\":\"Field\",\"objectDomain\":\"fields\",\"editActive\":\"\",\"order\":5,\"label\":\"Submit\",\"key\":\"submit\",\"type\":\"submit\",\"created_at\":\"2016-08-24 16:39:20\",\"processing_label\":\"Processing\",\"container_class\":\"\",\"element_class\":\"\",\"wrap_styles_background-color\":\"\",\"wrap_styles_border\":\"\",\"wrap_styles_border-style\":\"\",\"wrap_styles_border-color\":\"\",\"wrap_styles_color\":\"\",\"wrap_styles_height\":\"\",\"wrap_styles_width\":\"\",\"wrap_styles_font-size\":\"\",\"wrap_styles_margin\":\"\",\"wrap_styles_padding\":\"\",\"wrap_styles_display\":\"\",\"wrap_styles_float\":\"\",\"wrap_styles_show_advanced_css\":0,\"wrap_styles_advanced\":\"\",\"label_styles_background-color\":\"\",\"label_styles_border\":\"\",\"label_styles_border-style\":\"\",\"label_styles_border-color\":\"\",\"label_styles_color\":\"\",\"label_styles_height\":\"\",\"label_styles_width\":\"\",\"label_styles_font-size\":\"\",\"label_styles_margin\":\"\",\"label_styles_padding\":\"\",\"label_styles_display\":\"\",\"label_styles_float\":\"\",\"label_styles_show_advanced_css\":0,\"label_styles_advanced\":\"\",\"element_styles_background-color\":\"\",\"element_styles_border\":\"\",\"element_styles_border-style\":\"\",\"element_styles_border-color\":\"\",\"element_styles_color\":\"\",\"element_styles_height\":\"\",\"element_styles_width\":\"\",\"element_styles_font-size\":\"\",\"element_styles_margin\":\"\",\"element_styles_padding\":\"\",\"element_styles_display\":\"\",\"element_styles_float\":\"\",\"element_styles_show_advanced_css\":0,\"element_styles_advanced\":\"\",\"submit_element_hover_styles_background-color\":\"\",\"submit_element_hover_styles_border\":\"\",\"submit_element_hover_styles_border-style\":\"\",\"submit_element_hover_styles_border-color\":\"\",\"submit_element_hover_styles_color\":\"\",\"submit_element_hover_styles_height\":\"\",\"submit_element_hover_styles_width\":\"\",\"submit_element_hover_styles_font-size\":\"\",\"submit_element_hover_styles_margin\":\"\",\"submit_element_hover_styles_padding\":\"\",\"submit_element_hover_styles_display\":\"\",\"submit_element_hover_styles_float\":\"\",\"submit_element_hover_styles_show_advanced_css\":0,\"submit_element_hover_styles_advanced\":\"\",\"cellcid\":\"c3287\",\"id\":4,\"beforeField\":\"\",\"afterField\":\"\",\"value\":\"\",\"label_pos\":\"above\",\"parentType\":\"textbox\",\"element_templates\":[\"submit\",\"button\",\"input\"],\"old_classname\":\"\",\"wrap_template\":\"wrap-no-label\"}];nfForms.push(form);<\/script>\n        ","protected":false},"excerpt":{"rendered":"<p>It&#8217;s been awhile since I have posted, We are approaching launch of my next game tittle and now that I have a free moment I thought I would demonstrate how to run a python script on multiple &#8220;.fbx&#8221; files. All the &#8220;.fbx&#8221; files for this demo will exist within the same directory. ##Set Your Root [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":476,"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\/2018\/03\/Possibility.jpg?fit=960%2C627","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8pltq-7z","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":498,"url":"http:\/\/www.vicdebaie.com\/blog\/copying-fbx-files-with-python\/","url_meta":{"origin":469,"position":0},"title":"Copying .fbx Files With Python","author":"admin","date":"March 9, 2018","format":false,"excerpt":"\u00a0 When dealing with a lot of .fbx files we some times have to move them or back them up. Maybe a mocap shot was delivered and you want to move them off a network and on to your local drive to process or maybe it's the end of a\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\/03\/copy.png?fit=691%2C720&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":276,"url":"http:\/\/www.vicdebaie.com\/blog\/saving-motionbuilder-character-animation-with-python\/","url_meta":{"origin":469,"position":1},"title":"Saving MotionBuilder Character Animation with Python","author":"admin","date":"April 5, 2017","format":false,"excerpt":"When I get Mocap it's usually in a messy scene. Optics, Markets, strange NameSpace, etc. they all can bog down a scene. One of the first thing I do is save out the Character Animation and load it back into a clean scene. Using Python to save out Character Animation\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\/03\/img_4059-1.jpg?fit=300%2C200&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":190,"url":"http:\/\/www.vicdebaie.com\/blog\/motionbuilder-python-tool-saveit\/","url_meta":{"origin":469,"position":2},"title":"MotionBuilder Python Tool &#8220;SaveIt&#8221;","author":"admin","date":"February 12, 2017","format":false,"excerpt":"Here is a script\/tool I created for MotionBuilder using Python. \u00a0This tool will\u00a0do an incremental save of your scene. Why? Incremental saves are amazingly useful, I thought a tool that automates the process down to one click would be fun. A big thanks goes out to my college Raphael Lappiere\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\/SaveIt_tool.jpg?fit=600%2C220&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":288,"url":"http:\/\/www.vicdebaie.com\/blog\/getting-information-on-motionbuilders-python-with-dir\/","url_meta":{"origin":469,"position":3},"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":345,"url":"http:\/\/www.vicdebaie.com\/blog\/finding-a-characters-namespace-with-motionbuilder-python\/","url_meta":{"origin":469,"position":4},"title":"Finding a Character&#8217;s NameSpace with MotionBuilder Python","author":"admin","date":"April 25, 2017","format":false,"excerpt":"Here is a snippet of script that I use a lot when dealing with Character's Name Spaces within MotionBuilder. [code language=\"python\"] ##Setup variables to get all characters within the scene lAllChars = FBSystem().Scene.Characters ##Setup a variable to get the length of lAllChars - this will be used to creat a\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\/12463-nametag600.jpg?fit=950%2C534&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2017\/04\/12463-nametag600.jpg?fit=950%2C534&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.vicdebaie.com\/blog\/wp-content\/uploads\/2017\/04\/12463-nametag600.jpg?fit=950%2C534&resize=700%2C400 2x"},"classes":[]},{"id":336,"url":"http:\/\/www.vicdebaie.com\/blog\/how-to-use-functions-with-motionbuilder-python\/","url_meta":{"origin":469,"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\/469"}],"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=469"}],"version-history":[{"count":15,"href":"http:\/\/www.vicdebaie.com\/blog\/wp-json\/wp\/v2\/posts\/469\/revisions"}],"predecessor-version":[{"id":485,"href":"http:\/\/www.vicdebaie.com\/blog\/wp-json\/wp\/v2\/posts\/469\/revisions\/485"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.vicdebaie.com\/blog\/wp-json\/wp\/v2\/media\/476"}],"wp:attachment":[{"href":"http:\/\/www.vicdebaie.com\/blog\/wp-json\/wp\/v2\/media?parent=469"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.vicdebaie.com\/blog\/wp-json\/wp\/v2\/categories?post=469"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.vicdebaie.com\/blog\/wp-json\/wp\/v2\/tags?post=469"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}