Editor Configuration

Explains how to configure a code editor for ZBrush script development.

The ZBrush SDK can be used with any editor (that ideally supports autocompletion), such as Visual Studio Code, PyCharm or Sublime Text. This manual explains how to setup Visual Studio Code, as it is the recommended editor to use with ZBrush.

Installation

The listed components are recommended for developing ZBrush scripts. All listed components are free of charge and provided by Microsoft.

Component

Description

Visual Studio Code

A free, open-source, and cross-platform code editor with a rich ecosystem of extensions.

Python Extension

Extension that provides Python language support and features such as code completion, linting, and debugging for Visual Studio Code.

Pylance Extension

An optional extension that provides better performance and more features for Python language support, including improved type checking and code analysis for Visual Studio Code.

autopep8 Extension

An optional extension that can be used to consistently format Python code to conform to the PEP 8 style guide for Visual Studio Code.

Configuration

We now must configure Visual Studio Code for a good development experience with ZBrush. Open the JSON setting of VS Code by pressing Shift + Command + P (Mac) or Ctrl + Shift + P (Windows/Linux), and then type Preferences: Open Settings (JSON) and press Enter. With your users settings JSON file opened, add or modify the following settings and then save the file. You can technically also set all settings via the VS Code settingGUI, but this is more time consuming.

{
    // --- Mandatory Settings for Autocompletion -------------------------------------------------------------------

    // Setup the autocompletion by linking to the API definitions shipped with the ZBrush SDK. Note that you can
    // add both Windows and MacOS paths at the same time when you are using on multiple platforms under the same
    // user account.
    "python.analysis.extraPaths": [
        "/Users/alice/Documents/ZBrush SDK 2026.0.0/api", // example path for MacOS
        "C:\\Users\\alice\\Documents\\ZBrush SDK 2026.0.0\\api" // example path for Windows
    ],

    // --- Optional Settings (not required but recommended) --------------------------------------------------------

    // Also point the linter to the ZBrush API definitions. Not really needed at the moment due to the simplicity
    // of the API (only required when using Pylance).
    "python.analysis.extraPaths": [
        "/Users/alice/Documents/ZBrush SDK 2026.0.0/api/", // example path for MacOS
        "C:\\Users\\alice\\Documents\\ZBrush SDK 2026.0.0\\api" // example path for Windows
    ],

    // Use autopep8 as the default formatter for Python files (only required when using autopep8).
    "python.formatting.provider": "autopep8",

    // The pep8 specification enforces a 79 characters line length limit by default, which is not very practical
    // for modern needs. We set it to 120 characters instead (only required when using autopep8).
    "python.formatting.autopep8Args": ["--max-line-length", "120"],

    // Insert a ruler at 120 characters, as a visual indicator for the line length limit.
    "editor.rulers": [120],

    // Use four spaces for indentation in Python files (this is the default for Python files of VS Code).
    "[python]": {
        "editor.tabSize": 4,
        "editor.insertSpaces": true
    },

    // Make sure GitHub Copilot is enabled for Python files.
    "github.copilot.enable": {
        "python": true
    },
}

See also

Quickstart

Take your first steps with Python scripting in ZBrush.

Style Guide

Explains the code style and conventions used in this SDK.