|
@@ -413,7 +413,8 @@ function struct_buildValuesFromSeq(){
|
|
|
for (var i = 0; i<groupList.length; i++){
|
|
|
//check if cue exist, else remove group
|
|
|
// script.log(groupList[i]);
|
|
|
- if(tl_seq.cues.getItemWithName(groupList[i]).name==undefined){
|
|
|
+ var groupCue = tl_seq.cues.getItemWithName(groupList[i]);
|
|
|
+ if(groupCue.name==undefined){
|
|
|
script.log("cue " + groupList[i] + "not found, removing group (keys survive this)");
|
|
|
groups.removeContainer(groupList[i]);
|
|
|
}
|
|
@@ -424,6 +425,10 @@ function struct_buildValuesFromSeq(){
|
|
|
groupList = util.getObjectProperties(groups, true, false);
|
|
|
var currentGroup = groups.getChild(groupList[i]);
|
|
|
var currentGroupLayers = util.getObjectProperties (currentGroup.keys, true, false);
|
|
|
+ //update cue time
|
|
|
+ var groupTime = groupCue.time.get();
|
|
|
+ currentGroup.cue.set(groupTime);
|
|
|
+
|
|
|
if (currentGroupLayers.length){
|
|
|
// script.log(currentGroupLayers.length);
|
|
|
for(var j=0; j<currentGroupLayers.length; j++){
|
|
@@ -435,6 +440,7 @@ function struct_buildValuesFromSeq(){
|
|
|
var tl_layer = tl_seq.layers.getItemWithName(currentGroupLayers[j]);
|
|
|
var keyName = currentGroup.keys.getChild(tl_layer.name).get();
|
|
|
// script.log(tl_layer.name + " " +tl_layer.automation.getItemWithName(keyName).name);
|
|
|
+ //if key dosn't exist anymore, remove it from group
|
|
|
if(tl_layer.automation.getItemWithName(keyName).name == undefined){
|
|
|
groups = local.getChild("values").groups ;
|
|
|
groupList = util.getObjectProperties(groups, true, false);
|
|
@@ -449,7 +455,20 @@ function struct_buildValuesFromSeq(){
|
|
|
currentGroup.setCollapsed(false);
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+ //if key exists, update value from tl and update time from group cue
|
|
|
+ else{
|
|
|
+ //apply groupTime
|
|
|
+ var tl_key = tl_layer.automation.getItemWithName(keyName);
|
|
|
+ tl_key.position.set(groupTime);
|
|
|
+ //get tl value
|
|
|
+ var keyValue = tl_key.value.get();
|
|
|
+
|
|
|
+ var currentKey = currentGroup.getChild(tl_layer.name);
|
|
|
+ // script.log(tl_layer.name + " " +keyName+" " + keyValue);
|
|
|
+ // script.log(currentKey.name + " " +keyName+" " + keyValue);
|
|
|
+ currentKey.set(keyValue);
|
|
|
+ // script.log(currentKey.get());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
//if cue doesn't exist, remove whole group
|
|
@@ -460,6 +479,9 @@ function struct_buildValuesFromSeq(){
|
|
|
groups.removeContainer(groupList[i]);}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //update group values
|
|
|
+
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -585,7 +607,7 @@ function createNewGroup(){
|
|
|
// newKey.value.set(local.values.newGroup.layersValues[layers[i].name].get());
|
|
|
newKey.value.set(Math.random());
|
|
|
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.);
|
|
|
+ currentGroup.addFloatParameter(tl_layers[i].name,tl_layers[i].name+" value" , newKey.value.get(), 0., 1.);
|
|
|
// newKey.addStringParameter("group", "key is part of this group","mongroupe");
|
|
|
tl_layers[i].automation.reorderItems();
|
|
|
}
|