-
Notifications
You must be signed in to change notification settings - Fork 0
/
Chataigne_ScriptObjectExplorer.js
59 lines (44 loc) · 1.4 KB
/
Chataigne_ScriptObjectExplorer.js
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
///////////////////////// INIT ///////////////////////////////
function init(){
local.scripts.chataigne_ScriptObjectExplorer.enableLog.set(true);
}
function moduleParameterChanged(param){
if(param.is(local.parameters.print)){
getObjectString();
}
if(param.is(local.parameters.object)){
getObjectString();
}
}
function getObjectString(){
var splitAdress = local.parameters.object.get().split(".");
var obj = root;
var lost = false;
for (var i=1; i<splitAdress.length; i++){
obj = obj.getChild(splitAdress[i]);
if (obj==undefined){lost = true;}
}
if(!lost){getMethodsProperties(obj);}
else{script.log("script adress not recognized");}
}
function getMethodsProperties(myObject){
script.log("OBJECT : "+local.parameters.object.get());
var log = util.getObjectProperties(myObject, true, false);
script.log("Parameters :");
for (var i = 0 ; i<log.length; i++){
script.log(". "+log[i]+" : "+myObject[log[i]]);
}
script.log("\n");
var log = util.getObjectProperties(myObject, false, true);
script.log("Properties :");
for (var i = 0 ; i<log.length; i++){
script.log(". "+log[i]+" : ");
}
script.log("\n");
log = util.getObjectMethods(myObject);
script.log("Methods :");
for (var i = 0 ; i<log.length; i++){
script.log(". "+log[i]);
}
script.log("\n");
}