Rename Materials To Diffuse Texture Name

I'd like to rename all the materials in a selection of meshes whether that be multisub materials or not. Is this feasible to do?

Comments

Comment viewing options

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

...

Tell me which material do you want to rename (Standard, Arch&Design, VRayMtl)?

barigazy

jnls's picture

script to remame textures

I have searched scriptspot and I have not found any script that changes the name of the textures in max and that at the same time rename these in the hard disk in a massive way because often the 3d models contain textures and maps with names numbers and even Chinese letters , Russians that are a total mess, I hope you could create a script that can do this, rename textures in max and in the hdd and update automatically in the routes.
I hope it's understandable because I'm using the Google translator

miauu's picture
jnls's picture

Greetings miauu

Greetings miauu

I have dealt with Interactive Universal Renamer and the best free option
I can find is duber bitmap collector but it has not been updated, hopefully with your knowledge you could modify it and improve it in these points: when renaming the textures and maps are not duplicated, when opening it load automatically the textures without having to look for the route in the browser, be able to sort them alphabetically and the option of saving the new name in the same input folder automatically.

StormBrig's picture

This is a very good idea.

This is a very good idea.

TwilightZoney's picture

Just standard for them.

Just standard for them.

barigazy's picture

...

This supports all tree ;)

fn renameMats objs = if objs.count != 0 do
(
	local matClasses = #(Arch___Design__mi, Standard, VRayMtl)
	local selMats = #()
	for c in matClasses do
	(
		for o in objs where o.mat != null do (join selMats (getClassInstances c target:o))
	)
	if selMats.count != 0 do
	(
		for m in selMats do
		(
			case of
			(
				(isProperty m #diff_color_map): if isKindOf (map = getProperty m #diff_color_map) textureMap do m.name = map.name
				(isProperty m #diffuseMap): if isKindOf (map = getProperty m #diffuseMap) textureMap do m.name = map.name
				(isProperty m #texmap_diffuse): if isKindOf (map = getProperty m #texmap_diffuse) textureMap do m.name = map.name
			)
		)
	) ; free selMats
)
renameMats selection

barigazy

TwilightZoney's picture

-- Frame: -- selMats:

-- Frame:
-- selMats: #(wap_mapA_gate_nos_.xno0:Standard, wap_mapA_gate_nos_.xno1:Standard, wap_mapA_gate_nos_.xno2:Standard, wap_mapA_gate_nos_.xno3:Standard, wap_mapA_gate_nos_.xno4:Standard, wap_mapA_gate_nos_.xno5:Standard, wap_mapA_gate_nos_.xno6:Standard, wap_mapA_gate_nos_.xno7:Standard, wap_mapA_gate_nos_.xno8:Standard, wap_mapA_gate_nos_.xno9:Standard, wap_mapA_gate_nos_.xno10:Standard, wap_mapA_gate_nos_.xno11:Standard, wap_mapA_gate_nos_.xno12:Standard, wap_mapA_gate_nos_.xno13:Standard, wap_mapA_gate_nos_.xno14:Standard, wap_mapA_gate_nos_.xno15:Standard, wap_mapA_gate_nos_.xno16:Standard, wap_mapA_gate_nos_.xno17:Standard, wap_mapA_gate_nos_.xno18:Standard, wap_mapA_gate_nos_.xno19:Standard, ...)
-- objs: $selection
-- matClasses: #(Arch___Design__mi, Standardmaterial, undefined)
-- VRayMtl: undefined
-- Type error: getClassInstances requires MAXClass, got: undefined

Not sure what happened. I just selected all the meshes and tried executing it. Unless thats not the correct way to go about using this.

barigazy's picture

...

Yup. You not have installed VRAY.

barigazy

barigazy's picture

...

Try this then

fn renameMats objs = if objs.count != 0 do
(
	local matClasses = #(Arch___Design__mi, Standard)
	local selMats = #()
	for c in matClasses do
	(
		for o in objs where o.mat != null do (join selMats (getClassInstances c target:o))
	)
	if selMats.count != 0 do
	(
		for m in selMats do
		(
			case of
			(
				(isProperty m #diff_color_map): if isKindOf (map = getProperty m #diff_color_map) textureMap do m.name = map.name
				(isProperty m #diffuseMap): if isKindOf (map = getProperty m #diffuseMap) textureMap do m.name = map.name
			)
		)
	) ; free selMats
)
renameMats selection

barigazy

Comment viewing options

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