Select by name filter, update and Matte material global override

Hello everyone :)
I'm relatively new to Max scripting so I have few problems to solve which I didn't found on help or other forums.

I want my script to, when selecting geometry, filter only geometry when selecting by name (multiple objects - only Geometry - no helpers, cameras, shapes or so), the same thing with cameras. Also, to check those, I want them to print in the text box under the buttons and connect selected camera to render button.
Then, when my objects are selected and printed, on "Update" button, next to render button, I want to apply a Global MATTE material override to selected geometry (mental ray) on chosen radio button "Front" - when "Front" is chosen - it should apply MATTE to previously selected geometry MESH objects and when Back is selected to do vice versa, to apply on objects that are not selected and printed in the box - I don't know how to do that so I'm asking someone to help and I would really appreciate it.

The script is in the attachment. Thanks in advance.

AttachmentSize
scriptproblem_02.ms2.52 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
pixamoon's picture

`

hi, here is a small info how Select button should look like:

on bnSelGeom pressed do
(
	fn selmesh obj = (isKindOf obj geometryClass and not isKindof obj TargetObject)
	chosenMesh = selectByName title:"Pick" buttontext:"Pick" filter:selmesh showHidden:true
	nameMesh.text = ""
	for o in chosenMesh do nameMesh.text += o.name + "\n"    
)

but can u explain more how Front and Back should work ?

Cheers,
Pixamoon

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.