Call for Submission
NAB 2012 Best of the Best Show Reel
Submit your work today!
  • 1/3
You are here: Forum Home / Autodesk® MotionBuilder® / Python / Getting the current value for FBEdit()
  RSS 2.0 ATOM  

Getting the current value for FBEdit()
Rate this thread
 
36292
 
Permlink of this thread   Subscribe to this thread
avatar
  • Location: Eugene, Oregon
  • Total Posts: 73
  • Joined: 26 August 2006 02:43 AM

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?



Replies: 0
avatar
  • csa3d
  • Posted: 03 November 2009 11:58 AM

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



Replies: 0




   
  Settings Choose Theme color: