MotionBuilder Python Script20 -UI_Memo

Continue!

今天耗費(fèi)了比較長(zhǎng)的時(shí)間,但了解了軟件以及狀態(tài)切換流程,還是可以

今天我們來看一下MotionBuilder中的備忘錄。

一Memo

備忘錄

我們先來看一下UI效果


Memo

好像還真的是實(shí)現(xiàn)了備忘錄功能。。雖然好像可能也許并沒有任何的實(shí)際用處,但是并不妨礙我們看一下它的代碼

#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright 2009 Autodesk, Inc.  All rights reserved.
# 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 witha  Memo and shows how to sets its content
# and retrieve its lines.
#
# Topic: FBStringList, FBMemo
#

from pyfbsdk import *
from pyfbsdk_additions import *


def OnChange(control, event):
    print control.Text


def PopulateLayout(mainLyt):
    # create Spread
    m = FBMemo()

    x = FBAddRegionParam(0, FBAttachType.kFBAttachLeft, "")
    y = FBAddRegionParam(0, FBAttachType.kFBAttachTop, "")
    w = FBAddRegionParam(0, FBAttachType.kFBAttachRight, "")
    h = FBAddRegionParam(0, FBAttachType.kFBAttachBottom, "")

    mainLyt.AddRegion("memo", "memo", x, y, w, h)

    mainLyt.SetControl("memo", m)

    sl = FBStringList()
    sl.Add("String 1")
    sl.Add("String 2")

    m.SetStrings(sl)

    sl2 = FBStringList()
    m.GetStrings(sl2)
    print "printing string list"
    for s in sl2:
        print s

    m.OnChange.Add(OnChange)


def CreateTool():
    # Tool creation will serve as the hub for all other controls
    t = FBCreateUniqueTool("Memo Example")

    t.StartSizeX = 300
    t.StartSizeY = 300

    PopulateLayout(t)
    ShowTool(t)


CreateTool()

decomposition and refactor!

二、結(jié)語(yǔ)

繼續(xù)!

共勉!

有什么問題可以留言!

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 今天學(xué)習(xí)了一部分導(dǎo)入流程,寫完這篇就整理整理 今天我們來看一下UI中最常用的控件 Label 一、Label 標(biāo)簽...
    Houdinini閱讀 488評(píng)論 0 1
  • 昨天走的早,忘了寫東西。。慚愧! 今天我們來看一下MotionBuilder的Edit 的部分實(shí)現(xiàn)方法 一、Edi...
    Houdinini閱讀 973評(píng)論 0 0
  • 今天再給大家介紹一下Motionbuilder中Box的一些參數(shù)設(shè)置 一、BoxCustomParams 這一節(jié)主...
    Houdinini閱讀 623評(píng)論 0 1
  • 還是托更了,前兩天專注于新家打掃,之后又重新接到了一些耗時(shí)的任務(wù),不知不覺竟然將近5天沒有更新,還是沒有把小事做好...
    Houdinini閱讀 986評(píng)論 0 0
  • 每一個(gè)人都有自己的天賦優(yōu)勢(shì),你的獨(dú)特優(yōu)勢(shì)別人沒有,你不努力讓自己發(fā)揮自己天賦優(yōu)勢(shì),世界就少了一個(gè)明亮的星星,所以要...
    秋語(yǔ)姐姐閱讀 1,131評(píng)論 1 16

友情鏈接更多精彩內(nèi)容