Thanks Justin and Marcus - Yep, that's exactly what I'm planning to use it for. I actually have The Art Of Rigging book laying right in front of me right now - I was lucky enough that someone happened to lend it to me a few months ago, although I hadn't had the chance to look through it yet. I'll definitely check it out and report back if I find a good way of doing it.
My quick and dirty way so far was to create a list of all the objects I'll be using as selectable meshes and assigning a transparent material to them all via scriptJob, then assigning a different visible material to any selected objects using the same scriptJob. I bet that's pretty inefficient though. On Wednesday, October 8, 2014 1:19:46 AM UTC-5, Marcus Ottosson wrote: > > Is this for a rig? E.g. animators select part of the mesh for visual > feedback? It's actually quite cool, but sadly I've only seen this used once > before. 8 years ago, in The Art Of Rigging by Cg Toolkit > <http://www.amazon.co.uk/Rigging-Definitive-Character-Technical-Direction/dp/0976800306> > . > > Their site is down, but they go through how they do it on one of their > dvd, possibly vol 1. Maybe that could help. And if not, the series is > amazing and should be viewed anyway. > > On 8 October 2014 01:21, Justin Israel <[email protected] <javascript:>> > wrote: > >> Maybe you would need to keep a record of the last objects you had changed >> and their previous setting. Then each time the condition fires, you would >> reset all of the last objects that aren't in the current selection. >> On 8/10/2014 8:32 AM, "Aren Voorhees" <[email protected] <javascript:>> >> wrote: >> >>> Hey All, I'm trying to use pymel to create a scriptJob that will assign >>> a particular material to whatever object(s) you have selected. When you >>> select something else, I need the previously selected objects to switch >>> back their original material. Making it assign a material based on >>> selection was not too hard, but I haven't been able to figure out how to >>> re-assign the original material once the object is no longer selected. >>> Thanks for any help! >>> >>> from pymel.core import * >>> >>> def assignBlueMatFn(): >>> >>> curSel = ls(sl=True) >>> >>> for i in curSel: >>> hyperShade(i, assign='Blue_MAT') >>> >>> scriptJob(event=['SelectionChanged', 'assignBlueMatFn()']) >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Python Programming for Autodesk Maya" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected] >>> <javascript:>. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/python_inside_maya/cb1e5b7e-b8a7-45fe-ae71-1e6af723ce11%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/python_inside_maya/cb1e5b7e-b8a7-45fe-ae71-1e6af723ce11%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Python Programming for Autodesk Maya" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2HtiOy7R5Fo6vQVsFa37NnSZ%2BTovYb%2BSBM3eOjZ-QHnA%40mail.gmail.com >> >> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2HtiOy7R5Fo6vQVsFa37NnSZ%2BTovYb%2BSBM3eOjZ-QHnA%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > *Marcus Ottosson* > [email protected] <javascript:> > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/9d6d5551-184e-4ef8-9634-a6dc15054531%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
