-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdebughelper.jsx
34 lines (30 loc) · 974 Bytes
/
debughelper.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//debug helper - creates a small panel with text layer linked to all selected properties
//now works in a comand line mode
var activeItem = app.project.activeItem;
var activeItem = app.project.activeItem;
if (activeItem != null && activeItem instanceof CompItem){
var sel = activeItem.selectedProperties;
if(sel){
var prevLayerIndex = -1;
for(var i = 0 ; i < sel.length ; i++){
if(sel[i].propertyValueType){
if(getParentLayer(sel[i]).index != prevLayerIndex){
$.writeln("\n====================");
$.writeln(getParentLayer(sel[i]).name);
$.writeln("====================");
prevLayerIndex = getParentLayer(sel[i]).index;
}
$.writeln(sel[i].name + ': ' + String(sel[i].value));
}
}
}
}
function getParentLayer(_property){
//recursively gets the parent layer
if(_property.propertyDepth>0){
return getParentLayer(_property.parentProperty);
}
else{
return _property;
}
}