Notifications
Clear all
[Closed] Pickbutton Filter Parameters
Jul 25, 2013 3:31 am
Is it not possible to pass additional parameters through a pickbutton filter?
Example:
fn myPickButtonFilter obj =
(
(classof obj.modifiers[1]) == Skin
)
fn myPickButtonFilterWithAddParam obj additionalParamProp =
(
obj != additionalParamProp
)
rollout TestPickButtonRoll "Test PickButton"
(
local testPickButtonBtn1Node = undefined
pickbutton testPickButtonBtn1 "Pick Object" autoDisplay:true filter:myPickButtonFilter
pickbutton testPickButtonBtn2 "Pick Object" enabled:false autoDisplay:true filter:myPickButtonFilterWithAddParam --How do I Pass the additionalParamProp
on testPickButtonBtn1 picked obj do
(
testPickButtonBtn1Node = obj
testPickButtonBtn2.enabled = true
)
on testPickButtonBtn2 picked obj do
(
print "Doing Some Other Stuff"
)
)
createDialog TestPickButtonRoll
I know I could just make a global for additionalParamProp just trying to avoid it if possible here.
2 Replies
Jul 25, 2013 3:31 am
short of using the sdk probably not and even then it would prove tricky. The default filter function has a single INode* as it’s argument. So the trick here I guess is to pass the data on the Node and test for that within the “standard” filter function, appdata or a custom attribute would work.
Jul 25, 2013 3:31 am
Why do you need the addition argument? As long as the function return true or false you could just tell it what parameter to check.