texture_menu.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:bpy_lambda 作者: bcongdon 项目源码 文件源码
def draw(self, context):
        menu = utils_core.Menu(self)
        has_brush = utils_core.get_brush_link(context, types="brush")

        menu.add_item().label(text="Brush Mapping")
        menu.add_item().separator()

        if has_brush:
            if utils_core.get_mode() == utils_core.sculpt:
                path = "tool_settings.sculpt.brush.texture_slot.map_mode"

                # add the menu items
                for item in has_brush. \
                  texture_slot.bl_rna.properties['map_mode'].enum_items:
                    utils_core.menuprop(
                            menu.add_item(), item.name, item.identifier, path,
                            icon='RADIOBUT_OFF',
                            disable=True,
                            disable_icon='RADIOBUT_ON'
                            )
            elif utils_core.get_mode() == utils_core.vertex_paint:
                path = "tool_settings.vertex_paint.brush.texture_slot.tex_paint_map_mode"

                # add the menu items
                for item in has_brush. \
                  texture_slot.bl_rna.properties['tex_paint_map_mode'].enum_items:
                    utils_core.menuprop(
                            menu.add_item(), item.name, item.identifier, path,
                            icon='RADIOBUT_OFF',
                            disable=True,
                            disable_icon='RADIOBUT_ON'
                            )
            else:
                path = "tool_settings.image_paint.brush.texture_slot.tex_paint_map_mode"

                # add the menu items
                for item in has_brush. \
                  texture_slot.bl_rna.properties['tex_paint_map_mode'].enum_items:
                    utils_core.menuprop(
                            menu.add_item(), item.name, item.identifier, path,
                            icon='RADIOBUT_OFF',
                            disable=True,
                            disable_icon='RADIOBUT_ON'
                            )
        else:
            menu.add_item().label("No brushes available", icon="INFO")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号