-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathgetLayerType.jsx
63 lines (62 loc) · 1.18 KB
/
getLayerType.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//expressions function
//returns type of a layer
//does not see a difference between null, solid, image and adjustmnt layer
function getLayerType(layer)
{
try
{
var src = layer.source;
if(src.toString() == "[object Comp]")
return "Comp";
else
if(!layer.hasVideo && layer.hasAudio)
return "Audio";
else
if(src.frameDuration == 0)
return "Image or Solid";
else
try
{
layer("ADBE Effect Parade")("CINEMA 4D Effect");
return "Cinema 4D File"
}
catch(e)
{
return "Video";
}
}
catch(e)//no source
{
try
{
layer("ADBE Text Properties");
return "Text";
}
catch(e)//not text
{
try
{
layer("ADBE Light Options Group");
return "Light";
}
catch(e)//not light
{
try
{
layer("ADBE Camera Options Group");
return "Camera";
}
catch(e)
{
try
{
layer("ADBE Root Vectors Group");
return "Shape";
}
catch(e)
{return "Unknown";}
}
}
}
}
}