Search found 23 matches

by axymark
December 7th, 2014, 6:45 am
Forum: Scripts Discussion
Topic: toWorld scripting equivalent
Replies: 2
Views: 4898

toWorld scripting equivalent

Hi,

Is there a scripting equivalent of toWorld expression? I need to find world position of (possibly) parented objects.

Thanks




edit: I realize i can set expression to temporary property and calculate it that way, but I dont want to do this.
by axymark
November 27th, 2014, 1:26 pm
Forum: Scripts Discussion
Topic: Creating and modifying XML file
Replies: 1
Views: 3635

Re: Creating and modifying XML file

Figured out everything except the way to keep the declaration. If someone knows how to read it out, do tell... Went with getting the first line as you would from a simple text file, checking if it starts with "<?xml", and if it does, saving it out and writing it into file before the modified xml stu...
by axymark
November 27th, 2014, 1:19 pm
Forum: Scripts Discussion
Topic: Assign espression to selected property after adding effect
Replies: 2
Views: 4267

Re: Assign espression to selected property after adding effe

Thanks Xavier. I hacked something quickly with propertyIndex as well so i can move on but ill take a closer look at your code as it seems a bit nicer than what i have.

thanks again
by axymark
November 27th, 2014, 5:28 am
Forum: Scripts Discussion
Topic: Creating and modifying XML file
Replies: 1
Views: 3635

Creating and modifying XML file

Does anyone have some examples on how to create an XML file and modify it (adding elements and such)? I know the basics but i've mostly dealt with modification of existing XML files in the past, not creating one from the scratch. Also, i figured .appendChild(), but when i read XML file, append some ...
by axymark
November 24th, 2014, 1:40 pm
Forum: Scripts Discussion
Topic: Assign espression to selected property after adding effect
Replies: 2
Views: 4267

Assign espression to selected property after adding effect

Im having a problem finding a simple solution with this. I want to add an expression on selected property after i create a few sliders on the same layer. But, once you use .addProperty application seems to lose the selection (property selection, at least). So, if this: var selectedProperty = selecte...
by axymark
November 24th, 2014, 1:26 pm
Forum: Scripts Discussion
Topic: Ckeck if a property is one, two or three dimensions
Replies: 2
Views: 4448

Re: Ckeck if a property is one, two or three dimensions

The weird thing is even if the layer is 2D, its transform values are still 3 dimensional. So property.value.length will return 3 for scale, position, anchor point, etc. even if your layer is 2D. But, it will return undefined for one dimensional values like rotation. So, you might need a combination ...
by axymark
September 4th, 2014, 7:37 am
Forum: Scripts Discussion
Topic: How to know how many parameters does have an effect??
Replies: 3
Views: 4658

Re: How to know how many parameters does have an effect??

Code: Select all

ombreControler.numProperties
You would have figured it out if only you read the previous thread ;)
by axymark
August 31st, 2014, 5:22 pm
Forum: Scripts Discussion
Topic: Add a Slider and an Expression to the selected Properties?
Replies: 4
Views: 6670

Re: Add a Slider and an Expression to the selected Propertie

In Paul's example theProp gets object property, while for the effect parameters you need to grab property group and than a property under that group. var comp = app.project.activeItem; var prop = app.project.activeItem.selectedProperties[0]; var expr = "x = 50;"; if (prop.isEffect == true) { for (va...
by axymark
July 12th, 2014, 10:52 am
Forum: Scripts Discussion
Topic: Check if effect or preset is available
Replies: 1
Views: 3955

Re: Check if effect or preset is available

Never mind, figured it out.

Code: Select all

var effectNameCollection = app.effects;
var check = false;
for (var i = 0; i < effectNameCollection.length; i++) {
    var name = effectNameCollection[i].displayName;
    if (name == "Effect Display Name") {
        check = true;
    }
}
by axymark
July 12th, 2014, 9:44 am
Forum: Scripts Discussion
Topic: Check if effect or preset is available
Replies: 1
Views: 3955

Check if effect or preset is available

Hi,

How do you check if an effect is available (installed)?

Depending on whether user has a certain plugin/effect installed i need to either add that or perform a set of actions to mimic the desired effect so i need to check first.

Appreciate your help.
by axymark
July 1st, 2014, 10:41 am
Forum: Scripts Discussion
Topic: identifying Photoshop or Illustrator layers in Project
Replies: 3
Views: 5461

Re: identifying Photoshop or Illustrator layers in Project

In fact, it does exactly that. Obviously, the psd files have to be identical or at least identically structured. Here's the code: // psdFileData is a multidimentional array which contains both source and // destination paths for each psd file. // eg: [D:\folder1\myfile.psd,D:\folder2\myfile\myfile.p...
by axymark
June 29th, 2014, 11:27 am
Forum: Scripts Discussion
Topic: copy folder (on file system)
Replies: 0
Views: 4608

copy folder (on file system)

Searching for hours on this to no avail... I need to copy entire folder and it's contents (files and folders, whole hierarchy) on file system but both scripting and tools guides suggest there's no easy command to do this directly from after effects. I can copy individual files using fileObj.copy (ta...
by axymark
June 29th, 2014, 11:26 am
Forum: Scripts Discussion
Topic: identifying Photoshop or Illustrator layers in Project
Replies: 3
Views: 5461

Re: identifying Photoshop or Illustrator layers in Project

Hi Mikeoverbeck,

I had the same problem (psd's only though, no ai) and in the end i resorted to saving a project as .aepx and editing out xml. It wasn't fun but it worked. Unfortunately i cannot share the script but i could post a snippet related to xml parsing tomorrow if it helps.
by axymark
January 28th, 2014, 10:03 am
Forum: Scripts Discussion
Topic: Get all parent folders to project root
Replies: 3
Views: 5944

Re: Get all parent folders to project root

I suspected that would be the case. Made these functions to deal with it: function getItemProjectPath(item) { var parent = item.parentFolder; var string = ""; while (parent != app.project.rootFolder) { var name = "/" + parent.name; string = name.concat(string); parent = parent.parentFolder; } return...
by axymark
January 26th, 2014, 2:10 pm
Forum: Scripts Discussion
Topic: Get all parent folders to project root
Replies: 3
Views: 5944

Re: Get all parent folders to project root

Another question, is it possible to get item index under parent folder? If structure is something like this: Root |-- FolderA |-- FolderB |-- ItemA |-- ItemB |-- ItemC ItemC is of an index 5 but, knowing that, how would i figure out that this item is of an index 3 under its own parent folder? Trying...