fizzlemaster3000 is a drawing tool which creates grass-like vectors (fizzles) shooting out of the drawn path. you can set values like the direction those fizzles should point at, the growth/lenght of the generated vectors, their value of disturbance and the amount of fizzles created per mousedrag.
Really interesting but when i try to assig this tool at // or ** i get this message:
C:\Programmi\Adobe\Adobe Illustrator CS2\Plug-ins\Scriptographer\scripts\tools\fizzlemaster3000.js:1,3: syntax error (C:\Programmi\Adobe\Adobe Illustrator CS2\Plug-ins\Scriptographer\scripts\tools\fizzlemaster3000.js#1)
java.lang.NullPointerException
at com.scriptographer.ai.Tool.setScript(Tool.java:68)
at com.scriptographer.gui.MainDialog$ToolButton.onClick(MainDialog.java:286)
at com.scriptographer.adm.Button.onNotify(Button.java:75)
at com.scriptographer.adm.NotificationHandler.onNotify(NotificationHandler.java:55)
@danny: save / move / drag it to one of the folders within the scriptographer folder which should reside in the plugin folder of illustrator.
@pedro: you mention setting values and i do see function onOptions() within the script but somehow i'm not getting a pop-up / window where i can set those values within illustrator.
@pedro / all:
since i didn't get the pop up menu (mentioned above) i have rewritten your code by looking at the source of textpencil.js, now i do know how to code but i'm not familiar with illy scripting, so it probably will be a bit sloppy and it probably could use some rewriting (tabbing thru the fields are the other way around) but this code works with the specs mentioned below.
My system specs:
Mac OS X 10.4.8
Illustrator CS2
Scriptographer 2.0.019
The rewritten script:
/* ++++++++++++++++++++++++++++++++++++++++++++
_____ __
/ __(_)_______ / /__
/ /_/ /_ /_ / / / _ \
/ __/ / / /_/ /_/ / __/
/_/ /_/ /___/___/_/___/
__
____ ___ ____ ______/ /____ _____
/ __ `__ / __ `/ ___/ __/ _ / ___/
/ / / / / / /_/ (__ ) /_/ __/ /
/_/ /_/ /_/__,_/____/__/___/_/
_____ ____ ____ ____
|__ // __ / __ / __ TM
/_ </ / / / / / / / / /
___/ / /_/ / /_/ / /_/ /
/____/____/____/____/
by pedro and rob :)
fizzlemaster3000.js is a drawing tool
which creates grass-like vectors (fizzles)
shooting out of the drawn path.
you can set values like the direction
those fizzles should point at, the
growth/lenght of the generated vectors,
their value of disturbance and the
amount of fizzles created per mousedrag.
+++++++++++++++++++++++++++++++++++++++++++++ */
function onMouseDown(event) {
var degree = parseInt(fizzleDegreeField.text);
var length = parseInt(fizzleLengthField.text);
var difference = parseInt(fizzleDifferenceField.text);
var amount = parseInt(fizzleAmountField.text);
var baseline = parseInt(fizzleBaselineField.text);
paths = new Array(amount);
for (i = 0; i < amount; i++) {
paths[i] = new Path();
}
basepath = new Path();
}
function onMouseUp(event) {
//oh no it's empty :(
}
function onMouseDrag(event) {
var degree = parseInt(fizzleDegreeField.text);
var length = parseInt(fizzleLengthField.text);
var difference = parseInt(fizzleDifferenceField.text);
var amount = parseInt(fizzleAmountField.text);
var baseline = parseInt(fizzleBaselineField.text);
for (i = 0; i < amount; i++) {
paths[i].segments.add(event.point.add(0,0));
var rand_degree = degree + ( ((Math.random() - 0.5) * 2.0) * difference );
var rand_length = length * Math.random();
var rad = -(rand_degree-90) * Math.PI / 180;
var x = Math.cos(rad) * rand_length;
var y = Math.sin(rad) * rand_length;
paths[i].segments.add(event.point.add(x,y));
}
if (baseline == 1) basepath.segments.add(event.point.add(0,0));
}
// ------------------------ Dialog stuff ------------------------
var dialog = new FloatingDialog(FloatingDialog.OPTION_TABBED);
dialog.setTitle("fizzlemaster3000");
var menu=dialog.popupMenu;
menu.visible=true;
var fizzleBaseline = new Static(dialog);
fizzleBaseline.setText("Baseline:");
fizzleBaseline.setLocation(10,90);
var fizzleBaselineField = new TextEdit(dialog);
fizzleBaselineField.setBounds(162,90,30,20);
fizzleBaselineField.text="1";
var fizzleAmount = new Static(dialog);
fizzleAmount.setText("Bunches:");
fizzleAmount.setLocation(10,70);
var fizzleAmountField = new TextEdit(dialog);
fizzleAmountField.setBounds(162,70,30,20);
fizzleAmountField.text="4";
var fizzleDifference = new Static(dialog);
fizzleDifference.setText("Disturbance: (0-50)");
fizzleDifference.setLocation(10,50);
var fizzleDifferenceField = new TextEdit(dialog);
fizzleDifferenceField.setBounds(162,50,30,20);
fizzleDifferenceField.text="30";
var fizzleLength = new Static(dialog);
fizzleLength.setText("Growth: (0-100)");
fizzleLength.setLocation(10,30);
var fizzleLengthField = new TextEdit(dialog);
fizzleLengthField.setBounds(162,30,30,20);
fizzleLengthField.text="80";
var fizzleDegree = new Static(dialog);
fizzleDegree.setText("Direction (in degree):");
fizzleDegree.setLocation(10,10);
var fizzleDegreeField = new TextEdit(dialog);
fizzleDegreeField.setBounds(162,10,30,20);
fizzleDegreeField.text="52";
dialog.setSize(200, 120);
dialog.setVisible(true);
dialog.onClose = function() {
this.destroy();
}