版本控制

IMPORTANT
Substance 3D Designer 14.0.0 版本將 Perforce 支援升級至 Python 3。
確保你的其他腳本和版本控制環境都相應調整。

Designer 提供 Perforce🔗 (P4) 版本控制系統的 Python 整合。

整合後在檔案總管🔗的套件情境選單中新增了自訂的「版本控制」子選單,並新增自訂圖示以匹配 P4 中套件的狀態。

準備P4

在 P4V🔗 中,請記下工作區名稱與路徑,如下所示:

![P4V 工作區資訊][image0]{modal="regular"}

在任何文字編輯器或 IDE 中,開啟位於 Designer 安裝中的腳本:「tools/version_control/perforce.py」。

在第 19 行,編輯路徑到系統中 ‘p4’ 執行檔的位置。
在下方範例中,這條路徑是「c:/Program Files/Perforce/p4.exe」。

**```

Editable variables

cPerforceP4AbsPath = os.path.abspath("c:/Program Files/Perforce/p4.exe")

cVerbose = False


2) 前往「專案」,選擇目標 [專案檔案](/zh-hant/docs/substance-3d-designer/using/pipeline-and-project-configuration/project-configuration-files-sbsprj) ,然後進入「版本控制」標籤

3) 請檢查「啟用版本控制」

4) 請在「工作區」區填寫以下資訊:

   - **名稱:** 輸入你之前從 P4V 取得的「工作區名稱」
   - **路徑:** 輸入你之前從 P4V 取得的「工作空間路徑」![P4 在 Designer 設定:workspace][image2]{modal="regular"}### 設定動作這些動作會在檔案總管套件的情境選單中顯示。 有預設的動作符合大多數版本控制工具的概念:* 所有動作標籤都可以根據需要更改。
* 所有動作都需要腳本才能有效。你可以使用:* 每個​*動作一個腳本*
* 所有動作都用一個腳本​\*\*所有動作的起始腳本可在 Designer 安裝中取得:‘*tools/version\_control/perforce.py*’。:alert: IMPORTANT要讓套件可用,必須儲存在「Workspace path」下(例如「f:/Dev/perforce *」下*)**

+-----------------------------------------------------------------------------------------+
| List                                                                                    |
+-----------------------------------------------------------------------------------------+
| 1. **在 **動作** 群組中,點擊「…**」新增動作按鈕                                                         |
|    **. 在 Designer 安裝中選擇以下腳本:‘*tools/version\_control/perforce.py*’. 腳本應該會自動為其他所有動作設定。** |
+-----------------------------------------------------------------------------------------+

**![P4 在 Designer 設定:actions][image3]{modal="regular"}### 設定自訂動作由於所有版本控制工具都不同且包含許多功能,我們允許使用者新增自訂動作。1) 點擊「新增項目」
2) 填寫新動作的標籤,並設定其腳本路徑### 設定腳本直譯器1) 在「解譯器」區塊,點選「新增項目」
2) 設定腳本副檔名或後綴,以及直譯器可執行檔的路徑
3) 編輯 perforce.py 腳本以更新「p4」二進位檔的位置![Designer 中的 P4 設定:直譯器][image4]{modal="regular"}## 如何使用版本控制1) 建立一個新套件

2) 將套件存於「Workspace path」目錄下

3) 點擊套件上的右鍵:你現在可以進入「版本控制」子選單了

4) 根據工作區中套件檔案的狀態,有幾個動作可用:

   - **新增:** 將檔案標記為「ToAdd」
   - **提交:** 提交所選的套件。 此動作會顯示一個指定變更訊息的對話框(見下文)
   - **還原:** 還原修改內容。 此動作會顯示一個選擇要還原檔案的對話框(見下文)
   - **結帳:** 請從車站借閱檔案
   - **取得最新版本:** 從倉庫取回最新版本
   - **重新整理狀態:** 重新整理套件檔案狀態

   ![「提交」對話「][image5]{modal="regular"}

   ![「還原」對話框][image6]{modal="regular"}:info: NOTE所有動作都支援多重選擇對於 P4 及其他使用唯讀檔案權限限制修改的版本控制工具,使用者必須先檢查套件後再修改。唯讀套件檔案在 SD 中無法修改。包裹將根據狀態顯示以下圖示:![包裹圖示:最新][image7]最新資訊![包裹圖示:已借出][image8]退房![套件圖示:已新增][image9]標記為新增![包裹圖示:不在倉庫][image10]車站裡沒有請注意,包裹若未更新,會標示警告標誌。## 動作腳本每個動作執行的指令如下:my\_script ***工作區名稱 工作空間路徑 行動名稱\[ActionArgs]*****WorkspaceName:** 工作區名稱**WorkspacePath:** 工作區根目錄的路徑**ActionName:** 動作名稱:* *add:* 用於「Add」動作
* *結帳:* 關於「結帳」動作
* *submit:* 對於「Submit」動作
* *revert:* 用於「Revert」動作
* *get\_last\_version:* 用於「取得最後版本」動作
* *get\_status:* 用於「Get Status」動作標籤在專案設定中設定,將 ’ ’ 字元替換為 ‘\_’ — 例如:「My Action」=> 「My\_Action」。**ActionArgs:** 動作的參數:* *-desc*:用於「提交」動作的描述字串
* *-檔案:* 檔案清單
* *-files\_list:* 包含每行檔案清單的文字檔**get\_status**:根據指定檔案的狀態回傳一個值:* 0:未定義狀態

* 1:不要在車站

* 2:舊版本(非最新版本)

* 3:最新版本(最新)

* 4:退房

* 5:標記為加法

* 其他行動:

  - 0:成功
  - 其他:錯誤**

+-----------------------------------+
| Target Insertion                  |
+--------------------------+--------+
| recommendation-more-help |        |
+--------------------------+--------+

---

+----------------------------------+
| Toc                              |
+----------------------------------+
| substance-3d-designer-help-guide |
+----------------------------------+

---

+-------------+
| Doc Actions |
+-------------+
|             |
+-------------+

+----------+
| Mini Toc |
+----------+
|          |
+----------+

+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Metadata                                                                                                                                                                                   |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| last-update                   | 2026-09-11T18:09:42.000Z                                                                                                                                   |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| git-commit-file               | 54e48977c3a10bc8af91f81903ce597674f4027e                                                                                                                   |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| cloud                         | Experience Cloud                                                                                                                                           |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| solution                      | Substance 3D Designer, Substance 3D                                                                                                                        |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| usetq                         | true                                                                                                                                                       |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| landing-page-name             | substance-3d                                                                                                                                               |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| landing-page-breadcrumb-title | Substance 3D                                                                                                                                               |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| type                          | Documentation                                                                                                                                              |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| mini-toc-levels               | 2                                                                                                                                                          |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| git-repo                      | https\://github.com/AdobeDocs/substance-3d-designer.zh-Hant                                                                                                |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| index                         | true                                                                                                                                                       |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| temp-push                     | yes                                                                                                                                                        |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| source-git-commit             | 16eb8a173e984f842c820f3b8f0c3e140040bdfa                                                                                                                   |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| workflow-type                 | tm\+mt                                                                                                                                                     |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| source-wordcount              | 873                                                                                                                                                        |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ht-degree                     | 0%                                                                                                                                                         |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| git-filename                  | https\://github.com/AdobeDocs/substance-3d-designer.zh-Hant/help/interface/preferences-window/version-control/version-control.md                           |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| user-guide-title              |                                                                                                                                                            |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| breadcrumb-title              |                                                                                                                                                            |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| user-guide-description        |                                                                                                                                                            |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| nudge                         | true                                                                                                                                                       |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| helpx\_url                    | https\://helpx.adobe.com/tw/substance-3d-designer/interface/preferences-window/version-control.html                                                        |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| description                   | 在 Substance 3D Designer 偏好設定中設定版本控制,以整合 Git 及其他系統。                                                                                                         |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| helpx\_creative\_field        |                                                                                                                                                            |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| helpx\_description            | Designer > Interface > Preferences window > Version control                                                                                                |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| helpx\_experience\_level      |                                                                                                                                                            |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| helpx\_learn\_topic           |                                                                                                                                                            |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| helpx\_tags                   |                                                                                                                                                            |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| title                         | 版本控制 \| Adobe Substance 3D Designer                                                                                                                        |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| coveo-content-type            | Documentation                                                                                                                                              |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| landing-page-description      | 在 Substance 3D Designer 偏好設定中設定版本控制,以整合 Git 及其他系統。                                                                                                         |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| git-commit                    | 54e48977c3a10bc8af91f81903ce597674f4027e                                                                                                                   |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| pipeline\_filename            | help/interface/preferences-window/version-control/version-control.md                                                                                       |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| git-edit                      | https\://github.com/AdobeDocs/substance-3d-designer.zh-Hant/blob/main/help/interface/preferences-window/version-control/version-control.md                 |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| git-issue                     | https\://github.com/AdobeDocs/substance-3d-designer.zh-Hant/issues/new?body=File%3A%20help/interface/preferences-window/version-control/version-control.md |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| toc                           | substance-3d-designer-help-guide                                                                                                                           |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| product                       | Substance 3D Designer, Substance 3D                                                                                                                        |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| coveo-solution                | Substance 3D Designer                                                                                                                                      |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| json-ld                       | {   "@context": "https\://schema.org",   "@type": "HowTo",   "@id":                                                                                        |
|                               | "https\://experienceleague.adobe.com/zh-hant/docs/substance-3d-designer/using/workspace/preferences/version-control#/schema",   "url":                     |
|                               | "https\://experienceleague.adobe.com/zh-hant/docs/substance-3d-designer/using/workspace/preferences/version-control",   "headline": "版本控制 \| Adobe         |
|                               | Substance 3D Designer",   "description": "在 Substance 3D Designer 偏好設定中設定版本控制,以整合 Git 及其他系統。",   "inLanguage": "zh-hant",   "dateCreated": "2026-09-11",   |
|                               | "datePublished": "2026-09-11",   "dateModified": "2026-09-11",   "publisher": {     "@type": "Organization",     "name": "Adobe",     "url":               |
|                               | "https\://experienceleague.adobe.com"   },   "about": \[     {       "@type": "SoftwareApplication",       "name": "Substance 3D Designer"     },     {    |
|                               |    "@type": "SoftwareApplication",       "name": "Substance 3D"     }   ],   "keywords": \[     "Substance 3D Designer",     "Substance 3D"   ],           |
|                               | "mainEntityOfPage": {     "@type": "WebPage",     "@id":                                                                                                   |
|                               | "https\://experienceleague.adobe.com/zh-hant/docs/substance-3d-designer/using/workspace/preferences/version-control",     "url":                           |
|                               | "https\://experienceleague.adobe.com/zh-hant/docs/substance-3d-designer/using/workspace/preferences/version-control",     "name": "版本控制 \| Adobe Substance |
|                               | 3D Designer",     "description": "在 Substance 3D Designer 偏好設定中設定版本控制,以整合 Git 及其他系統。"   } }                                                                |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| html-lang                     | zh-hant                                                                                                                                                    |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+

[image0]: https://main--exlm-prod--adobe-experience-league.aem.page/media_11fc5b5376c89d88a79ec111cb9437c8386e1fc20.jpg#width=1011&height=256 "P4V 工作區資訊"

[image1]: https://main--exlm-prod--adobe-experience-league.aem.page/media_10e70b74df0248011995fea250fc11f8375947715.jpg#width=1026&height=877 "中的「版本控制」標籤「專案設定中的版本控制」標籤"

[image2]: https://main--exlm-prod--adobe-experience-league.aem.page/media_171bc28b1c4dc7a7a4de2af1f91bc0844263d7edd.jpg#width=1026&height=351 "在 Designer 中設定 P4 設定:workspace"

[image3]: https://main--exlm-prod--adobe-experience-league.aem.page/media_1291634db0acf425bb5ca29dec0b951bcf9dccac5.jpg#width=1026&height=375 "。P4 在 Designer 設定:actions。"

[image4]: https://main--exlm-prod--adobe-experience-league.aem.page/media_1c9dd3c23ddf98a4d81fbda845744e373b4e921a9.jpg#width=1026&height=275 "Designer 中的 P4 設定:直譯器"

[image5]: https://main--exlm-prod--adobe-experience-league.aem.page/media_1a8206342ed5d32be0f5b4654ba44485a143c45de.jpg#width=1066&height=662 "提交」對話"

[image6]: https://main--exlm-prod--adobe-experience-league.aem.page/media_1831575cbcdfa11d190b3f10f755c77a57d9dc904.jpg#width=1066&height=662 "「還原」對話框"

[image7]: https://main--exlm-prod--adobe-experience-league.aem.page/media_19a8665debee135b076c10cb066a4b08b3a84a62a.png#width=54&height=55 "套件圖示:最新"

[image8]: https://main--exlm-prod--adobe-experience-league.aem.page/media_1fdf82c541fc7bddf9db58fb55708cec5a5e2ca21.png#width=54&height=54 "包裹圖示:已借出"

[image9]: https://main--exlm-prod--adobe-experience-league.aem.page/media_1b05afb02184b224dd0ad66aa94e11802f536477b.png#width=54&height=54 "套件圖示:已新增"

[image10]: https://main--exlm-prod--adobe-experience-league.aem.page/media_16d4e286db864d4c8e4de7c24b6d9402655c19268.png#width=54&height=54 "包裹圖示:不在倉庫"