让我们添加到“ 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部门的总负责人。
懒惰的人才有创意”是他坚信并执行的哲学道理。

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