{"id":15985,"date":"2021-10-11T13:24:44","date_gmt":"2021-10-11T11:24:44","guid":{"rendered":"https:\/\/manual.keyshot.com\/keyshot11\/?post_type=manual_documentation&#038;p=15985"},"modified":"2021-10-12T10:33:37","modified_gmt":"2021-10-12T08:33:37","slug":"scripting-cancelling-scripts","status":"publish","type":"manual_documentation","link":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/scripting-cancelling-scripts\/","title":{"rendered":"Scripting: Cancelling scripts"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Cancelling Scripts <sup>(GUI only)<\/sup><\/h2>\n\n\n\n<p><em>In general you can&#8217;t cancel a script<\/em> but certain operations can, such as importing a file or rendering an image, animation or XR. Cancelling in those situations means to cancel the dialog associated, like the rendering output window or import progress dialog.<\/p>\n\n\n\n<p>The only operations you can cancel are:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><em>lux.importFile()<\/em><\/li><li><em>lux.renderImage()<\/em><\/li><li><em>lux.renderFrames()<\/em><\/li><li><em>lux.renderAnimation()<\/em><\/li><li><em>lux.renderXR()<\/em><\/li><li><em>lux.encodeVideo()<\/em><\/li><\/ul>\n\n\n\n<p>Simply check the return value to see if it was <em>False<\/em> and therefore cancelled, or failed.<\/p>\n\n\n\n<p>Especially if you&#8217;re using a loop-structure you can do the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&gt;&gt;&gt; frames = 10\n&gt;&gt;&gt; for frame in range(1, frames + 1):\n        lux.setAnimationFrame(frame)\n        if not lux.renderImage(\"\/path\/to\/output.{}.png\".format(frame)):\n            break<\/code><\/pre>\n","protected":false},"author":29916,"featured_media":0,"parent":15964,"menu_order":20,"template":"","manualdocumentationcategory":[13],"manual_doc_tag":[],"class_list":["post-15985","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>Scripting: Cancelling scripts - 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\/scripting-cancelling-scripts\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Scripting: Cancelling scripts - KeyShot 11 Manual\" \/>\n<meta property=\"og:description\" content=\"Cancelling Scripts (GUI only) In general you can&#8217;t cancel a script but certain operations can, such as importing a file or rendering an image, animation or XR. Cancelling in those situations means to cancel the dialog associated, like the rendering output window or import progress dialog. The only operations you can cancel are: lux.importFile()lux.renderImage()lux.renderFrames()lux.renderAnimation()lux.renderXR()lux.encodeVideo() Simply [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/scripting-cancelling-scripts\/\" \/>\n<meta property=\"og:site_name\" content=\"KeyShot 11 Manual\" \/>\n<meta property=\"article:modified_time\" content=\"2021-10-12T08:33:37+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=\"1 minute\" \/>\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\\\/scripting-cancelling-scripts\\\/\",\"url\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/manual\\\/scripting\\\/quick-start-scripting\\\/scripting-cancelling-scripts\\\/\",\"name\":\"Scripting: Cancelling scripts - KeyShot 11 Manual\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/#website\"},\"datePublished\":\"2021-10-11T11:24:44+00:00\",\"dateModified\":\"2021-10-12T08:33:37+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/manual\\\/scripting\\\/quick-start-scripting\\\/scripting-cancelling-scripts\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/manual\\\/scripting\\\/quick-start-scripting\\\/scripting-cancelling-scripts\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/manual\\\/scripting\\\/quick-start-scripting\\\/scripting-cancelling-scripts\\\/#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\",\"item\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/manual\\\/scripting\\\/quick-start-scripting\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Scripting: Cancelling scripts\"}]},{\"@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":"Scripting: Cancelling scripts - 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\/scripting-cancelling-scripts\/","og_locale":"en_US","og_type":"article","og_title":"Scripting: Cancelling scripts - KeyShot 11 Manual","og_description":"Cancelling Scripts (GUI only) In general you can&#8217;t cancel a script but certain operations can, such as importing a file or rendering an image, animation or XR. Cancelling in those situations means to cancel the dialog associated, like the rendering output window or import progress dialog. The only operations you can cancel are: lux.importFile()lux.renderImage()lux.renderFrames()lux.renderAnimation()lux.renderXR()lux.encodeVideo() Simply [&hellip;]","og_url":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/scripting-cancelling-scripts\/","og_site_name":"KeyShot 11 Manual","article_modified_time":"2021-10-12T08:33:37+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/scripting-cancelling-scripts\/","url":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/scripting-cancelling-scripts\/","name":"Scripting: Cancelling scripts - KeyShot 11 Manual","isPartOf":{"@id":"https:\/\/manual.keyshot.com\/keyshot11\/#website"},"datePublished":"2021-10-11T11:24:44+00:00","dateModified":"2021-10-12T08:33:37+00:00","breadcrumb":{"@id":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/scripting-cancelling-scripts\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/scripting-cancelling-scripts\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/scripting-cancelling-scripts\/#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","item":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/"},{"@type":"ListItem","position":4,"name":"Scripting: Cancelling scripts"}]},{"@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\/15985","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\/15985\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/manual.keyshot.com\/keyshot11\/wp-json\/wp\/v2\/manual_documentation\/15964"}],"wp:attachment":[{"href":"https:\/\/manual.keyshot.com\/keyshot11\/wp-json\/wp\/v2\/media?parent=15985"}],"wp:term":[{"taxonomy":"manualdocumentationcategory","embeddable":true,"href":"https:\/\/manual.keyshot.com\/keyshot11\/wp-json\/wp\/v2\/manualdocumentationcategory?post=15985"},{"taxonomy":"manual_doc_tag","embeddable":true,"href":"https:\/\/manual.keyshot.com\/keyshot11\/wp-json\/wp\/v2\/manual_doc_tag?post=15985"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}