你若安好萍嬉,便是晴天
這幾天成都的空氣變得異常焦灼,但總比整天沉著臉好舌劳!
今天我們來看一下MotionBuilder里的 ImageContainer
一帚湘、ImageContainer
圖片顯示玫荣,or圖片容器
我們先來看一下UI效果
UI效果
這里默認(rèn)的是顯示自帶的小箭頭甚淡,當(dāng)然咱們也可以給他換一個(gè)
喵喵喵~
我們來看一下代碼
#!/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 that show how to specify an Image in a container
#
# Topic: FBImageContainer
#
from pyfbsdk import *
from pyfbsdk_additions import *
def PopulateLayout(mainLyt):
x = FBAddRegionParam(0, FBAttachType.kFBAttachLeft, "")
y = FBAddRegionParam(0, FBAttachType.kFBAttachTop, "")
w = FBAddRegionParam(50, FBAttachType.kFBAttachNone, "")
h = FBAddRegionParam(50, FBAttachType.kFBAttachNone, "")
mainLyt.AddRegion("main", "main", x, y, w, h)
img = FBImageContainer()
img.Filename = "tape/tape_play_off.png"
mainLyt.SetControl("main", img)
def CreateTool():
# Tool creation will serve as the hub for all other controls
t = FBCreateUniqueTool("Image Container Example")
PopulateLayout(t)
t.StartSizeX = 400
t.StartSizeY = 400
ShowTool(t)
CreateTool()
代碼比較清晰,decomposition and refactor!
二捅厂、結(jié)語
堅(jiān)持堅(jiān)持堅(jiān)持贯卦!
有什么問題可以留言
共勉!