MaxScript Plug-in 如何创建反色渲染效果
原代码 这里有很多的错误,因为MaxScript没有关键字提示功能,所以主要是拼写上的错误:
plugin rendereffect negEffect name:"反色" classId:#(0x79cc21e5, 0x74c96866) ( rollout negRoll "NegRoll" ( label l1 "反色 By 风达" ) on apply r_img progressCB: do ( progressCB.setTitle "negEffect" for y =0 to r_img.height-1 do ( if progressCB.progress y (r_img.height-1) then exit img_line = getpixels r_img [0,y] r_img.width for x = 1 to r_img.width do ( clR = 255 - img_line(x).r clG = 255 - img_line(x).g clB = 255 - img_line(x).b imgline[x] = color clR clG clB imgline[x].alpha ) setPixels rImg [0,y] img_line ) ) )
修改过后的代码:
plugin rendereffect negEffect name:"反色" classId:#(0x79cc21e5, 0x74c96866) ( rollout negRoll "NegRoll" ( label l1 "反色 By 风达" ) on apply r_img progressCB: do ( progressCB.setTitle "negEffect" for y =0 to r_img.height-1 do ( if progressCB.progress y (r_img.height-1) then exit img_line = getpixels r_img [0,y] r_img.width for x = 1 to r_img.width do ( clR = 255 - img_line[x].r clG = 255 - img_line[x].g clB = 255 - img_line[x].b img_line[x] = color clR clG clB img_line[x].alpha ) setPixels r_Img [0,y] img_line ) ) )
文章来源: blog.csdn.net,作者:fengda2870,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/fengda2870/article/details/5464252
- 点赞
- 收藏
- 关注作者
评论(0)