Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Remove standard Mtl, Unwrap UVW

Remove standard Mtl, Unwrap UVW

n_stylee
Contributor Contributor
1,533 Views
13 Replies
Message 1 of 14

Remove standard Mtl, Unwrap UVW

n_stylee
Contributor
Contributor

Hello i am trying to remove all standard materials in the scenes?

 

For some reason when you are  using UVW Unrwap , its creating a standard Mtl  for the  unrwap in the scene and there is no way get rid of it!

Yes when i collapse the object to Editable Poly its gone, but this is not a solution . I can see the Mat. in the asset tracker ,but again i connot remote  it.

 

 

If someone have  an idea please help 🙂

 

 

 

 

0 Likes
Accepted solutions (1)
1,534 Views
13 Replies
Replies (13)
Message 2 of 14

denisT.MaxDoctor
Advisor
Advisor

what do you want to do with these two materials? (there are two materials made by Unwrap_UVW)

0 Likes
Message 3 of 14

denisT.MaxDoctor
Advisor
Advisor

for example, let's replace with "undefined":

fn replaceUnwrapMaterials modi mat:undefined = if iskindof modi Unwrap_UVW do
(
	mats = getclassinstances standard target:modi
	pb2 = for k=1 to refs.getNumRefs modi where iskindof (pb2 = refs.getreference modi k) ParamBlock2 do exit with pb2
	for k=1 to refs.getNumRefs pb2 where finditem mats (refs.getreference pb2 k) > 0 do
	(
		refs.replacereference pb2 k mat
	)
	mats
)

-- replaceUnwrapMaterials <unwrap_uvw modifier>
0 Likes
Message 4 of 14

n_stylee
Contributor
Contributor

Thank you so much for the fast answer!

I want to delete them from the scene. In the end to  have zero standard mtls. in the scene and to keep the unwrap unstacked.

0 Likes
Message 5 of 14

n_stylee
Contributor
Contributor

The other option is to convert the Standardm tls to Vray, but in the end again the goal is two have zero standard mtls in the scene.

Whatever is the easiest  way to do it.

 

 

 

0 Likes
Message 6 of 14

n_stylee
Contributor
Contributor

The scripts to convert  scene materials don't work in this case.

Maybe because the materials are created from the unwrap modifier

and they are in the uvw sub level.

 

So far  i was able to convert one of the standard mtl to vray

with this :

 

$.modifiers[#Unwrap_UVW].TextureCheckerMaterial = VrayMtl ()

 

but i cannot do the same with the  Unwrap Checker  material.

The workaround for the Unwrap Checker Mtl. is to "pick it"  in the Material Editor

and then to  manually convert it to VrayMtl. This way is slow and no good because

every Unwrap uvw  modifier is creating 2  standard materials, so annoying.

 

 

 

 

0 Likes
Message 7 of 14

domo.spaji
Advisor
Advisor

What's the idea behind all that? Why are you so afraid of standard material?

0 Likes
Message 8 of 14

n_stylee
Contributor
Contributor

When you are working in a heavy Vray scene ,the standard mtl is crashing Max. Every unwrap modifier is creating 2 separate standard materials . If you have  5 unwrapped objects,  automatically you are getting  10 standard mtls ,
(x 2 buried under each modifier)! The scripts that are converting materials cannot see them to,  but they are in the scene .

Yes you can stack after modifier and they are gone,  but that way you are Locking the geometry.

 

 

0 Likes
Message 9 of 14

denisT.MaxDoctor
Advisor
Advisor

@n_stylee wrote:

When you are working in a heavy Vray scene ,the standard mtl is crashing Max.

 


This is a big problem! Something is wrong with your system if the standard materials break it. First, you must find a reason why.

0 Likes
Message 10 of 14

n_stylee
Contributor
Contributor

 

Yes indeed is a big problem.

 

  I am talking about a  scene with million vertex's, proxies, vray mtls( with no translucency) rail clone and forest -(all licensed plug-ins).

 

And yes  i found the issue, its the standard materials. 

 

 

 

For  right now  i can clean the  2 materials

 

on a single selected object with this:

 

 

 

$.modifiers[#Unwrap_UVW].TextureCheckerMaterial = undefined

 

$.modifiers[#Unwrap_UVW].checkerMaterial = undefined

 

 

 

Can pls someone help me to modify it so it will work for all selected objects or for all abjects in the scene that have unwrap modifier.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0 Likes
Message 11 of 14

denisT.MaxDoctor
Advisor
Advisor
Accepted solution
mapped fn replaceUnwrapMaterials modi mat:undefined = if iskindof modi Unwrap_UVW do
(
	mats = getclassinstances standard target:modi
	pb2 = for k=1 to refs.getNumRefs modi where iskindof (pb2 = refs.getreference modi k) ParamBlock2 do exit with pb2
	for k=1 to refs.getNumRefs pb2 where finditem mats (refs.getreference pb2 k) > 0 do
	(
		refs.replacereference pb2 k mat
	)
	mats
)

replaceUnwrapMaterials (getclassinstances Unwrap_UVW)
Message 12 of 14

n_stylee
Contributor
Contributor

Thank you so much !

I really appreciate it!

0 Likes
Message 13 of 14

denisT.MaxDoctor
Advisor
Advisor

try to understand why the standard materials are causing problems in your scene. What viewport rendering (shading) are you using?

I am sure that the standard material is the safest MAX material for any scene. Only certain (custom) MAX settings can cause corresponding instability.

 

what you are doing now is hiding the problem, not treating it.

0 Likes
Message 14 of 14

n_stylee
Contributor
Contributor

Yes  i completely agree with you.

I suspect its the combination from

 the Forest pack, Rail clone and Vray.  Its  not happening often, but when it  does removing the Standard mtl from the scene is doing the trick.

Again thank you for  your time.

 

 

0 Likes