讓我們添加到“ Blender”自定義熱鍵。

讓我們添加到“ Blender”自定義熱鍵。
Let Adding to ‘Blender’ Custom Hotkey.
讓我們通過一個簡單的示例來學習如何添加菜單快捷方式。
Let’s learn how to add a menu shortcut using a simple example.

有兩種選擇和連接三個點的方法。
There are two ways to select and connect three points.

一個是“連接頂點路徑”,另一個是“連接頂點對”。
One is Connect Vertex Path and the other is Connect Vertex Pairs.

已使用“ j”鍵設置了“連接頂點路徑”的快捷方式。
The shortcut for Connect Vertex Path is already set with the ‘j’ key.

但是,建模時不經常使用“連接頂點路徑”,因爲它具有按選定的頂點順序進行連接的特性(我認爲是這樣)。
However, Connect Vertex Path is not often used when modeling because it has the characteristic of connecting in the selected vertex order (I think so it is).

因此,我將爲連接頂點對設置快捷方式。
So I’m going to set up a shortcut for Connect Vertex Pairs.

無論您如何打開“ KEYMAP”窗口,都不存在CONNECT VERTEX PAIRS。
No matter how you open the KEYMAP window, Connect Vertex Pairs does not exist.

不要驚訝,讓我們慢慢添加一個例子。
Don’t be surprised, let’s slowly add an example.

通常,所有這些功能都是Python可以訪問的內部API。
In general, all of these features are internal APIs accessible by Python.

如果是這樣,請在[Connect Vertex Pairs]中搜索api。
If so, search for api in [Connect Vertex Pairs].
在這裏插入圖片描述
使用上面的API搜索網頁。 Use the API search web page above.
https://docs.blender.org/api/2.80/

嘗試在搜索框中搜索bpy.ops.mesh。 Try searching for bpy.ops.mesh in the search box.

bpy代表Blender Python模塊,而ops代表Operators。
bpy stands for Blender Python module and ops stands for Operators.

您將找到bpy.ops.mesh(Mesh Operators中的Python模塊)。
You will find bpy.ops.mesh (Python module, in Mesh Operators).

可以在此處找到用於大多數網格編輯的API。
APIs for most mesh editing can be found here.
https://docs.blender.org/api/2.80/bpy.ops.mesh.html?highlight=bpy%20ops%20mesh#module-bpy.ops.mesh
在這裏插入圖片描述

搜索帶有單詞查找功能的connect,您將在底部找到bpy.ops.mesh.vert_connect()函數。
Search for connect with word find and you will find the bpy.ops.mesh.vert_connect () function at the bottom.

此功能標記爲“連接頂點對”作爲Blender內部菜單名稱。
This function is labeled Connect Vertex Pairs as the Blender internal menu name.

(我認爲錯誤的函數名稱和菜單名稱是代碼審查不佳的示例。即使函數名稱很長,通常也希望使用bpy.ops.mesh.vert_connect_pairs()。)
(In my opinion, the incorrect function name and menu name are examples of poor code review. It is generally desirable to use bpy.ops.mesh.vert_connect_pairs () even if the function name is long.)

實際應用。Actual application.
1 . 複製bpy.ops.mesh.vert_connect()
2. 打開[KEYMAP]窗口。Open the [KEYMAP] window.
3. 查找MESH命令的列表。Find the list of Mesh commands.
在這裏插入圖片描述
4. 運行添加[NEW] Run Add [NEW]
5.擴展新創建的列表後,將其都不更改爲bpy.ops.mesh.vert_connect()。
After expanding the newly created list, change none to bpy.ops.mesh.vert_connect ().
6. bpy.ops.mesh.vert_connect()更改爲mesh.vert_connect。
bpy.ops.mesh.vert_connect () changed to mesh.vert_connect.
6. 輸入所需的快捷方式並完成。Enter the desired shortcut and finish.
在這裏插入圖片描述
檢查實際菜單。Check the actual menu.

在這裏插入圖片描述
測試其餘部分,然後以相同方式應用。Test the rest and apply it the same way.

About JP

鏈接: Website.
在這裏插入圖片描述
在這裏插入圖片描述
出生在韓國的TA。
1997年開始從事電腦圖形視覺化工作後,在這個行業已經有21年經驗了。
在多個網絡遊戲公司引領過美術團隊,之前在allegorithmic擔任TA負責人,在中國網易盤古工作室擔任TA總監,現在是巨人網絡TA部門的總負責人。
懶惰的人才有創意”是他堅信並執行的哲學道理。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章