小编898*_*hew的帖子

无法在 F3 运算符搜索中找到自定义 Blender 运算符 (Blender 2.9)

我正在完成本教程:https :
//docs.blender.org/manual/en/latest/advanced/scripting/addon_tutorial.html

我从教程中复制了下面的脚本,当我运行脚本时,它编译没有任何错误。我应该能够在操作员搜索菜单 ( F3) 中搜索“按一个移动 X”来执行操作员,但它没有显示在操作员搜索菜单中。如何让操作员显示在搜索菜单中?Blender 2.9 有什么变化吗?

bl_info = {
    "name": "Move X Axis",
    "category": "Object"
}

import bpy

class ObjectMoveX(bpy.types.Operator):
    bl_idname = "object.move_x"
    bl_label = "Move X by One"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):
        scene = context.scene
        for obj in scene.objects:
            obj.location.x += 1.0

        return {'FINISHED'}

def register():
    bpy.utils.register_class(ObjectMoveX)

def unregister():
    bpy.utils.unregister_class(ObjectMoveX)

if __name__ == "__main__":
    register()
Run Code Online (Sandbox Code Playgroud)

python blender

11
推荐指数
3
解决办法
1618
查看次数

标签 统计

blender ×1

python ×1