|
|
|
Tell us what you think of the site.
|
Autodesk Media & Entertainment User Community
|
Autodesk® 3ds Max®
|
|
Autodesk® Maya®
|
|
Autodesk® Softimage®
|
|
Autodesk® MotionBuilder®
|
|
Autodesk® Mudbox™
|
|
Autodesk® ImageModeler™
|
|
Autodesk® Sketchbook® Pro
|
|
Autodesk® Smoke on Mac®
|
| [SOLVED] How to get gui buttons to run script???
|
|
|
I got the gui working and some scripts i want to run. This is just a test, but i can’t figure out how to get that working. I’ve been searching the web but I can’t seem to find anything about that. Please help…
from pyfbsdk import * from pyfbsdk_additions import *
def create ():
cube = FBModelCube ("Cube")
cube.Show = True
def delete ():
model = FBFindModelByName ("Cube")
model.FBDelete ()
def PopulateLayout(mainLyt):
x = FBAddRegionParam(0,FBAttachType.kFBAttachLeft,"")
y = FBAddRegionParam(5,FBAttachType.kFBAttachTop,"")
w = FBAddRegionParam(5,FBAttachType.kFBAttachRight,"")
h = FBAddRegionParam(0,FBAttachType.kFBAttachBottom,"")
mainLyt.AddRegion("main","main", x, y, w, h)
lyt = HBoxLayout()
mainLyt.SetControl("main",lyt)
b = FBButton()
b.Caption = "Create"
lyt.Add(b,80, height=30)
b = FBButton()
b.Caption = "Delete"
lyt.Add(b,80, space=5,height=30)
def CreateTool():
t = CreateUniqueTool("Ghost Tool")
t.StartSizeX = 190
t.StartSizeY = 75
PopulateLayout(t)
ShowTool(t)
CreateTool()
|
|
|
|
Sorry for bugging you guys. I found out once again.
here it is if anyone needs help.
from pyfbsdk import * from pyfbsdk_additions import *
def create ():
cube = FBModelCube ("Cube")
cube.Show = True
def delete ():
model = FBFindModelByName ("Cube")
model.FBDelete ()
create_mappings = {
"Create" : lambda control = None, event = None : create (),
"Delete" : lambda control = None, event = None : delete () }
def PopulateLayout(mainLyt):
x = FBAddRegionParam(0,FBAttachType.kFBAttachLeft,"")
y = FBAddRegionParam(5,FBAttachType.kFBAttachTop,"")
w = FBAddRegionParam(5,FBAttachType.kFBAttachRight,"")
h = FBAddRegionParam(0,FBAttachType.kFBAttachBottom,"")
mainLyt.AddRegion("main","main", x, y, w, h)
lyt = HBoxLayout()
mainLyt.SetControl("main",lyt)
for mapping, func in create_mappings.iteritems():
b = FBButton()
b.Caption = mapping
lyt.Add(b,80, height=30)
b.OnClick.Add(func)
def CreateTool():
t = CreateUniqueTool("box Tool")
t.StartSizeX = 190
t.StartSizeY = 75
PopulateLayout(t)
ShowTool(t)
CreateTool()
|
|
|
|
| Settings
| Choose Theme color:
|
|
|
|
|
|
|
|
|