View Full Version : selectByName() filter problem

03 March 2006, 07:58 PM
I hope someone can help me.... I've searched high and low, and not come across an answer to this.
I'm trying to get a selectbyname() filter to list all objects with the currently material ( MLister.matIndex[MLister.count] )

The code for the selectbyname is

MLister.vrayMatRC.addControl #Button (("ObjSel" + MLister.count as string) as name) "S"

MLister.vrayMatRC.addHandler (("ObjSel" + MLister.count as string) as name) #'pressed' codeStr:("selectByName filter:objFilter title:\"select objects\"")

and the filter :-

fn obFilter obj = ( obj.material == MLister.matList[MLister.count])

At the moment, when I click the button, I get a "-- Type error: selectByName filter:requires MAXScriptFunction, got: undefined" error. Nothing I do seems to change this!!

Thanks in advance for any help! :)

03 March 2006, 09:29 PM
Looking at this from a different perspective, I scrapped the selectByName approach, and wrote this function instead.... it seems to do the trick.

fn selectObjs mat =
local selectionlist = #()
for loop in $geometry do
if loop.material == mat do append selectionlist loop
select selectionlist

CGTalk Moderation
03 March 2006, 09:29 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.