how to add 6000 Texture to 6000 objects


#1

I have 6000 textures for 6000 Planes as you can see in the picture, And I need a way that I can apply the textures to the planes automatically and not manually (because it take a lot of time to add manually textures to the material and then to the object itself)
is there an easy way to do that in 3ds max 2009 ?

thanks

shady


#2

It wouldn’t be too difficult at all with scripting. A caveat that you name the objects the same as your textures will make the script simpler (Though isn’t really necessary). It would go something like…

TexFolder = "C:\\project\	extures\\" --this is the folder where your textures are. The double-slashes are necessary. 
for a in selection do --for every selected object, do...
	(
		texturefilepath = (TexFolder + a.name) --defines the location of the texture based upon the given directory above + the object name
		newmap = bitmaptexture filename:texturefilepath --creates a bitmap to place into the new material
		newmaterial = standard diffusemap:newmap --creates a new material and assigns the above bitmap to the diffuse slot
		a.material = newmaterial --assigns the material to the object
	)--loops around and does the same for all the objects in the scene

Let me know if that works. You’ll need the file extension in the name for that to work - ie texturemap0001.jpg as the object name. It also relies on all of the textures being location in the folder defined in the first line of the script - you’ll need to change that so that it fits for your location. Again, you WILL need the double slashes.


#3

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.