stroke_menu.py 文件源码

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

项目:bpy_lambda 作者: bcongdon 项目源码 文件源码
def draw(self, context):
        settings, brush, stroke_method = self.init()
        menu = utils_core.Menu(self)

        menu.add_item().menu(StrokeMethodMenu.bl_idname)
        menu.add_item().separator()

        if stroke_method:
            if stroke_method == space and brush:
                menu.add_item().prop(brush, "spacing",
                                     text=utils_core.PIW + "Spacing", slider=True)

            elif stroke_method == airbrush and brush:
                menu.add_item().prop(brush, "rate",
                                    text=utils_core.PIW + "Rate", slider=True)

            elif stroke_method == anchored and brush:
                menu.add_item().prop(brush, "use_edge_to_edge")

            else:
                pass

            if utils_core.get_mode() == utils_core.sculpt and stroke_method in (drag_dot, anchored):
                pass
            else:
                if brush:
                    menu.add_item().prop(brush, "jitter",
                                        text=utils_core.PIW + "Jitter", slider=True)

            menu.add_item().prop(settings, "input_samples",
                                text=utils_core.PIW + "Input Samples", slider=True)

            if stroke_method in [dots, space, airbrush] and brush:
                menu.add_item().separator()

                menu.add_item().prop(brush, "use_smooth_stroke", toggle=True)

                if brush.use_smooth_stroke:
                    menu.add_item().prop(brush, "smooth_stroke_radius",
                                        text=utils_core.PIW + "Radius", slider=True)
                    menu.add_item().prop(brush, "smooth_stroke_factor",
                                        text=utils_core.PIW + "Factor", slider=True)
        else:
            menu.add_item().label("No Stroke Options available", icon="INFO")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号