當前位置: 首頁>>代碼示例>>Python>>正文


Python blf.disable方法代碼示例

本文整理匯總了Python中blf.disable方法的典型用法代碼示例。如果您正苦於以下問題:Python blf.disable方法的具體用法?Python blf.disable怎麽用?Python blf.disable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在blf的用法示例。


在下文中一共展示了blf.disable方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: draw

# 需要導入模塊: import blf [as 別名]
# 或者: from blf import disable [as 別名]
def draw(self, context, render=False):

        # print("draw_text %s %s" % (self.text, type(self).__name__))
        self.render = render
        p = self.position_2d_from_coord(context, self.pts[0], render)
        # dirty fast assignment
        dpi, font_id = context.user_preferences.system.dpi, 0
        bgl.glColor4f(*self.colour)
        if self.angle != 0:
            blf.enable(font_id, blf.ROTATION)
            blf.rotation(font_id, self.angle)
        blf.size(font_id, self.font_size, dpi)
        blf.position(font_id, p.x, p.y, 0)
        blf.draw(font_id, self.text)
        if self.angle != 0:
            blf.disable(font_id, blf.ROTATION) 
開發者ID:s-leger,項目名稱:archipack,代碼行數:18,代碼來源:archipack_gl.py

示例2: draw_text

# 需要導入模塊: import blf [as 別名]
# 或者: from blf import disable [as 別名]
def draw_text(text, font_id, color, shadow=False, shadow_color=None):
    blf.enable(font_id, blf.SHADOW)

    # Draw shadow.
    if shadow:
        blf.shadow_offset(font_id, 3, -3)
        blf.shadow(font_id, 5, *shadow_color, 1.0)

    # Draw text.
    compat.set_blf_font_color(font_id, *color, 1.0)
    blf.draw(font_id, text)

    blf.disable(font_id, blf.SHADOW) 
開發者ID:nutti,項目名稱:Screencast-Keys,代碼行數:15,代碼來源:ops.py

示例3: draw_callback_px

# 需要導入模塊: import blf [as 別名]
# 或者: from blf import disable [as 別名]
def draw_callback_px(self, context):
    scene = context.scene

    font_id = 0  # XXX, need to find out how best to get this.

    # draw some text
    blf.position(font_id, 15, 30, 0)
    blf.size(font_id, 18, 72)
    blf.enable(font_id, blf.SHADOW)
    blf.shadow(font_id, 5, 0.0, 0.0, 0.0, 1.0)

    # Shorten / cut off milliseconds
    time_total = str(timedelta(seconds = timer["total"]))
    pos = time_total.rfind(".")
    if pos != -1:
        time_total = time_total[0:pos+3]

    time_estimated = str(timedelta(seconds = (timer["average"] * (scene.frame_end - scene.frame_current))))
    pos = time_estimated.rfind(".")
    if pos != -1:
        time_estimated = time_estimated[0:pos]


    blf.draw(font_id, "Total render time " + time_total)
    if timer["is_rendering"] and scene.frame_current != scene.frame_start:
        blf.position(font_id, 15, 12, 0)
        blf.draw(font_id, "Estimated completion: " + time_estimated)

    # restore defaults
    blf.disable(font_id, blf.SHADOW) 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:32,代碼來源:render_time.py

示例4: disable

# 需要導入模塊: import blf [as 別名]
# 或者: from blf import disable [as 別名]
def disable(option, fontid=None):
        return blf.disable(FontManager.load(fontid), option) 
開發者ID:CGCookie,項目名稱:addon_common,代碼行數:4,代碼來源:fontmanager.py

示例5: disable_rotation

# 需要導入模塊: import blf [as 別名]
# 或者: from blf import disable [as 別名]
def disable_rotation(fontid=None):
        return blf.disable(FontManager.load(fontid), blf.ROTATION) 
開發者ID:CGCookie,項目名稱:addon_common,代碼行數:4,代碼來源:fontmanager.py

示例6: disable_clipping

# 需要導入模塊: import blf [as 別名]
# 或者: from blf import disable [as 別名]
def disable_clipping(fontid=None):
        return blf.disable(FontManager.load(fontid), blf.CLIPPING) 
開發者ID:CGCookie,項目名稱:addon_common,代碼行數:4,代碼來源:fontmanager.py

示例7: disable_shadow

# 需要導入模塊: import blf [as 別名]
# 或者: from blf import disable [as 別名]
def disable_shadow(fontid=None):
        return blf.disable(FontManager.load(fontid), blf.SHADOW) 
開發者ID:CGCookie,項目名稱:addon_common,代碼行數:4,代碼來源:fontmanager.py

示例8: disable_kerning_default

# 需要導入模塊: import blf [as 別名]
# 或者: from blf import disable [as 別名]
def disable_kerning_default(fontid=None):
        # note: not a listed option in docs for `blf.disable`, but see `blf.word_wrap`
        return blf.disable(FontManager.load(fontid), blf.KERNING_DEFAULT) 
開發者ID:CGCookie,項目名稱:addon_common,代碼行數:5,代碼來源:fontmanager.py

示例9: text_size

# 需要導入模塊: import blf [as 別名]
# 或者: from blf import disable [as 別名]
def text_size(self, context):
        """
            overall on-screen size in pixels
        """
        dpi, font_id = context.user_preferences.system.dpi, 0
        if self.angle != 0:
            blf.enable(font_id, blf.ROTATION)
            blf.rotation(font_id, self.angle)
        blf.aspect(font_id, 1.0)
        blf.size(font_id, self.font_size, dpi)
        x, y = blf.dimensions(font_id, self.text)
        if self.angle != 0:
            blf.disable(font_id, blf.ROTATION)
        return Vector((x, y)) 
開發者ID:s-leger,項目名稱:archipack,代碼行數:16,代碼來源:archipack_gl.py

示例10: pts

# 需要導入模塊: import blf [as 別名]
# 或者: from blf import disable [as 別名]
def pts(self):
        n = self.up_axis
        c = self.c_axis
        # does move sensitive area so disable for tri handle
        # may implement sensor_center property to fix this
        # if self.selected or self.hover or self.active:
        scale = 1
        # else:
        #    scale = 0.5
        x = n * self.size * 4 * scale
        y = c * self.size * scale
        return [self.pos_3d - x + y, self.pos_3d - x - y, self.pos_3d] 
開發者ID:s-leger,項目名稱:archipack,代碼行數:14,代碼來源:archipack_gl.py

示例11: disable

# 需要導入模塊: import blf [as 別名]
# 或者: from blf import disable [as 別名]
def disable(self):
        self.on = False 
開發者ID:s-leger,項目名稱:archipack,代碼行數:4,代碼來源:archipack_gl.py

示例12: BakeLab_DrawCallback

# 需要導入模塊: import blf [as 別名]
# 或者: from blf import disable [as 別名]
def BakeLab_DrawCallback(self, context):
    props = context.scene.BakeLabProps
    ww = context.area.width
    wh = context.area.height
    
    bgl.glEnable(bgl.GL_BLEND)
    blf.enable(0,blf.SHADOW)
    blf.shadow(0,5,0,0.0,0.0,1)
    
    ######### Title {
    bgl.glBegin(bgl.GL_QUADS)
    bgl.glColor4f(0.88, 0.87, 0.85, 0.1)
    for i in range(0,20):
        bgl.glVertex2i(0,       wh)
        bgl.glVertex2i(120+i*3, wh)
        bgl.glVertex2i(120+i*3, wh-70)
        bgl.glVertex2i(0,       wh-70)
        
    bgl.glColor4f(0.7,0.1,0.3, 0.1)
    for i in range(0,20):
        bgl.glVertex2i(0,       wh-70)
        bgl.glVertex2i(140+i*3, wh-70)
        bgl.glVertex2i(140+i*3, wh-75)
        bgl.glVertex2i(0,       wh-75)
    bgl.glEnd()
    
    blf.size(0, 30, 72)
    bgl.glColor4f(0.7,0.1,0.3, 1.0)
    blf.position(0, 15, context.area.height-58, 0)
    blf.draw(0, 'BakeLab')
    ######### }
    
    ######### Progress {
    blf.size(0, 15, 72)
    y_shift = 15
    #######################################################################
    cur = self.bake_item_id
    max = len(context.scene.BakeLabMapColl)
    BakeLab_DrawProgressBar(y_shift,cur/max,'Map: '+ str(cur)+' of '+str(max))
    y_shift += 30
    #######################################################################
    if not props.s_to_a and not props.all_in_one:
        cur = self.bake_obj_id
        max = len(self.bake_objs)
        BakeLab_DrawProgressBar(y_shift,cur/max,'Object: '+ str(cur)+' of '+str(max))
        y_shift += 30
    #######################################################################
    if props.use_list:
        cur = self.ObjListIndex
        max = len(context.scene.BakeLabObjColl)
        BakeLab_DrawProgressBar(y_shift,cur/max,'List: '+ str(cur)+' of '+str(max))
        y_shift += 30
    #######################################################################
    ######### }
    
    
    blf.disable(0,blf.SHADOW)
    bgl.glDisable(bgl.GL_BLEND)
    bgl.glColor4f(0.0, 0.0, 0.0, 1.0) 
開發者ID:Shahzod114,項目名稱:Bakelab-Blender-addon,代碼行數:61,代碼來源:BakeLab_1_2.py

示例13: draw_callback

# 需要導入模塊: import blf [as 別名]
# 或者: from blf import disable [as 別名]
def draw_callback(self, context):
    # polling
    if context.mode != "EDIT_MESH" or len(context.active_object.vertex_groups) == 0:
        return
    # retrieving ID property data
    try:
        texts = context.active_object.data["show_vgroup_verts"]
        weights = context.active_object.data["show_vgroup_weights"]
    except:
        return
    if not texts:
        return

    bm = bmesh.from_edit_mesh(context.active_object.data)

    if bm.select_mode == {'VERT'} and bm.select_history.active is not None:
        active_vert = bm.select_history.active
    else:
        active_vert = None

    # draw
    blf.size(0, 13, 72)
    blf.enable(0, blf.SHADOW)
    blf.shadow(0, 3, 0.0, 0.0, 0.0, 1.0)
    blf.shadow_offset(0, 2, -2)
    for i in range(0, len(texts), 7):
        bgl.glColor3f(texts[i], texts[i+1], texts[i+2])
        blf.position(0, texts[i+4], texts[i+5], texts[i+6])
        blf.draw(0, "Vertex " + str(int(texts[i+3])) + ":")
        font_y = texts[i+5]
        group_name = ""
        for j in range(0, len(weights), 3):
            if int(weights[j]) == int(texts[i+3]):
                font_y -= 13
                blf.position(0, texts[i+4] + 10, font_y, texts[i+6])
                for group in context.active_object.vertex_groups:
                    if group.index == int(weights[j+1]):
                        group_name = group.name
                        break
                blf.draw(0, group_name + ": %.3f" % weights[j+2])
        if group_name == "":
            font_y -= 13
            blf.position(0, texts[i+4] + 10, font_y, texts[i+6])
            blf.draw(0, "No Groups")

    # restore defaults
    blf.disable(0, blf.SHADOW)


# operator 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:52,代碼來源:mesh_show_vgroup_weights.py


注:本文中的blf.disable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。