View Full Version : macro: mentalray label extractor
Sagroth 11-30-2005, 10:55 PM I was experimenting with mr's label/tag pass and decided to write a small shake macro utility to extract a speciefic label into separete alpha. Label could be specified by it's index (set up in maya) or just by clicking on desired one in viewer. Nothing fancy, but useful for me. Then you compose it inside coverage pass and get a separete anti-aliased mask for any object in the scene (support label indicies from 1 to 63 - just can't crack universal formula for mr's channel data splitting according to label index).
labelExtractor_v1.1 (http://www.sigillarium.com/articles/labelExtractor.rar)
|
|
beaker
12-01-2005, 01:22 AM
very cool
If you could post that on highend3d.com, that would be great!
Sagroth
12-01-2005, 10:05 AM
Thanks, yeah, I'll put it on h3d... I'd just made it yesterday and had not a lot of testing time yet - in different versions of shake (just for formality ;)) And maybe there's smth useful that could be add... Just thinking about it right now :)
janimatic
12-02-2005, 11:19 AM
Finally someone did something really usefull using shake macros!
Thanks a lot for this!
Sagroth
12-02-2005, 07:33 PM
You're too cruel :) There're a lot of good macros on h3d (though I'm using only SexyLight myself recently :) - very useful with normals pass ;))
agentex
12-03-2005, 01:11 AM
Hey, great macro.
Just wondering what the proper node structure is for putting the alpha from the inside node back into your color pass to extract a specific element.
One thing that I've noticed is that the labelExtractor inside the coverage has an identical alpha to an alpha from mr color pass. But,
If you take the output from the color pass and put it inside the inside node that contains the label and coverage alpha a bit of premultiplication cuts off a pixel. The switchmatte works if you don't mult the matte but when I put the output from the switchmatte over another node I've got residual pixels from the original mr color pass.
Not that big of deal, just wondering if theres another way. Hope this isn't completely confusing...
Sagroth
12-03-2005, 02:14 PM
Ah, now I understand what you mean. It seems like "double anti-aliasing" when you put your premultiplied image inside anti-aliased mask. You need to just replace color's alpha completely - there're a number of ways you can do that - try which one is the best. In my opinion the cleanest one - use copy "a" node and then MMult.
agentex
12-03-2005, 08:00 PM
It seems like "double anti-aliasing" when you put your premultiplied image inside anti-aliased mask.
Yep, thats exactly what's happening, I got it working with your tip on using copy a and mmult, but first to get rid of the double anti-aliasing, you need to do a mdiv on the original color pass (provided that it is matted).
Nice little shake lesson :)
Cu.
Sagroth
12-03-2005, 08:07 PM
but first to get rid of the double anti-aliasing, you need to do a mdiv
Yeah, you're right - I've missed it in previous post.
CGTalk Moderation
12-03-2005, 08:07 PM
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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.