Yep, i should rewrite the whole thing too:
Add following Line:
variationVal: { type: 'number', label: 'Variation Value', },
var items = {
scanInput: { type: 'number', label: 'Square Value', },
heightVal: { type: 'number', label: 'Staple Height', units: 'point' },
widthVal: { type: 'number', label: 'Staple Width', units: 'point' },
here -->
render: { type: 'button', value: 'Render',
- -------------------------------------------------------------------------------------
Change following Line:
initRaster(values.scanInput, values.heightVal, values.widthVal);}
in:
initRaster(values.variationVal, values.scanInput, values.heightVal, values.widthVal);}
- -------------------------------------------------------------------------------------
Change following Line:
function initRaster(scanInput, heightVal, widthVal) {
in:
function initRaster(variationVal, scanInput, heightVal, widthVal) {
- -------------------------------------------------------------------------------------
Change following Line:
hVal = color.gray * heightVal;
in:
if(variationVal <= 0) {
hVal = color.gray * heightVal;
} else {
hVal = (variationVal - color.gray) * heightVal;
};
- -------------------------------------------------------------------------------------
finished. ;)
Now you can change variation as you want. Negative values changed in 0, and this is the default of programmers version.
Number 1 in variation is "Håkan Lundgren's" last version of script.
feel free, and thank you