Please, need help me optimising this script
I am new to max scripting and need help optimizing this script. Although this script works as intended I can't but help to think that there must be a better way. That is however beyond my skills to identify.
I wrote this script to check naming conventions.
1- go through everything in the scene
2- check the if the names are matching the given names i.e.(ch_*_A_*, Set_*_A_*, Prop_*_A_*, etc)
3- select everything that are not matching the giving names
4- isolate it
beforehand thank you all for helping a noob out.
Purpose: Check scene for names:
Select and isolate everything that does not fall within the parameters
nameList = stringStream ""
-- putting things in arrays
local Array1 = $ch_*_a_* as array
local Array2 = $ch_*_s_* as array
local Array3 = $ch_*_m_* as array
local Array4 = $set_*_a_* as array
local Array5 = $set_*_s_* as array
local Array6 = $set_*_m_* as array
local Array7 = $prop_*_a_* as array
local Array8 = $prop_*_s_* as array
local Array9 = $prop_*_m_* as array
-- selecting arrays
-- putting all selected into a new array
tarObj = selection as array
-- select everything in the scene, deselect everything in tarObj array and unhide selection
selection.ishidden = off
-- isolate selection
macros.run "Tools" "Isolate_Selection"
for o in selection do print (o.name as string) to:nameList
-- create GUI
rollout rollout_NameChecker "Name Checker " width:200
-- create button
button squashBtn "Check Names!"
-- call on function check()
on squashBtn pressed do
createdialog rollout_NameChecker style:#(#style_titlebar,#Style_toolwindow,#style_sysmenu)