ScriptSpot

Forum topic · General Scripting

Simple Light include with wildcards

By boudini · 2011-06-09

Description

Hi there,

I am very slowly learning maxscript and would like to add a function to a light utility I created.

I am after 1 button which will create (or merge) a light with my settings, which I can do - but I would like it to add an include list for all objects that contain a keyword.

I am guessing I would need to create an array from the wildcard results and add that to the include list, but I'm having a hard time getting started.

All I have managed so far is:
$Lightname.includeList = testarray

-Using this I get no errors, but I also don't get that array added to my include list.

Any help would be muchly appreciated.

Thanks in advance.

Comments (2)

ah ha!

boudini · 2011-06-10

Yep that works brilliantly,

I had tried creating the testarray previously, but I had obviously done it wrong (I didnt use 'as Array') and I also had no idea about how to select using keywords.

Thanks for your help br0t!

br0t · 2011-06-09

Mhm it should error if "testarray" has not been created and filled with an array before. If I have an "Omni001" light and a bunch of objects in my scene, that have the keyword "buzzaloo" in their name and use this code:


theList = $*buzzaloo* as Array
$Omni001.includeList = theList

it works fine for me.

Cheers