MotionBuilder Python Script05 - UI_BoxCustomParams

路遥芝麻粒~

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

一、BoxCustomParams

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

来看一下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中Box的参数设置方式,执行一下试一试吧!decomposition and refactor!

二、结语

继续加油!

共勉!

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • “ 已是黄昏独自愁,更著风和雨。”一抹斜阳留恋在嘴角,更有风雨加身,。21岁的我竟荒缪的迎来了人生的“黄昏”。...
    寂夜之歌阅读 254评论 2 2
  • 金羽飘落,世界陷入黑暗。灯红酒绿的媚眼,都市刚刚醒来。惺松而起,慵懒的夜生活伴着沙哑曲调开始,幽蓝的夜色,流转的节...
    鑫垚淼阅读 180评论 0 4
  • 飘飞的样子 是与天空的告别 风的陪伴 恰好助长飞翔的姿态 地面的温度 刚好适合降落 于是缓缓的 如同花朵般铺展 一...
    fe4e49a813e1阅读 207评论 0 0
  • 喝酒 找醉 今夜不醉不归真的爷们儿拿命搁这儿开瓶直接吹别害怕麻醉狼狈满大街地睡 我有这样一群哥们,每周总会有那么1...
    风shuo阅读 315评论 3 18