|
@@ -29,7 +29,7 @@ var filePath = local.parameters.sequenceFile ;
|
|
|
|
|
|
|
|
|
var newGroupLayers = local.values.newGroup.layers ;
|
|
|
-var groups = local.getChild("values").groups ;
|
|
|
+
|
|
|
var cues = local.getChild("values").keys.cues ;
|
|
|
|
|
|
var layers = local.getChild("values").keys.layers ;
|
|
@@ -283,7 +283,7 @@ function struct_buildValuesFromSeq(){
|
|
|
var addRemove = delta > 0 ? false : true ;
|
|
|
|
|
|
delta = Math.abs(delta);
|
|
|
- script.log("change "+ delta + (addRemove ? " up" : " down"));
|
|
|
+ script.log("cues "+ delta + (addRemove ? " up" : " down"));
|
|
|
for(var i=0; i<delta; i++){
|
|
|
|
|
|
if(addRemove){
|
|
@@ -322,7 +322,7 @@ function struct_buildValuesFromSeq(){
|
|
|
var delta = layersList.length-tl_layers.length;
|
|
|
var addRemove = delta > 0 ? false : true ;
|
|
|
delta = Math.abs(delta);
|
|
|
- script.log("change "+ delta + (addRemove ? " up" : " down"));
|
|
|
+ script.log("layers "+ delta + (addRemove ? " up" : " down"));
|
|
|
for(var i=0; i<delta; i++){
|
|
|
|
|
|
if(addRemove){
|
|
@@ -370,7 +370,7 @@ function struct_buildValuesFromSeq(){
|
|
|
var delta = keyList.length-tl_keys.length;
|
|
|
var addRemove = delta > 0 ? false : true ;
|
|
|
delta = Math.abs(delta);
|
|
|
- script.log("change "+ delta + (addRemove ? " up" : " down"));
|
|
|
+ script.log("keys "+ delta + (addRemove ? " up" : " down"));
|
|
|
for(var i=0; i<delta; i++){
|
|
|
|
|
|
|
|
@@ -403,7 +403,69 @@ function struct_buildValuesFromSeq(){
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+ tl_seq = root.sequences.getItemWithName(sequence);
|
|
|
+ var groups = local.getChild("values").groups ;
|
|
|
+ var groupList = util.getObjectProperties(groups, true, false);
|
|
|
+
|
|
|
+ if(groupList.length){
|
|
|
+ for (var i = 0; i<groupList.length; i++){
|
|
|
+
|
|
|
+
|
|
|
+ if(tl_seq.cues.getItemWithName(groupList[i]).name==undefined){
|
|
|
+ script.log("cue " + groupList[i] + "not found, removing group (keys survive this)");
|
|
|
+ groups.removeContainer(groupList[i]);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ else {
|
|
|
+ groups = local.getChild("values").groups ;
|
|
|
+ groupList = util.getObjectProperties(groups, true, false);
|
|
|
+ var currentGroup = groups.getChild(groupList[i]);
|
|
|
+ var currentGroupLayers = util.getObjectProperties (currentGroup.keys, true, false);
|
|
|
+ if (currentGroupLayers.length){
|
|
|
+
|
|
|
+ for(var j=0; j<currentGroupLayers.length; j++){
|
|
|
+
|
|
|
+ groups = local.getChild("values").groups ;
|
|
|
+ groupList = util.getObjectProperties(groups, true, false);
|
|
|
+ currentGroup = groups.getChild(groupList[i]);
|
|
|
+ currentGroupLayers = util.getObjectProperties (currentGroup.keys, true, false);
|
|
|
+ var tl_layer = tl_seq.layers.getItemWithName(currentGroupLayers[j]);
|
|
|
+ var keyName = currentGroup.keys.getChild(tl_layer.name).get();
|
|
|
+
|
|
|
+ if(tl_layer.automation.getItemWithName(keyName).name == undefined){
|
|
|
+ groups = local.getChild("values").groups ;
|
|
|
+ groupList = util.getObjectProperties(groups, true, false);
|
|
|
+ currentGroup = groups.getChild(groupList[i]);
|
|
|
+ currentGroupLayers = util.getObjectProperties (currentGroup.keys, true, false);
|
|
|
+ tl_layer = tl_seq.layers.getItemWithName(currentGroupLayers[j]);
|
|
|
+ keyName = currentGroup.keys.getChild(tl_layer.name).get();
|
|
|
+ script.log("should remove" + currentGroup.name + " " + currentGroupLayers[j]);
|
|
|
+ currentGroup.keys.removeParameter(currentGroupLayers[j]);
|
|
|
+ currentGroup.removeParameter(currentGroupLayers[j]);
|
|
|
+ currentGroup.setCollapsed(true);
|
|
|
+ currentGroup.setCollapsed(false);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(tl_layers.length){
|
|
|
+ for (var j=0; j<tl_layers.length; j++){
|
|
|
+ if(!tl_layers[j].automation.getItemWithName(groupList[i])){
|
|
|
+ script.log("key " + groupList[i] + "not found, removing group (keys survive this)");
|
|
|
+ groups.removeContainer(groupList[i]);}
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
inibValuesChanged = false;
|
|
|
|
|
|
}
|
|
@@ -447,17 +509,28 @@ function struct_exportToFile(){}
|
|
|
|
|
|
|
|
|
function seq_clearSequence(){
|
|
|
-
|
|
|
+
|
|
|
var seq = root.sequences.getItemWithName(sequence) ;
|
|
|
script.log("clearing all keys and cues of sequence : "+seq.name);
|
|
|
seq.cues.removeAll();
|
|
|
var layers = seq.layers.getItems();
|
|
|
if(layers.length){
|
|
|
for (var i = 0; i<layers.length; i++){
|
|
|
- layers[i].automation.removeAll();
|
|
|
+ if(layers[i].automation){layers[i].automation.removeAll();}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ var groups = local.getChild("values").groups;
|
|
|
+ var groupsList = util.getObjectProperties(groups, true, false);
|
|
|
+ if (groupsList.length){
|
|
|
+ for(var i=0; i<groupsList.length; i++){
|
|
|
+ groups.removeContainer(groupsList[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -466,62 +539,14 @@ function seq_buildSeqFromValues(){}
|
|
|
|
|
|
function seq_buildSeqFromFile(){}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
function createNewGroup(){
|
|
|
script.log("create new group");
|
|
|
|
|
|
- groups = local.getChild("values").groups;
|
|
|
+ var groups = local.getChild("values").groups;
|
|
|
var groupsList = util.getObjectProperties(groups, true, false);
|
|
|
var index = groupsList.length == undefined ? 0 : groupsList.length;
|
|
|
- var currentGroup = groups.addContainer("Group"+ index);
|
|
|
+ var currentGroup;
|
|
|
|
|
|
var tl_seq = root.sequences.getItemWithName(sequence);
|
|
|
var tl_layers = tl_seq.layers.getItems();
|
|
@@ -533,9 +558,22 @@ function createNewGroup(){
|
|
|
script.log(currentTime);
|
|
|
newCue = tl_seq.cues.addItem();
|
|
|
newCue.time.set(currentTime);
|
|
|
- newCue.setName(currentGroup.name);
|
|
|
+
|
|
|
+
|
|
|
+ for (var i=0; i<=groupsList.length+1; i++){
|
|
|
+ if(tl_seq.cues.getChild("group"+i)==undefined){
|
|
|
+ newCue.setName("group"+i);
|
|
|
+ currentGroup = groups.addContainer("group"+i);
|
|
|
+ script.log("create new group: group"+i);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
currentGroup.addFloatParameter(newCue.name, "cue of the group", currentTime, 0.);
|
|
|
-
|
|
|
+ var keysContainer = currentGroup.addContainer("keys");
|
|
|
+ keysContainer.setCollapsed(true);
|
|
|
|
|
|
|
|
|
if(tl_layers.length){
|
|
@@ -546,7 +584,8 @@ function createNewGroup(){
|
|
|
newKey.position.set(currentTime);
|
|
|
|
|
|
newKey.value.set(Math.random());
|
|
|
- currentGroup.addFloatParameter(tl_layers[i].name,tl_layers[i].name+" value" , newKey.value.get(), 0.);
|
|
|
+ keysContainer.addStringParameter(tl_layers[i].name, "",newKey.name );
|
|
|
+ currentGroup.addFloatParameter(tl_layers[i].name,tl_layers[i].name+" value" , newKey.value.get(), 0., 0., 1.);
|
|
|
|
|
|
tl_layers[i].automation.reorderItems();
|
|
|
}
|