{"id":1,"date":"2010-10-23T10:01:47","date_gmt":"2010-10-23T10:01:47","guid":{"rendered":"http:\/\/weegreenblobbie.com\/?p=1"},"modified":"2015-03-08T18:29:51","modified_gmt":"2015-03-08T18:29:51","slug":"hello-world","status":"publish","type":"post","link":"https:\/\/weegreenblobbie.com\/?p=1","title":{"rendered":"How To Use Macros And Blender"},"content":{"rendered":"<p>I wanted a way to perform a &#8220;Repeat Last Action&#8221; command in Blender.\u00a0 I found an easy way to do it on Ubuntu Linux with a little tool called xmacro.\u00a0 Xmacro is a simple keyboard and mouse recording utility.\u00a0 It will record keystrokes that can be played back at a later time.\u00a0 It is quite old but it works with a little help.<\/p>\n<p><strong>Step 1. Install Xmacro<\/strong><\/p>\n<blockquote><p>$ sudo apt-get install xmacro<\/p><\/blockquote>\n<p><strong>Step 2. Install Nick&#8217;s Helper Scripts<\/strong><\/p>\n<p>Save these two scripts somewhere on your Linux box.<\/p>\n<p><strong><em>record_macro.bash<\/em>:<\/strong><\/p>\n<blockquote><p>#!\/usr\/bin\/env bash<\/p>\n<p>ESC_KEY_CODE=9<\/p>\n<p># A delay is needed to ensure all keys are released that<br \/>\n# activate the macro prior to recording.<\/p>\n<p>sleep 1.0<\/p>\n<p># Press escape to stop recording the macro.<br \/>\nxmacrorec2 -k $ESC_KEY_CODE | tee \/tmp\/temp_xmacro.txt<\/p><\/blockquote>\n<p><strong><em>play_macro.bash<\/em>:<\/strong><\/p>\n<blockquote><p>#!\/usr\/bin\/env bash<\/p>\n<p># WARNING, a delay is needed to ensure all keys are released<br \/>\n# that activate the macro playback, if a key is still being<br \/>\n# held on the keyboard, who knows what key combinations will<br \/>\n# play on your desktop!<\/p>\n<p>sleep 0.5<\/p>\n<p># A loop is used to control the playback speed.<\/p>\n<p>while read line; do<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo $line | xmacroplay $DISPLAY<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sleep 0.005\u00a0 # the delay between events<\/p>\n<p>done &lt; \/tmp\/temp_xmacro.txt<\/p><\/blockquote>\n<p><strong>Step 3. Assign Macro Scripts To The Keyboard<\/strong><\/p>\n<p>In Gnome, open up the keyboard shortcuts by selecting: System &#8211;&gt; Preferences &#8211;&gt; Keyboard Shortcuts<\/p>\n<p>Click on the Add button at the bottom.<\/p>\n<blockquote><p>Name: Record Macro<\/p>\n<p>Command: \/<em>install_path<\/em>\/record_macro.bash<\/p><\/blockquote>\n<p>where <em>install_path<\/em> is the location you saved the helper scripts.<\/p>\n<p>Next, assign a keyboard shortcut to &#8220;Record Macro&#8221;, I use<strong> CTRL+ALT+M<\/strong><\/p>\n<p>Click on the Add button again.<\/p>\n<blockquote><p>Name: Play Macro<\/p>\n<p>Command: \/<em>install_path<\/em>\/play_macro.bash<\/p><\/blockquote>\n<p>where <em>install_path<\/em> is the location you saved the helper scripts.<\/p>\n<p>Next, assign a keyboard shortcut to &#8220;Play Macro&#8221;, I use <strong>CTRL+ALT+P<\/strong><\/p>\n<p><strong>Step 4. Try It Out In Blender<\/strong><\/p>\n<p>Open Blender, with the default cube open, enter edit mode.<\/p>\n<p>We&#8217;ll record extruding two verticies.<\/p>\n<p>Select two verticies.<\/p>\n<p>Now press <strong>CTL+ALT+M<\/strong> to start macro recording.<\/p>\n<p>Press <strong>e<\/strong><\/p>\n<p>Press <strong>RETURN<\/strong><\/p>\n<p>Press <strong>x<\/strong><\/p>\n<p>Press <strong>1.0<\/strong><\/p>\n<p>Press <strong>RETURN<\/strong><\/p>\n<p>Press <strong>ESCAPE<\/strong><\/p>\n<p>Pressing ESCAPE will end macro recording.<\/p>\n<p>Now repeat the last action by pressing <strong>CTR+ALT+P<\/strong>.\u00a0 Make sure you release the keys on the keyboard while the macro plays!<\/p>\n<p>Enjoy!<\/p>\n<p>-Nick<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I wanted a way to perform a &#8220;Repeat Last Action&#8221; command in Blender.\u00a0 I found an easy way to do it on Ubuntu Linux with a little tool called xmacro.\u00a0 Xmacro is a simple keyboard and mouse recording utility.\u00a0 It &hellip; <a href=\"https:\/\/weegreenblobbie.com\/?p=1\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[11],"class_list":["post-1","post","type-post","status-publish","format-standard","hentry","category-computing","tag-blender"],"_links":{"self":[{"href":"https:\/\/weegreenblobbie.com\/index.php?rest_route=\/wp\/v2\/posts\/1","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/weegreenblobbie.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/weegreenblobbie.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/weegreenblobbie.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/weegreenblobbie.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1"}],"version-history":[{"count":32,"href":"https:\/\/weegreenblobbie.com\/index.php?rest_route=\/wp\/v2\/posts\/1\/revisions"}],"predecessor-version":[{"id":35,"href":"https:\/\/weegreenblobbie.com\/index.php?rest_route=\/wp\/v2\/posts\/1\/revisions\/35"}],"wp:attachment":[{"href":"https:\/\/weegreenblobbie.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/weegreenblobbie.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/weegreenblobbie.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}