Using Regex in 3dsMax

1 vote
Date Updated: 
09/30/2014
Author: 
LoneRobot

There used to be two things in life that truly scared me. One was the soundtrack from Frozen. The other was Regular Expressions. Find out which one I said "Let it go" to...

Comments

Comment viewing options

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

Thank you.

I've created an example whereby it strips any bitmap filename including path if missing so you don't get that pop up at the beginning when you open the file.

OldString =@".*"
MapArray = getClassInstances BitmapTexture
for o in MapArray where doesFileExist(o.filename) == false do (
	rgx = dotnetObject "System.Text.RegularExpressions.Regex" OldString
	filename = rgx.Replace o.filename ""
	o.filename = Filename
	ATSOps.Refresh()
)

.* matches any character (Greedy)

Comment viewing options

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