Created
June 4, 2012 06:49
-
-
Save takowasabi/2866748 to your computer and use it in GitHub Desktop.
motionbuilder GUI list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #MB2011 | |
| #なんの変哲もないVerticalListなんだけど、リストの値を上からlist mohi1,list mohi2,list mohi3...と複数選択していくと値が取得できず、 | |
| #下からlist mohi10,list mohi9,list mohi8って選択していくとその時選択した値が得られる・・・。 | |
| from pyfbsdk import * | |
| from pyfbsdk_additions import * | |
| def ListCallback(control, event): | |
| for idx,item in enumerate(control.Items): | |
| if control.IsSelected(idx): | |
| print item, "has been selected!" | |
| def PopulateLayout(mainLyt): | |
| x = FBAddRegionParam(0,FBAttachType.kFBAttachLeft,"") | |
| y = FBAddRegionParam(0,FBAttachType.kFBAttachTop,"") | |
| w = FBAddRegionParam(200,FBAttachType.kFBAttachNone,"") | |
| h = FBAddRegionParam(0,FBAttachType.kFBAttachBottom,"") | |
| mainLyt.AddRegion("main","main", x,y,w,h) | |
| lyt = VBoxLayout() | |
| mainLyt.SetControl("main",lyt) | |
| # List creation | |
| global controls | |
| controls = FBList() | |
| controls.OnChange.Add(ListCallback) | |
| # fill the list with dummy data | |
| for i in range(10): | |
| name = "list mohi %d" % (i + 1) | |
| controls.Items.append(name) | |
| controls.Style = FBListStyle.kFBVerticalList | |
| lyt.Add(controls, 200) | |
| controls.Selected(0,False) | |
| controls.MultiSelect =True | |
| def CreateTool(): | |
| t = CreateUniqueTool("List Example") | |
| PopulateLayout(t) | |
| ShowTool(t) | |
| CreateTool() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #MB2011 | |
| #なんの変哲もないVerticalListなんだけど、リストの値を上からlist mohi1,list mohi2,list mohi3...と複数選択していくと値が取得できず、 | |
| #下からlist mohi10,list mohi9,list mohi8って選択していくとその時選択した値が得られる・・・。 | |
| from pyfbsdk import * | |
| from pyfbsdk_additions import * | |
| def ListCallback(control, event): | |
| print control.Items[control.ItemIndex], "has been selected!" | |
| def PopulateLayout(mainLyt): | |
| x = FBAddRegionParam(0,FBAttachType.kFBAttachLeft,"") | |
| y = FBAddRegionParam(0,FBAttachType.kFBAttachTop,"") | |
| w = FBAddRegionParam(200,FBAttachType.kFBAttachNone,"") | |
| h = FBAddRegionParam(0,FBAttachType.kFBAttachBottom,"") | |
| mainLyt.AddRegion("main","main", x,y,w,h) | |
| lyt = VBoxLayout() | |
| mainLyt.SetControl("main",lyt) | |
| # List creation | |
| global controls | |
| controls = FBList() | |
| controls.OnChange.Add(ListCallback) | |
| # fill the list with dummy data | |
| for i in range(10): | |
| name = "list mohi %d" % (i + 1) | |
| controls.Items.append(name) | |
| controls.Style = FBListStyle.kFBVerticalList | |
| lyt.Add(controls, 200) | |
| controls.Selected(0,False) | |
| controls.MultiSelect =True | |
| def CreateTool(): | |
| t = CreateUniqueTool("List Example") | |
| PopulateLayout(t) | |
| ShowTool(t) | |
| CreateTool() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment