美文网首页工具癖
MotionBuilder Python Script05 -

MotionBuilder Python Script05 -

作者: Houdinini | 来源:发表于2019-07-21 14:43 被阅读7次
    路遥芝麻粒~

    今天再给大家介绍一下Motionbuilder中Button的一些参数设置

    一、BoxCustomParams

    这一节主要介绍Button的属性参数

    来看一下UI效果

    UI效果
    这里有很多的不同参数设置方式效果看着都一样其实,代码如下:
    #!/usr/bin/env python
    # -*- coding: utf-8 -*-
    
    #Copyright2009Autodesk, Inc.Allrightsreserved.
    # Use of this software is subject to the terms of the Autodesk license agreement
    # provided at the time of installation or download, or which otherwise accompanies
    # this software in either electronic or hard copy form.
    #
    # Script description:
    # Create a tool that shows all custom params possible with a FBVBoxLayout/FBHBoxLayout.
    #
    # Topic: FBHBoxLayout, FBVBoxLayout
    #
    
    from pyfbsdk import *
    from pyfbsdk_additions import *
    
    
    def PopulateLayout(mainLyt):
        x = FBAddRegionParam(0, FBAttachType.kFBAttachLeft, "")
        y = FBAddRegionParam(0, FBAttachType.kFBAttachTop, "")
        w = FBAddRegionParam(5, FBAttachType.kFBAttachRight, "")
        h = FBAddRegionParam(0, FBAttachType.kFBAttachBottom, "")
        mainLyt.AddRegion("main", "main", x, y, w, h)
    
        lyt = FBHBoxLayout()
        mainLyt.SetControl("main", lyt)
    
        b = FBButton()
        b.Caption = "But0"
        # Custom params: height is fixed in a FBHBoxLayout
        lyt.Add(b, 30, height=75)
    
        b = FBButton()
        b.Caption = "But1"
        # Custom params: space between lastly inserted control
        lyt.Add(b, 30, space=75, height=50)
    
        b = FBButton()
        b.Caption = "But2"
        lyt.Add(b, 30, height=25)
    
        vlyt = FBVBoxLayout()
        # Custom params: space between lastly inserted control
        lyt.Add(vlyt, 150, space=25)
    
        b = FBButton()
    
        b.Caption = "But3"
        # Custom params: width is fixed in this FBVBoxLayout
        vlyt.Add(b, 30, width=75)
    
        b = FBButton()
        b.Caption = "But4"
        vlyt.Add(b, 30, space=75, width=50)
    
        b = FBButton()
        b.Caption = "But5"
        vlyt.Add(b, 30, width=25)
    
    
    def CreateTool():
        # Tool creation will serve as the hub for all other controls
        t = FBCreateUniqueTool("Box Custom Params Example")
        t.StartSizeX = 400
        t.StartSizeY = 400
    
        PopulateLayout(t)
        ShowTool(t)
    
    
    CreateTool()
    

    这里面主要展示了Motionbuilder中button的参数设置方式,执行一下试一试吧!decomposition and Restructure!

    二、结语

    继续加油!

    共勉!

    相关文章

      网友评论

        本文标题:MotionBuilder Python Script05 -

        本文链接:https://www.haomeiwen.com/subject/atgmlctx.html