Jump to content

Need to bulk map a LOT of unique textures. Smartest way to do it?


Kirsten Zirngibl
 Share

Recommended Posts

Hi,

 

I'm working on an interesting project but I have a ton of tedium ahead of me if I don't find a better way to accomplish it.

 

I have bunch of equally sized planes. Each one needs a unique ambient map, alpha map, and displacement map. The mapping is simple:

--The planes are square.

--The map images are square.

--I just need to "fill" each plane with the 3 unique map images.

 

The compact material editor has a limit of 24 visible materials. (Argh, why so low?) I know I'm not limited to the amount of texture maps in my scene (at least I don't think so) but it's hard to manage.

I find the Slate material editor to be a pain in its own way, since it requires so much dragging, rearranging, and clicking. I also keep accidentally overwriting old texture maps with new ones with it.

 

 

Is there a good script/plugin for bulk mapping unique textures to objects?

Ideally something that would let me set up some kind of "name-matching." (Like if I have a plane called "Plane 005" it would scan my map folder and look for "Alpha 005" and put it in the Alpha slot, same for Ambient and Displacement. With perfectly systematic texture/plane naming, this would be awesome!)

 

If not, I'd settle with the ability to pull ALL unique Max objects into the Slate material editor via material ID and auto-arrange the panels. That would at least save some time.

 

I need to do this with potentially thousands of textures, so I'm willing to go through some work to set up a better way to do this! I'm even willing to learn what I need to in MAXscript to make that happen, but I'm not sure it's even possible.

 

Thanks,

~Kirsten

Edited by kirstenzirngibl
Link to comment
Share on other sites

I already searched ScriptSpot. The only solutions seem to be "relinking" scripts. Designed for re-adding textures after a directory change, not for adding new textures. I'd think that would work differently, starting with the name that's already linked from within Max, then searching for it in the new folder or something like that. Not actually trying to make connections between plane names and image names.

 

I haven't tried those out because they didn't seem "right," but perhaps I could get those to do what I want with the right settings. After my second search I found something called "drop-and-relink" that seems promising...

Edited by kirstenzirngibl
Link to comment
Share on other sites

I got some help making my own script on maxforums.org, and am posting it here so it can help others in the future. (Big thanks to "Garp.")

 

---------------------------

 

- each object's name is of the form PlaneXXX (where XXX is a number)

- for each of them there are corresponding images DiffuseXXX.jpg and AlphaXXX.jpg

 

(
   local img_path = "c:/mosaic/images/"

   for p in $Plane* do (
       addModifier p (uvwMap())        -- remove these 2 lines if the planes
       convertToMesh p                 -- already have texture coordinates

       local num = substring p.name (p.name.count - 2) 3
       local mat = standardMaterial()

       mat.diffuseMap = bitmapTexture filename:(img_path + "Diffuse" + num + ".jpg")
       mat.opacityMap = bitmapTexture filename:(img_path + "Alpha" + num + ".jpg")

       p.material = mat
   )
)

 

I also added "mat.displacementMap" to it.

 

(Gotta learn Maxscript from the ground up, this has convinced me.)

Edited by kirstenzirngibl
Link to comment
Share on other sites

  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...