{"id":15983,"date":"2021-10-11T13:10:03","date_gmt":"2021-10-11T11:10:03","guid":{"rendered":"https:\/\/manual.keyshot.com\/keyshot11\/?post_type=manual_documentation&#038;p=15983"},"modified":"2021-10-12T10:32:27","modified_gmt":"2021-10-12T08:32:27","slug":"scripting-import-file","status":"publish","type":"manual_documentation","link":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/scripting-import-file\/","title":{"rendered":"Scripting: Import file"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Import file <sup>(GUI and Headless)<\/sup><\/h2>\n\n\n\n<p>Importing models with scripting is easy:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&gt;&gt;&gt; lux.importFile(\"\/path\/to\/your\/file.obj\")<\/code><\/pre>\n\n\n\n<p>In this case we imported an OBJ file.<\/p>\n\n\n\n<p>By default no dialog will be shown with importing options, but it can be done using the <em>showOpts<\/em> option:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&gt;&gt;&gt; lux.importFile(\"\/path\/to\/your\/file.obj\", showOpts = True)<\/code><\/pre>\n\n\n\n<p>For more advanced importing, a Python dictionary can be supplied using the <em>opts<\/em> option. An example could be to disable snap-to-ground, and not adjusting environment and camera look-at on import:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&gt;&gt;&gt; opts = lux.getImportOptions()\n&gt;&gt;&gt; opts[\"snap_to_ground\"] = False\n&gt;&gt;&gt; opts[\"adjust_environment\"] = False\n&gt;&gt;&gt; opts[\"adjust_camera_look_at\"] = False\n&gt;&gt;&gt; lux.importFile(\"\/path\/to\/your\/file.obj\", opts = opts)<\/code><\/pre>\n\n\n\n<p>When updating geometry you will want to set the following options before importing:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&gt;&gt;&gt; opts[\"import_type\"] = 1\n&gt;&gt;&gt; opts[\"merge\"] = True<\/code><\/pre>\n","protected":false},"author":29916,"featured_media":0,"parent":15964,"menu_order":10,"template":"","manualdocumentationcategory":[13],"manual_doc_tag":[],"class_list":["post-15983","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: Import file - 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-import-file\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Scripting: Import file - KeyShot 11 Manual\" \/>\n<meta property=\"og:description\" content=\"Import file (GUI and Headless) Importing models with scripting is easy: In this case we imported an OBJ file. By default no dialog will be shown with importing options, but it can be done using the showOpts option: For more advanced importing, a Python dictionary can be supplied using the opts option. An example could [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/scripting-import-file\/\" \/>\n<meta property=\"og:site_name\" content=\"KeyShot 11 Manual\" \/>\n<meta property=\"article:modified_time\" content=\"2021-10-12T08:32:27+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-import-file\\\/\",\"url\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/manual\\\/scripting\\\/quick-start-scripting\\\/scripting-import-file\\\/\",\"name\":\"Scripting: Import file - KeyShot 11 Manual\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/#website\"},\"datePublished\":\"2021-10-11T11:10:03+00:00\",\"dateModified\":\"2021-10-12T08:32:27+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/manual\\\/scripting\\\/quick-start-scripting\\\/scripting-import-file\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/manual\\\/scripting\\\/quick-start-scripting\\\/scripting-import-file\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/manual.keyshot.com\\\/keyshot11\\\/manual\\\/scripting\\\/quick-start-scripting\\\/scripting-import-file\\\/#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: Import file\"}]},{\"@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: Import file - 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-import-file\/","og_locale":"en_US","og_type":"article","og_title":"Scripting: Import file - KeyShot 11 Manual","og_description":"Import file (GUI and Headless) Importing models with scripting is easy: In this case we imported an OBJ file. By default no dialog will be shown with importing options, but it can be done using the showOpts option: For more advanced importing, a Python dictionary can be supplied using the opts option. An example could [&hellip;]","og_url":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/scripting-import-file\/","og_site_name":"KeyShot 11 Manual","article_modified_time":"2021-10-12T08:32:27+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-import-file\/","url":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/scripting-import-file\/","name":"Scripting: Import file - KeyShot 11 Manual","isPartOf":{"@id":"https:\/\/manual.keyshot.com\/keyshot11\/#website"},"datePublished":"2021-10-11T11:10:03+00:00","dateModified":"2021-10-12T08:32:27+00:00","breadcrumb":{"@id":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/scripting-import-file\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/scripting-import-file\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/manual.keyshot.com\/keyshot11\/manual\/scripting\/quick-start-scripting\/scripting-import-file\/#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: Import file"}]},{"@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\/15983","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\/15983\/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=15983"}],"wp:term":[{"taxonomy":"manualdocumentationcategory","embeddable":true,"href":"https:\/\/manual.keyshot.com\/keyshot11\/wp-json\/wp\/v2\/manualdocumentationcategory?post=15983"},{"taxonomy":"manual_doc_tag","embeddable":true,"href":"https:\/\/manual.keyshot.com\/keyshot11\/wp-json\/wp\/v2\/manual_doc_tag?post=15983"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}