PDA

View Full Version : Delete lots of Materials


Fex
02-10-2004, 08:26 AM
Hi,

need to know how to delete all local material nodes in a complex
multi object model cause i want to replace them by one group
material... there must be a solution :bounce:

thanks in advance
fex

ggg
02-10-2004, 09:47 AM
not sure I understand, the group will overide the local materials anyway.

Heber
02-10-2004, 02:16 PM
not sure whta you mean but select your object and just apply a new shader , this will rid of all nodes . but also check your clusters and delete any unwanted clusters, they tend to get in the way sometimes

version
02-10-2004, 02:18 PM
Yeah, grouping your objects together and applying a material will propogate it throughout the enclosed elements. Or if you wanted to, you could create a new Pass and just apply a new Material.

zen
02-10-2004, 03:59 PM
no group materials dont override local ones. its the inverse. Child nodes inherit properties unless they have the property locally.

Run these 2 lines in the script editor, itll select all materials in your scene, including cluster and group materials. then just hit the delete key.

SelectObj "*.Material"
AddToSelection "*.cls.*.Material"

ThE_JacO
02-10-2004, 04:36 PM
you are better off with


for each oItem in Selection
deleteobj oItem.material
set oClusters =oItem.ActivePrimitive.Geometry.Clusters
for each oClust in oClusters
deleteobj oClust.material
next
next


if you only have local materials.
this only works on the selection and won't touch the rest of the items in the scene.

I wrote it off the top of my head but it should work.

foxco
02-10-2004, 07:45 PM
Ya i too dont really understand what your getting at. Ray says delet clusters, definately do that. it gets rid of alot of sub-materials on poly clusters as well as problems and confusion. and if you want to just erase all the materials on a group of objects. select them all, first delete all the clusters, then asign the same material to all of them and it will reset your render trees for all objects. is that what your wanting to know ??


XsifoX

ggg
02-10-2004, 09:07 PM
Originally posted by zen
[B]no group materials dont override local ones. its the inverse.
no, not if they are member of the group. "If an object is a member of a group, then any properties applied to the group take precedence over local and branch properties."

but yes local does overide inherited. I understand now why he'd want to delete them instead of grouping all of them.

RickW
02-11-2004, 04:36 AM
Originally posted by ggg
no, not if they are member of the group. "If an object is a member of a group, then any properties applied to the group take precedence over local and branch properties."


That statement can be confusing. It's stated that way in the manual as well.

If an object has a shader on a cluster level then the group will NOT override its shader.

The trick is to either delete the cluster or explicitly add the cluster to the group.

To confuse things further, the defininiton of Local is used quite loose by many folks including SI Reps and myself.

Here's the word from the manual:

# Scene Default: This is the weakest source. If an object does not inherit a property from anywhere else, it uses the sceneís default values. For example, if an object has never had a material applied to it, it uses the scene default material.

# Branch: If a parent has a property applied when it is branch-selected, its children all inherit the property.

# Local: If a child inherits a branch property from its parent, but has the same property applied directly to it, it uses its local values.

# Cluster: Materials, textures, and other properties applied to a cluster take precedence over those applied to the object.

# Group: If an object is a member of a group, then any properties applied to the group take precedence over local and branch properties. Similarly, if a cluster is a member of a group, any properties applied to the group take precedence over those applied directly to the cluster.

# Layer: Any properties applied to an objectís layer take precedence over group, local, and branch properties.

# Partition: Properties applied to a partition of the current render pass have the highest priority of all.

/R

ggg
02-11-2004, 08:04 AM
Originally posted by RickW

The trick is to either delete the cluster or explicitly add the cluster to the group. and therefore as a member of the group the properties of the group take precedence :)

RickW
02-11-2004, 04:30 PM
Originally posted by ggg
and therefore as a member of the group the properties of the group take precedence :)

Yes, I'm not saying you're wrong :)

I'm saying that most folks assume that if an object has a cluster material and if the object is assigned to the group, they expect the group assignment to override the cluster material.

This thread demonstrates that :)

One may say local materials is a shader on the object itself.
Another may say a local material is a shader assigned to a cluster on the object.

When I had some problems with clusters and render passes in XSI 1.5, SI support told me that "local" materials have problems with render passes.

If we say groups override local materials, one can be led to believe that if the object is assigned to the group then all local materials (including clusters) will be overriden. Ignoring the terminology mixup.

/R

ggg
02-11-2004, 06:51 PM
I agree, it's confusing.

Matt Lind had a good description of this too on Highend but I think he deleted it, maybe for future release.

CGTalk Moderation
01-17-2006, 09:00 AM
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.