| 1 | <h2>Strings</h2> |
| 2 | <pre><code>-- Source: https://help.autodesk.com/view/MAXDEV/2022/ENU/?guid=GUID-5E5E1A71-24E2-4605-9720-2178B941DECC |
| 3 | |
| 4 | plugin RenderEffect MonoChrome |
| 5 | name:"MonoChrome" |
| 6 | classID:#(0x9e6e9e77, 0xbe815df4) |
| 7 | ( |
| 8 | rollout about_rollout "About..." |
| 9 | ( |
| 10 | label about_label "MonoChrome Filter" |
| 11 | ) |
| 12 | on apply r_image progressCB: do |
| 13 | ( |
| 14 | progressCB.setTitle "MonoChrome Effect" |
| 15 | local oldEscapeEnable = escapeEnable |
| 16 | escapeEnable = false |
| 17 | bmp_w = r_image.width |
| 18 | bmp_h = r_image.height |
| 19 | for y = 0 to bmp_h-1 do |
| 20 | ( |
| 21 | if progressCB.progress y (bmp_h-1) then exit |
| 22 | pixel_line = getPixels r_image [0,y] bmp_w |
| 23 | for x = 1 to bmp_w do |
| 24 | ( |
| 25 | p_v = pixel_line[x].value |
| 26 | pixel_line[x] = color p_v p_v p_v pixel_line[x].alpha |
| 27 | )--end x loop |
| 28 | setPixels r_image [0,y] pixel_line |
| 29 | )--end y loop |
| 30 | escapeEnable = oldEscapeEnable |
| 31 | )--end on apply |
| 32 | )--end plugin |
| 33 | </code></pre> |