• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Scripting for disort & transform effect fisheye

Community Beginner ,
Sep 20, 2019 Sep 20, 2019

Copy link to clipboard

Copied

Hi everyone, 

 

I'm looking for a similar script to adapt it. 

I would like to go from -100% on the effect to 0, while rendering each image. 

I looked for on google but only found 2004-2005 unuseful scripts. 

 

Thanks in advance, 

 

Loïc 

TOPICS
Scripting

Views

570

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Sep 21, 2019 Sep 21, 2019

Copy link to clipboard

Copied

check my example code in this thread and change the Deform Style from 9 to 12

 

https://community.adobe.com/t5/Illustrator/How-to-create-envolope-Text-in-C-with-ExecuteMenuCommand/...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 22, 2019 Sep 22, 2019

Copy link to clipboard

Copied

Hi Carlos, thanks for your answer ! Script works ! Now, I want it to export at each percentage change in the effect. For example if I have got a square and apply it a 80% fisheye effect, I would like the script to go at 1%, save png, 2% save png, and so... Any idea where I can find a similar script to combine both ? Thanks in advance !

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 22, 2019 Sep 22, 2019

Copy link to clipboard

Copied

check this thread, ther's a sample that saves each artboard to png, you don't need that but it has a loop and png save sample you can adapt to your needs. Post back if you get stuck.

https://community.adobe.com/t5/Illustrator/Setting-the-resolution-output-in-an-export-PNG-script/m-p...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 23, 2019 Sep 23, 2019

Copy link to clipboard

Copied

Thanks for your answer, works well. I merged 3 scripts, png export, disort, and duplicate artboard. Here is my script, I cannot figure out why illustrator keep crashing when it begins to draw.

 

 

var nbr = 99;
var doc = app.activeDocument;;//Gets the active document
/// SAVE  PNG
$.writeln(doc.name);
var fileName = doc.name.slice(0, 9);//Gets the G Number

var numArtboards = doc.artboards.length;//returns the number of artboards in the document
var filePath = (app.activeDocument.fullName.parent.fsName).toString().replace(/\\/g, '/');
var options = new ImageCaptureOptions();

function save()	{
	for (var i = 0; i < numArtboards; i++) {
	
	  doc.artboards.setActiveArtboardIndex(i);
	
	   var activeAB = doc.artboards[doc.artboards.getActiveArtboardIndex()];
	
	
	  options.artBoardClipping = true;
	
	  options.resolution = 300;
	
	  options.antiAliasing = true;
	
	  options.matte = false;
	
	  options.horizontalScale = 108.3;
	
	  options.verticalScale = 108.3;
	
	  options.transparency = true;
	
	
	   var artboardName = doc.artboards.name;
	
	   var destFile = new File(filePath + "/" + fileName + " " + i + ".png");
	
	  doc.imageCapture(destFile, activeAB.artboardRect, options);
	
	}
}

// DRAW
function draw(nbr){
	var p = doc.selection[0]; 
    for (index = 0; index <  1; index =+ 1) {
	value = index+1 / 100;
	xmlstring = '<LiveEffect name="Adobe Deform"><Dict data="B Rotate 0 R DeformVert 0 R DeformHoriz 0 I DeformStyle 12 R DeformValue #value "/></LiveEffect>'.replace('#value', value);	
    p.applyEffect(xmlstring);
	app.redraw();
};
    }

function copyartboard(){
    var doc = app.activeDocument;
    var thisBoardIndex = doc.artboards.getActiveArtboardIndex();
    var thisBoard = doc.artboards[thisBoardIndex];
    var thisRect = thisBoard.artboardRect;
    var lastBoard = doc.artboards[doc.artboards.length - 1];
    var lastRect = lastBoard.artboardRect;
    doc.selectObjectsOnActiveArtboard();
    app.copy();
    var newBoard = doc.artboards.add(thisRect);
    var offsetH = 0;
    //$.writeln(doc.selection[active]);
    newBoard.artboardRect = [
        lastRect[2] + offsetH,
        lastRect[1],
        lastRect[2] + offsetH + (thisRect[2] - thisRect[0]),
        lastRect[3]
    ];
    newBoard.name = thisBoard.name + " copy";
    app.executeMenuCommand("pasteFront");
    doc.selection = null;
};

function go(nbr){
for (index = 0; index < nbr ; index++) {
	copyartboard();
};
for (active = 0; active < nbr ; active++) {
	draw(nbr,active);
};
//save();
}
go(nbr);

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Sep 26, 2019 Sep 26, 2019

Copy link to clipboard

Copied

For one there is a syntax error and you are using "=+" when you mean to use "+="

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 27, 2019 Sep 27, 2019

Copy link to clipboard

Copied

LATEST
Yes this is right, fixed it, I think the problem is on my var ‘p’ .. I tried a few different things but it does not work

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines