|
|
|
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® Stitcher™
|
|
Autodesk® ImageModeler™
|
|
Autodesk® Sketchbook® Pro
|
|
Getting the current value for FBEdit()
|
|
|
I am making a UI inside motion builder, i am having issues passing the text value of the FBEdit() on to another procedure.. here is how i have it right now:
[code
def cre]ateResource(resName):
print resName()
def PopulateLayout(mainLyt):
...some code
eTxtResNm = FBEdit()
eTxtResNm.Text = “Test”
print ("Res Name” + eTxtResNm.Text)
x = FBAddRegionParam(5,FBAttachType.kFBAttachLeft,"")
y = FBAddRegionParam(5,FBAttachType.kFBAttachTop,"")
w = FBAddRegionParam(95,FBAttachType.kFBAttachNone,"")
h = FBAddRegionParam(25,FBAttachType.kFBAttachNone,"")
mainLyt.AddRegion("main”,"main", x, y, w, h)
btnCRes = FBButton()
...some code
btnCRes.OnClick.Add(createResource(eTxtResNm.Text))
when i press the button i get the following error:
TypeError: ‘NoneType’ object is not callable
is there a bug with FBEdit(), or am i just doing it wrong?
|
|
|
csa3d
csa3d
Adam Kelsey 03 November 2009 04:51 PM
I am making a UI inside motion builder, i am having issues passing the text value of the FBEdit() on to another procedure.. here is how i have it right now:
[code
def cre]ateResource(resName):
print resName()
def PopulateLayout(mainLyt):
...some code
eTxtResNm = FBEdit()
eTxtResNm.Text = “Test”
print ("Res Name” + eTxtResNm.Text)
x = FBAddRegionParam(5,FBAttachType.kFBAttachLeft,"")
y = FBAddRegionParam(5,FBAttachType.kFBAttachTop,"")
w = FBAddRegionParam(95,FBAttachType.kFBAttachNone,"")
h = FBAddRegionParam(25,FBAttachType.kFBAttachNone,"")
mainLyt.AddRegion("main”,"main", x, y, w, h)
btnCRes = FBButton()
...some code
btnCRes.OnClick.Add(createResource(eTxtResNm.Text))
when i press the button i get the following error:
TypeError: ‘NoneType’ object is not callable
is there a bug with FBEdit(), or am i just doing it wrong?
Looks like your createResource def does not return a value, therefore the def probably returns “Nonetype”. I think what you meant to do in that def is:
def createResource(resName):
stringName = str(resName)
print "The resource name is: %s" % stringName
return stringName
-csa
|
|
|
|
|
Settings
|
Choose Theme color:
|
|
|
|
|
|
|
|
|