{"id":15964,"date":"2021-10-04T09:57:39","date_gmt":"2021-10-04T07:57:39","guid":{"rendered":"https:\/\/manual.keyshot.com\/keyshot11\/?post_type=manual_documentation&#038;p=15964"},"modified":"2022-03-15T10:42:32","modified_gmt":"2022-03-15T09:42:32","slug":"quick-start-scripting","status":"publish","type":"manual_documentation","link":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/","title":{"rendered":"Quick Start Scripting"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_83 ez-toc-wrap-right counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">On this page<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a302c20d1789\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #ffffff;color:#ffffff\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #ffffff;color:#ffffff\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a302c20d1789\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/#Quick_Start_Guide\" >Quick Start Guide<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/#Console\" >Console<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/#Script_Library\" >Script Library<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/#General_help\" >General help<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n<h2 class=\"wp-block-heading\" id=\"quick-start-guide\"><span class=\"ez-toc-section\" id=\"Quick_Start_Guide\"><\/span>Quick Start Guide<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>There are three ways of using scripting:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Live scripting console<\/li><li>Scripts in the script library<\/li><li>Running KeyShot on the command-line: <code>keyshot.exe (optional file to open) -script &lt;python script file&gt; (optional script arguments..)<\/code><br><\/li><\/ol>\n\n\n\n<p>The first two are accessed via the scripting console dialog, which is opened via the menu &#8220;Window &gt; Scripting Console&#8221; or by clicking the scripting console button in the ribbon. In the dialog there are two tabs; &#8220;Console&#8221; and &#8220;Scripts&#8221;.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"console\"><span class=\"ez-toc-section\" id=\"Console\"><\/span>Console<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The console is a live python interpreter in which you can input python code to be evaluated.<\/p>\n\n\n\n<div class=\"wp-block-genesis-blocks-gb-columns gb-layout-columns-1 one-column\"><div class=\"gb-layout-column-wrap gb-block-layout-column-gap-2 gb-is-responsive-column\">\n<div class=\"wp-block-genesis-blocks-gb-column info-box gb-block-layout-column\"><div class=\"gb-block-layout-column-inner\">\n<h6 class=\"wp-block-heading\" id=\"note\">Note<\/h6>\n\n\n\n<p>KeyShot uses <a href=\"https:\/\/www.python.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">Python<\/a> 3.10 for scripting purposes.<\/p>\n<\/div><\/div>\n<\/div><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"script-library\"><span class=\"ez-toc-section\" id=\"Script_Library\"><\/span>Script Library<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The script library contains pre-made script bundled with KeyShot that are either directly useful or provides examples on how to do certain things. It is recommended to take a look in those files to learn more. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"general-help\"><span class=\"ez-toc-section\" id=\"General_help\"><\/span>General help<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In order to get help you can consult the online documentation or you can use the <em>help<\/em> function.<\/p>\n\n\n\n<p>Additionally, whenever lines appear like the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"\" class=\"\">&gt;&gt;&gt; print(\"Hello, World!\") # I am a comment\nHello, World!<\/code><\/pre>\n\n\n\n<p>Then it symbolizes interaction with the console where &#8220;&gt;&gt;&gt;&#8221; means python code as input, and otherwise it is output written to the console. Notice the comment after the <em>print<\/em>. Comments are always ignored by the python interpreter.<\/p>\n\n\n\n<p>There are two main modules for KeyShot scripting; <em><code>lux<\/code><\/em> and <em><code>luxmath<\/code><\/em>. To print help about the <em><code>lux<\/code><\/em> module, do the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"\" class=\"\">&gt;&gt;&gt; help(lux)\n(several lines omitted..)<\/code><\/pre>\n\n\n\n<p>It can also be used on functions to understand what they do:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"\" class=\"\">&gt;&gt;&gt; help(lux.pause)\nHelp on built-in function pause in module lux:\npause(...)\n    Pauses renderer.<\/code><\/pre>\n","protected":false},"author":29916,"featured_media":0,"parent":15962,"menu_order":3,"template":"","manualdocumentationcategory":[13],"manual_doc_tag":[],"class_list":["post-15964","manual_documentation","type-manual_documentation","status-publish","hentry","manualdocumentationcategory-keyshot"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Quick Start Scripting - KeyShot 11 Manual<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Quick Start Scripting - KeyShot 11 Manual\" \/>\n<meta property=\"og:description\" content=\"Quick Start Guide There are three ways of using scripting: Live scripting consoleScripts in the script libraryRunning KeyShot on the command-line: keyshot.exe (optional file to open) -script &lt;python script file&gt; (optional script arguments..) The first two are accessed via the scripting console dialog, which is opened via the menu &#8220;Window &gt; Scripting Console&#8221; or by [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/\" \/>\n<meta property=\"og:site_name\" content=\"KeyShot 11 Manual\" \/>\n<meta property=\"article:modified_time\" content=\"2022-03-15T09:42:32+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/manual\\\/scripting\\\/quick-start-scripting\\\/\",\"url\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/manual\\\/scripting\\\/quick-start-scripting\\\/\",\"name\":\"Quick Start Scripting - KeyShot 11 Manual\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/#website\"},\"datePublished\":\"2021-10-04T07:57:39+00:00\",\"dateModified\":\"2022-03-15T09:42:32+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/manual\\\/scripting\\\/quick-start-scripting\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/manual\\\/scripting\\\/quick-start-scripting\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/manual\\\/scripting\\\/quick-start-scripting\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Scripting\",\"item\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/manual\\\/scripting\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Quick Start Scripting\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/#website\",\"url\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/\",\"name\":\"KeyShot 11 Manual\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Quick Start Scripting - KeyShot 11 Manual","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/","og_locale":"en_US","og_type":"article","og_title":"Quick Start Scripting - KeyShot 11 Manual","og_description":"Quick Start Guide There are three ways of using scripting: Live scripting consoleScripts in the script libraryRunning KeyShot on the command-line: keyshot.exe (optional file to open) -script &lt;python script file&gt; (optional script arguments..) The first two are accessed via the scripting console dialog, which is opened via the menu &#8220;Window &gt; Scripting Console&#8221; or by [&hellip;]","og_url":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/","og_site_name":"KeyShot 11 Manual","article_modified_time":"2022-03-15T09:42:32+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/","url":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/","name":"Quick Start Scripting - KeyShot 11 Manual","isPartOf":{"@id":"https:\/\/manual.keyshot.com\/keyshot11\/#website"},"datePublished":"2021-10-04T07:57:39+00:00","dateModified":"2022-03-15T09:42:32+00:00","breadcrumb":{"@id":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/manual.keyshot.com\/keyshot11\/"},{"@type":"ListItem","position":2,"name":"Scripting","item":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/"},{"@type":"ListItem","position":3,"name":"Quick Start Scripting"}]},{"@type":"WebSite","@id":"https:\/\/manual.keyshot.com\/keyshot11\/#website","url":"https:\/\/manual.keyshot.com\/keyshot11\/","name":"KeyShot 11 Manual","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/manual.keyshot.com\/keyshot11\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/manual.keyshot.com\/keyshot11\/wp-json\/wp\/v2\/manual_documentation\/15964","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/manual.keyshot.com\/keyshot11\/wp-json\/wp\/v2\/manual_documentation"}],"about":[{"href":"https:\/\/manual.keyshot.com\/keyshot11\/wp-json\/wp\/v2\/types\/manual_documentation"}],"author":[{"embeddable":true,"href":"https:\/\/manual.keyshot.com\/keyshot11\/wp-json\/wp\/v2\/users\/29916"}],"version-history":[{"count":0,"href":"https:\/\/manual.keyshot.com\/keyshot11\/wp-json\/wp\/v2\/manual_documentation\/15964\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/manual.keyshot.com\/keyshot11\/wp-json\/wp\/v2\/manual_documentation\/15962"}],"wp:attachment":[{"href":"https:\/\/manual.keyshot.com\/keyshot11\/wp-json\/wp\/v2\/media?parent=15964"}],"wp:term":[{"taxonomy":"manualdocumentationcategory","embeddable":true,"href":"https:\/\/manual.keyshot.com\/keyshot11\/wp-json\/wp\/v2\/manualdocumentationcategory?post=15964"},{"taxonomy":"manual_doc_tag","embeddable":true,"href":"https:\/\/manual.keyshot.com\/keyshot11\/wp-json\/wp\/v2\/manual_doc_tag?post=15964"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}