Thanks, so the (yourMat) I change to (IvoryMat) or what ever its called.
So if I'm reading
@kobaltkween's code correctly, yourMat is actually the material zone you are trying to effect, so you are creating a reference to 1_Hoof, or 1_InnerMouth etc. Using the approach here, you're never really dealing with your material in terms of the mc6 files saved to your library. Think of it as using the script to make a new version of the material already applied to the figure. So Poser really doesn't care that your material is called IvoryMat, or RainbowPony, or Rubber, or whatever.
You could write a script that did search the library for a material of a specific name and apply it to specific body parts and in that case you would care about the name of the material in the library, but I don't think that's really what you want to do here.
What if I want the one script to work on any mat applied to the hoof not just a specific one?
I can think of two ways to go about this.
If you are only changing the hoof materials then you could create an array that holds all the materials and then run your code if the material name contained hoof. So something like this:
materials = actor.Materials()
for m in materials:
if "Hoof" in m.Name():
#code here to make the changes you want.
But since you said you were working on the unicorn, I'm thinking you might want the same code to run on both Harry and his hooves as well as the Unicorn horn, which means you want to run the same code on differently named materials on different figures in that case I might do something like this:
def ChangeGlossyness(matZoneToChange):
#code here to make the changes you want.
You would call the function by doing something like this:
yourMat=actor.Material("1_Hoof")
ChangeGlossyness(yourMat)
You could then call that function several times passing in the material you wanted to change. So you would call it twice for both hoof materials. Then find the horn figure and run it on it's materials.