Ahh, then definitely you do not want to switch the shadinggroup. Do you understand how the shading engine works? And do you understand how it does not work for things such as mentalray. As mentalray will not see anything thats inside maya, and expressions wont work for mentlaray (because its inside maya not inside mentalray, however the exporter does bake down the prerender state to mentalray attributes, but that only affects in the end of chain per attribute things, and no per shading, not this attribute must shade something that mental ray accepts a s a color source, if you use MR that is. Sometimes they must be baked into anim curves so mr gets it right tho.).
Unfortunately theres not much more options here than to understand quite a bit in order to get this to work properly for you. I wish people would actually test their hypotheses BEFORE they start doing the sytuff its much easier to get things to work when you design your stuff up front preoperly. ![]()
Now, you might get into problems of updating your render (remember batch isnt the same program as the one you run the graphics in!)
Anyway theres several options a bit depending on what you want,
if you want a per object attribution, then make a triple shading switch which you connect each objects translate to its own shading slot (for this you will need a for loop), then run this into a plus minus average node, connect your locator to slot 2 run this out to a multiply divide node, into both inputs. Then run thsi into a second multiply divide node, set mode to power and second term to 0.5 0.5 0.5, the output of this now represents each objects distanc to the locator you can now connect this to ramp or rewmap to drive your per shading primitive values.
If you want the point without per object discard the switch. connect sampler info in instead.
PS: expressions arent mel!
PPS: its alltogether different to help people to do their job, against doing it for them. Any questions fine but i wont do your job for you, neither should you expect anybody either. Dont push your deadline on other people, they either answer you or not, deadline is your problem and yours alone sorry
. See advice free is free, but also free of any obligation to you or anybody else for that matter. Its alltogether different if you hire somebody to do the job. ![]()