• 中文 (台灣)
  • 3DCoat文档
  • Chapters
    • Introduction to 3DCoat
    • Getting started
    • Interface
    • Brush Components
    • Workspaces Rooms
    • Scripting & Core API
    • 问题和答案
    • licensing
    • 培训教程
  • Pilgway
  • Products
    • 3DCoat
    • 3DCoatTextura
    • 3DCoatPrint
    • PBRLibrary
  • Blog Posts
  • Store
  • 中文 (台灣) 中文 (台灣)
    • English English
    • Українська Українська
    • Español Español
    • Deutsch Deutsch
    • Français Français
    • 日本語 日本語
    • Русский Русский
    • 한국어 한국어
    • Polski Polski
    • 中文 (中国) 中文 (中国)
    • Português Português
    • Italiano Italiano
    • Suomi Suomi
    • Svenska Svenska
    • Dansk Dansk
    • Slovenčina Slovenčina
    • Türkçe Türkçe
    • Nederlands Nederlands
    • Magyar Magyar
    • ไทย ไทย
    • हिन्दी हिन्दी
    • Ελληνικά Ελληνικά
    • Tiếng Việt Tiếng Việt
    • Lietuviškai Lietuviškai
    • Latviešu valoda Latviešu valoda
    • Eesti Eesti
    • Čeština Čeština
    • Română Română
    • Norsk Bokmål Norsk Bokmål
  • Creating 3D Character Using 3DCoat
  • Introduction to 3DCoat
  • Getting started
    • System requirements
    • Activating 3DCoat
    • Startup error
      • Startup error Mac
    • Upgrading permanent license
    • Linux Setup
      • Linux initial setup per-user installation
      • Linux initial setup for system
      • Tablet setup
      • To GTK3 from GTK2
    • Folders Structure
      • Custom documents folder
    • Different Forms of “Resolution”
    • Import and Export
    • Applinks in 3DCoat
      • Blender 4.1 applink
        • Blender with the Applink in Linux
      • Blender 4.2/3 applink
      • Max Applink
      • Houdini applink
      • Lightwave uplink
  • Navigation
    • Opening Dialog (Quick Start Menu)
    • Navigation Panel
    • Camera and Navigation
      • Customize Navigation as Blender
    • Viewport Navigation Gizmo
    • Left tool panel
    •  Activity Bar
    • Navigation using 3DConnexion devices
      • How to compile Spacenavd on non Ubuntu distro
    • Stylus doesn’t work in sculpting
    • Hotkeys
  • Interface
    • File
    • Edit
      • Calculate Curvature
      • Calculate Occlusion
      • Light Baking Tool
      • Preferences
    • View
    • Symmetry
    • Textures
    • Calculate
    • Layers
    • Freeze
    • Hide
    • Bake
    • Curves
      • Curves editor
      • Fill with mesh layer
      • Scale of imported curves
    • Windows
      • Tabbed and Popup Panels
      • Controls
    • Scripts
    • Addons
    • Capture
    • Help
    • Room Customization
    • Modify or Create new Room
  • Brush Components
    • Brushes general use
      • Create alpha brushes and decals
      • Making alpha from current sculpt
      • Create a Brush from a 3D Object
      • Create brushes based on Curves
      • Load photoshop .abr brushes
    • Strokes
      • Curves Popup Menu
    • Brush Options panel
    • Brush Top Bar
    • Conditions Limiter
    • Strips Panel
    • Stencils Panel
    • Smart Materials
      • Add new images or materials
      • Attach a Smart material to a layer
      • Import Quixel Material
    • Presets for Brush alphas
  • Workspaces Rooms
    • Paint
      • Texture Painting & Modes
        • Per Pixel Painting
        • Displacement Painting (Micro-Vertex)
        • Ptex Painting
        • Surface Painting (Vertex painting)
      • Importing Into the Painting Room
        • Initial CC subdivision
        • UV Set smoothing
        • Sharp (hard) edge
        • Lock Normals
        • Load new UV layout After Model Changes
        • DAZ Genesis models into 3DCoat
      • Paint Menus
        • Edit menu
        • Textures Menu
          • Texture Baking Tools
        • Hide
        • Bake Paint menu
        • The Color Picker
      • Top Bar for the Painting
      • The Layers Panel
        • The Blending Panel
        • Layer and Clipping Masks
      • Left Tool Panel
      • Opacity & Transparency
      • Tweak tools
        • Tweak Toolset
        • Exporting from the Tweak Room
      • Stencil & Material preview panel
      • Exporting from the Painting Room
    • UV
      • UV Top Bar
      • UV Left tool panel
      • UV Preview Panel
      • UV workflow example
      • Importing Into the UV Room
      • Exporting from the UV Room
    • Retopology
      • Importing into Retopo Room
      • Retopo Mesh Menu
        • Virtual Mirror Mode
      • Bake menu
        • Autopo Baking guide
        • Baking guide
      • Top Bar
        • Select geometry
      • Left tool panel
        • Overall Purpose & Function
        • Add Geometry in the retopology room
          • Strokes tool in Retopology
        • Tweak Tools
        • UV Tools
        • Commands for Retopology room
      • AUTORETOPO
        • Autoretopology Guide
      • Poly Groups
    • Sculpt
      • Sculpt Tree
      • Sculpt Layer
      • Brush engine
      • Sculpt Brush options
      • Right mouse button menu
      • Geometry menu
      • Shader
      • Voxel mode
        • Pure Voxel Sculpting
        • Density and Resolution
        • Clay Engine
        • Right-Click Menu
        • Voxel Tools
        • Surface tools on Voxels
        • Voxel Adjustment Tools
        • Volumetric Painting
        • Transform Tools
        • Voxel Objects Tools
          • Voxel Primitives & Import Tools
      • Surface mode
        • Surface tools
        • Surface custom tools
        • Surface adjust tools
        • Surface transform tools
        • Surface Painting
        • Surface Objects Tools
          • Sculpt Primitives & Import Tools
        • Multi Level Resolution
          • Multires tools
          • Multires adjust
          • Multires commands
        • Right-Click Menu
      • Sculpt curves
        • Spline Curves
        • Splines model creation
      • Commands for Sculpt room
      • Vector Displacement
      • Live Booleans
      • Import to Sculpt Room
      • Exporting from the Sculpt Room
    • Render
      • Comparison of different roughness values
      • Render Panel Functions
      • Turntable
      • Fakebake the lighting -non PBR-
    • Factures
      • Workflow
    • Simplest
    • Modeling
      • Mesh Menu
      • Left tool panel
        • Add Geometry
        • Tweak
        • UV panel
        • Commands panel
        • Selected
        • Entire Mesh
      • Loft surface example by Fluffy
      • Blockout by Poeboi
      • Import Zbrush Polygroups for UV mapping
    • Kitbash
    • 3DPrint
    • Photogrammetry
      • How to install Reality Capture
      • Reality Capture doesn’t show up ?
    • Nurbs
    • Nodes
      • Sculpt shader Nodes Library
  • Scripting & Core API
    • Scripting
    • Core API
    • Python API
  • Free 3DCoatPrint
Expand All Collapse All
  • Introduction to 3DCoat
  • Getting started
    • System requirements
    • Activating 3DCoat
    • Startup error
      • Startup error Mac
    • Upgrading permanent license
    • Linux Setup
      • Linux initial setup per-user installation
      • Linux initial setup for system
      • Tablet setup
      • To GTK3 from GTK2
    • Folders Structure
      • Custom documents folder
    • Different Forms of “Resolution”
    • Import and Export
    • Applinks in 3DCoat
      • Blender 4.1 applink
        • Blender with the Applink in Linux
      • Blender 4.2/3 applink
      • Max Applink
      • Houdini applink
      • Lightwave uplink
  • Navigation
    • Opening Dialog (Quick Start Menu)
    • Navigation Panel
    • Camera and Navigation
      • Customize Navigation as Blender
    • Viewport Navigation Gizmo
    • Left tool panel
    •  Activity Bar
    • Navigation using 3DConnexion devices
      • How to compile Spacenavd on non Ubuntu distro
    • Stylus doesn’t work in sculpting
    • Hotkeys
  • Interface
    • File
    • Edit
      • Calculate Curvature
      • Calculate Occlusion
      • Light Baking Tool
      • Preferences
    • View
    • Symmetry
    • Textures
    • Calculate
    • Layers
    • Freeze
    • Hide
    • Bake
    • Curves
      • Curves editor
      • Fill with mesh layer
      • Scale of imported curves
    • Windows
      • Tabbed and Popup Panels
      • Controls
    • Scripts
    • Addons
    • Capture
    • Help
    • Room Customization
    • Modify or Create new Room
  • Brush Components
    • Brushes general use
      • Create alpha brushes and decals
      • Making alpha from current sculpt
      • Create a Brush from a 3D Object
      • Create brushes based on Curves
      • Load photoshop .abr brushes
    • Strokes
      • Curves Popup Menu
    • Brush Options panel
    • Brush Top Bar
    • Conditions Limiter
    • Strips Panel
    • Stencils Panel
    • Smart Materials
      • Add new images or materials
      • Attach a Smart material to a layer
      • Import Quixel Material
    • Presets for Brush alphas
  • Workspaces Rooms
    • Paint
      • Texture Painting & Modes
        • Per Pixel Painting
        • Displacement Painting (Micro-Vertex)
        • Ptex Painting
        • Surface Painting (Vertex painting)
      • Importing Into the Painting Room
        • Initial CC subdivision
        • UV Set smoothing
        • Sharp (hard) edge
        • Lock Normals
        • Load new UV layout After Model Changes
        • DAZ Genesis models into 3DCoat
      • Paint Menus
        • Edit menu
        • Textures Menu
          • Texture Baking Tools
        • Hide
        • Bake Paint menu
        • The Color Picker
      • Top Bar for the Painting
      • The Layers Panel
        • The Blending Panel
        • Layer and Clipping Masks
      • Left Tool Panel
      • Opacity & Transparency
      • Tweak tools
        • Tweak Toolset
        • Exporting from the Tweak Room
      • Stencil & Material preview panel
      • Exporting from the Painting Room
    • UV
      • UV Top Bar
      • UV Left tool panel
      • UV Preview Panel
      • UV workflow example
      • Importing Into the UV Room
      • Exporting from the UV Room
    • Retopology
      • Importing into Retopo Room
      • Retopo Mesh Menu
        • Virtual Mirror Mode
      • Bake menu
        • Autopo Baking guide
        • Baking guide
      • Top Bar
        • Select geometry
      • Left tool panel
        • Overall Purpose & Function
        • Add Geometry in the retopology room
          • Strokes tool in Retopology
        • Tweak Tools
        • UV Tools
        • Commands for Retopology room
      • AUTORETOPO
        • Autoretopology Guide
      • Poly Groups
    • Sculpt
      • Sculpt Tree
      • Sculpt Layer
      • Brush engine
      • Sculpt Brush options
      • Right mouse button menu
      • Geometry menu
      • Shader
      • Voxel mode
        • Pure Voxel Sculpting
        • Density and Resolution
        • Clay Engine
        • Right-Click Menu
        • Voxel Tools
        • Surface tools on Voxels
        • Voxel Adjustment Tools
        • Volumetric Painting
        • Transform Tools
        • Voxel Objects Tools
          • Voxel Primitives & Import Tools
      • Surface mode
        • Surface tools
        • Surface custom tools
        • Surface adjust tools
        • Surface transform tools
        • Surface Painting
        • Surface Objects Tools
          • Sculpt Primitives & Import Tools
        • Multi Level Resolution
          • Multires tools
          • Multires adjust
          • Multires commands
        • Right-Click Menu
      • Sculpt curves
        • Spline Curves
        • Splines model creation
      • Commands for Sculpt room
      • Vector Displacement
      • Live Booleans
      • Import to Sculpt Room
      • Exporting from the Sculpt Room
    • Render
      • Comparison of different roughness values
      • Render Panel Functions
      • Turntable
      • Fakebake the lighting -non PBR-
    • Factures
      • Workflow
    • Simplest
    • Modeling
      • Mesh Menu
      • Left tool panel
        • Add Geometry
        • Tweak
        • UV panel
        • Commands panel
        • Selected
        • Entire Mesh
      • Loft surface example by Fluffy
      • Blockout by Poeboi
      • Import Zbrush Polygroups for UV mapping
    • Kitbash
    • 3DPrint
    • Photogrammetry
      • How to install Reality Capture
      • Reality Capture doesn’t show up ?
    • Nurbs
    • Nodes
      • Sculpt shader Nodes Library
  • Scripting & Core API
    • Scripting
    • Core API
    • Python API
  • Free 3DCoatPrint

Python API

625 views 1

Written by Carlos
June 4, 2023

Description

The 3DCoat Python API 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.

  • No need for any additional setup to make your scripts; Python is embedded into the 3DCoat distributive.
  • Python is like a Swiss-knife, allowing you to bring the whole power of Python libraries into 3DCoat.
  • Python is much slower than C++, so it may be used only for general management, not for deep and complex algorithms.
  • 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.

Usage

  • Use Scripts->Create Python Script 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.
  • We use embedded Python 3.8.10 to operate. This is the last Python version that may run on Windows 7.
  • 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.
  • We recommend Visual Studio Code, as it will automatically recognize 3DCoat-specialized commands syntax and offer the correct hints.
  • Pay attention: the file coat.pyi 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.
  • Use Scripts->Show Python Console to see the console output from Python. Currently this is the only way to debug scripth. Later we plan to add native debugging using the Visual Studio Code.
  • You may install additional modules for Python using Scripts->Install Python Modules. Another way is to use requirements.txt in the same folder as the .py file’s location.
  • Access to live booleans via the python/CoreAPI.

Main classes

General I/O: coat.io
Dialog management: coat.dialog
Mesh operations: coat.Mesh
Scene roots: coat.Scene
Scene element: coat.SceneElement
Volume management: coat.Volume
UI management: coat.ui
2D-vectors math: coat.vec2
3D-vectors math: coat.vec3
4D-vectors math: coat.vec4
3D-matrix math: coat.mat3
4D-matrix math: coat.mat4
Symmetry management: coat.symm

Tags:python

Was this helpful?

1 Yes  No
Related Articles
  • 3DPrint
  • Nodes
  • Create brushes based on Curves
  • Right-Click Menu
  • Baking guide
  • Autopo Baking guide
Previously
Core API
Up Next
Free 3DCoatPrint
AI:
Hi! How can I help you?
Attention: This is a beta version of AI chat. Some answers may be wrong. See full version of AI chat