{"id":6212,"date":"2023-06-04T09:07:54","date_gmt":"2023-06-04T09:07:54","guid":{"rendered":"https:\/\/3dcoat.com\/documentation\/?post_type=manual_documentation&#038;p=6212"},"modified":"2026-02-22T16:37:35","modified_gmt":"2026-02-22T16:37:35","slug":"python-api","status":"publish","type":"manual_documentation","link":"https:\/\/3dcoat.com\/documentation\/manual\/scripting-and-core-api\/python-api\/","title":{"rendered":"Python API"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Description<\/h3>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<p>The <a href=\"https:\/\/pilgway.com\/files\/3dcoat\/PythonAPI\/index.html\" target=\"_blank\" rel=\"noreferrer noopener\">3DCoat Python API<\/a> is intended to trigger UI commands, operate over the scene, and create new tools. It is very similar to the C++ Core API, but has its own advantages and drawbacks.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>No need for any additional setup to make your scripts; Python is embedded into the 3DCoat distributive.<\/li>\n\n\n\n<li>Python is like a Swiss-knife, allowing you to bring the whole power of Python libraries into 3DCoat.<\/li>\n\n\n\n<li>Python is much slower than C++, so it may be used only for general management, not for deep and complex algorithms.<\/li>\n\n\n\n<li>If you are already familiar with the C++ Core API, the Python API is very similar, almost 1:1, with the same logic and function names.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><a><\/a>Usage<\/h3>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use&nbsp;<strong>Scripts-&gt;Create Python Script<\/strong>&nbsp;to create a new script. You may choose an initial template to start. The .py file will open in your current editor associated with .py files.<\/li>\n\n\n\n<li>Python on Windows has been moved to ProgramData, which avoids incorrect operation in some cases. <\/li>\n\n\n\n<li>If needed, you may create a file called requirements.txt with a list of used modules; in this case, the modules will be auto-installed before the script runs.<\/li>\n\n\n\n<li>We recommend Visual Studio Code, as it will automatically recognize 3DCoat-specialized commands syntax and offer the correct hints.<\/li>\n\n\n\n<li>Pay attention: the file <em>coat.pyi<\/em> located in the project folder is responsible for the coat module hints in Visual Studio. You may open that file, as it contains the list of all classes and commands, which may be helpful for quick reference.<\/li>\n\n\n\n<li>Use&nbsp;<strong>Extensions-&gt;Show Python Console<\/strong>&nbsp;to see the console output from Python. Currently this is the only way to debug script. Later we plan to add native debugging using the Visual Studio Code.<\/li>\n\n\n\n<li>You may install additional modules for Python using&nbsp;<strong>Scripts-&gt;Install Python Modules<\/strong>. Another way is to use requirements.txt in the same folder as the .py file&#8217;s location.<\/li>\n\n\n\n<li>Access to live booleans via the python\/CoreAPI.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><a><\/a>Main classes<\/h3>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<p>General I\/O:&nbsp;<a href=\"https:\/\/pilgway.com\/files\/3dcoat\/PythonAPI\/classcoat_1_1io.html\">coat.io<\/a><br \/>Dialog management:&nbsp;<a href=\"https:\/\/pilgway.com\/files\/3dcoat\/PythonAPI\/classcoat_1_1dialog.html\">coat.dialog<\/a><br \/>Mesh operations:&nbsp;<a href=\"https:\/\/pilgway.com\/files\/3dcoat\/PythonAPI\/classcoat_1_1_mesh.html\">coat.Mesh<\/a><br \/>Scene roots:&nbsp;<a href=\"https:\/\/pilgway.com\/files\/3dcoat\/PythonAPI\/classcoat_1_1_scene.html\">coat.Scene<\/a><br \/>Scene element:&nbsp;<a href=\"https:\/\/pilgway.com\/files\/3dcoat\/PythonAPI\/classcoat_1_1_scene_element.html\">coat.SceneElement<\/a><br \/>Volume management:&nbsp;<a href=\"https:\/\/pilgway.com\/files\/3dcoat\/PythonAPI\/classcoat_1_1_volume.html\">coat.Volume<\/a><br \/>UI management:&nbsp;<a href=\"https:\/\/pilgway.com\/files\/3dcoat\/PythonAPI\/classcoat_1_1ui.html\">coat.ui<\/a><br \/>2D-vectors math:&nbsp;<a href=\"https:\/\/pilgway.com\/files\/3dcoat\/PythonAPI\/classcoat_1_1vec2.html\">coat.vec2<\/a><br \/>3D-vectors math:&nbsp;<a href=\"https:\/\/pilgway.com\/files\/3dcoat\/PythonAPI\/classcoat_1_1vec3.html\">coat.vec3<\/a><br \/>4D-vectors math:&nbsp;<a href=\"https:\/\/pilgway.com\/files\/3dcoat\/PythonAPI\/classcoat_1_1vec4.html\">coat.vec4<\/a><br \/>3D-matrix math:&nbsp;<a href=\"https:\/\/pilgway.com\/files\/3dcoat\/PythonAPI\/classcoat_1_1mat3.html\">coat.mat3<\/a><br \/>4D-matrix math:&nbsp;<a href=\"https:\/\/pilgway.com\/files\/3dcoat\/PythonAPI\/classcoat_1_1mat4.html\">coat.mat4<\/a><br \/>Symmetry management:&nbsp;<a href=\"https:\/\/pilgway.com\/files\/3dcoat\/PythonAPI\/classcoat_1_1symm.html\">coat.symm<\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"parent":2379,"menu_order":3,"template":"","manualdocumentationcategory":[9],"manual_doc_tag":[40],"class_list":["post-6212","manual_documentation","type-manual_documentation","status-publish","hentry","manualdocumentationcategory-manual","manual_doc_tag-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python API - 3DCoat Documentation<\/title>\n<meta name=\"description\" content=\"Description of the Python API in 3DCoat: usage and main classes.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/3dcoat.com\/documentation\/manual\/scripting-and-core-api\/python-api\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python API - 3DCoat Documentation\" \/>\n<meta property=\"og:description\" content=\"Description of the Python API in 3DCoat: usage and main classes.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/3dcoat.com\/documentation\/manual\/scripting-and-core-api\/python-api\/\" \/>\n<meta property=\"og:site_name\" content=\"3DCoat Documentation\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/3DCoat\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-22T16:37:35+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@3DCoatOfficial\" \/>\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:\/\/3dcoat.com\/documentation\/manual\/scripting-and-core-api\/python-api\/\",\"url\":\"https:\/\/3dcoat.com\/documentation\/manual\/scripting-and-core-api\/python-api\/\",\"name\":\"Python API - 3DCoat Documentation\",\"isPartOf\":{\"@id\":\"https:\/\/3dcoat.com\/documentation\/#website\"},\"datePublished\":\"2023-06-04T09:07:54+00:00\",\"dateModified\":\"2026-02-22T16:37:35+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/3dcoat.com\/documentation\/manual\/scripting-and-core-api\/python-api\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/3dcoat.com\/documentation\/manual\/scripting-and-core-api\/python-api\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/3dcoat.com\/documentation\/manual\/scripting-and-core-api\/python-api\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/3dcoat.com\/documentation\/nl_NL\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Scripting & Core API\",\"item\":\"https:\/\/3dcoat.com\/documentation\/hu_HU\/manual\/scripting-and-core-api\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Python API\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/3dcoat.com\/documentation\/#website\",\"url\":\"https:\/\/3dcoat.com\/documentation\/\",\"name\":\"3DCoat Documentation\",\"description\":\"Information about starting to use and learning how to use all the features of the 3DCoat.\",\"publisher\":{\"@id\":\"https:\/\/3dcoat.com\/documentation\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/3dcoat.com\/documentation\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/3dcoat.com\/documentation\/#organization\",\"name\":\"Pilgway\",\"url\":\"https:\/\/3dcoat.com\/documentation\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/3dcoat.com\/documentation\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/3dcoat.com\/documentation\/wp-content\/uploads\/2022\/09\/logo3DCoatWhite-1.png\",\"contentUrl\":\"https:\/\/3dcoat.com\/documentation\/wp-content\/uploads\/2022\/09\/logo3DCoatWhite-1.png\",\"width\":876,\"height\":190,\"caption\":\"Pilgway\"},\"image\":{\"@id\":\"https:\/\/3dcoat.com\/documentation\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/3DCoat\",\"https:\/\/x.com\/3DCoatOfficial\",\"https:\/\/www.youtube.com\/c\/PILGWAY3DCoat\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python API - 3DCoat Documentation","description":"Description of the Python API in 3DCoat: usage and main classes.","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:\/\/3dcoat.com\/documentation\/manual\/scripting-and-core-api\/python-api\/","og_locale":"en_US","og_type":"article","og_title":"Python API - 3DCoat Documentation","og_description":"Description of the Python API in 3DCoat: usage and main classes.","og_url":"https:\/\/3dcoat.com\/documentation\/manual\/scripting-and-core-api\/python-api\/","og_site_name":"3DCoat Documentation","article_publisher":"https:\/\/www.facebook.com\/3DCoat","article_modified_time":"2026-02-22T16:37:35+00:00","twitter_card":"summary_large_image","twitter_site":"@3DCoatOfficial","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/3dcoat.com\/documentation\/manual\/scripting-and-core-api\/python-api\/","url":"https:\/\/3dcoat.com\/documentation\/manual\/scripting-and-core-api\/python-api\/","name":"Python API - 3DCoat Documentation","isPartOf":{"@id":"https:\/\/3dcoat.com\/documentation\/#website"},"datePublished":"2023-06-04T09:07:54+00:00","dateModified":"2026-02-22T16:37:35+00:00","breadcrumb":{"@id":"https:\/\/3dcoat.com\/documentation\/manual\/scripting-and-core-api\/python-api\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/3dcoat.com\/documentation\/manual\/scripting-and-core-api\/python-api\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/3dcoat.com\/documentation\/manual\/scripting-and-core-api\/python-api\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/3dcoat.com\/documentation\/nl_NL\/"},{"@type":"ListItem","position":2,"name":"Scripting & Core API","item":"https:\/\/3dcoat.com\/documentation\/hu_HU\/manual\/scripting-and-core-api\/"},{"@type":"ListItem","position":3,"name":"Python API"}]},{"@type":"WebSite","@id":"https:\/\/3dcoat.com\/documentation\/#website","url":"https:\/\/3dcoat.com\/documentation\/","name":"3DCoat Documentation","description":"Information about starting to use and learning how to use all the features of the 3DCoat.","publisher":{"@id":"https:\/\/3dcoat.com\/documentation\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/3dcoat.com\/documentation\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/3dcoat.com\/documentation\/#organization","name":"Pilgway","url":"https:\/\/3dcoat.com\/documentation\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/3dcoat.com\/documentation\/#\/schema\/logo\/image\/","url":"https:\/\/3dcoat.com\/documentation\/wp-content\/uploads\/2022\/09\/logo3DCoatWhite-1.png","contentUrl":"https:\/\/3dcoat.com\/documentation\/wp-content\/uploads\/2022\/09\/logo3DCoatWhite-1.png","width":876,"height":190,"caption":"Pilgway"},"image":{"@id":"https:\/\/3dcoat.com\/documentation\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/3DCoat","https:\/\/x.com\/3DCoatOfficial","https:\/\/www.youtube.com\/c\/PILGWAY3DCoat"]}]}},"_links":{"self":[{"href":"https:\/\/3dcoat.com\/documentation\/wp-json\/wp\/v2\/manual_documentation\/6212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/3dcoat.com\/documentation\/wp-json\/wp\/v2\/manual_documentation"}],"about":[{"href":"https:\/\/3dcoat.com\/documentation\/wp-json\/wp\/v2\/types\/manual_documentation"}],"author":[{"embeddable":true,"href":"https:\/\/3dcoat.com\/documentation\/wp-json\/wp\/v2\/users\/3"}],"version-history":[{"count":4,"href":"https:\/\/3dcoat.com\/documentation\/wp-json\/wp\/v2\/manual_documentation\/6212\/revisions"}],"predecessor-version":[{"id":13715,"href":"https:\/\/3dcoat.com\/documentation\/wp-json\/wp\/v2\/manual_documentation\/6212\/revisions\/13715"}],"up":[{"embeddable":true,"href":"https:\/\/3dcoat.com\/documentation\/wp-json\/wp\/v2\/manual_documentation\/2379"}],"wp:attachment":[{"href":"https:\/\/3dcoat.com\/documentation\/wp-json\/wp\/v2\/media?parent=6212"}],"wp:term":[{"taxonomy":"manualdocumentationcategory","embeddable":true,"href":"https:\/\/3dcoat.com\/documentation\/wp-json\/wp\/v2\/manualdocumentationcategory?post=6212"},{"taxonomy":"manual_doc_tag","embeddable":true,"href":"https:\/\/3dcoat.com\/documentation\/wp-json\/wp\/v2\/manual_doc_tag?post=6212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}