ScriptSpot

Tutorial

Using Regex in 3dsMax

By LoneRobot · 2014-09-30

Date updated
2014-09-30
Votes
1
External download
External download
Description

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 (1)

Thank you.

3dwannab · 2015-05-25

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)