|
@@ -79,7 +79,7 @@ function init() {
|
|
|
// importSequenceFile(saveFile);
|
|
|
// layers = local.getChild("values").keys.layers ;
|
|
|
// script.log(root.sequences.truc.layers.speed.getType());
|
|
|
- // printMethodsAndProperties(root.sequences.truc.layers.audio);
|
|
|
+ printMethodsAndProperties(root.sequences.truc.layers.audio);
|
|
|
// script.log(local.getChild("values").groups.group0.cue.get());
|
|
|
//test if a sequence is already choosen else refresh and unlock sequence enum
|
|
|
sequence = local.getChild("parameters").sequence.getKey();
|
|
@@ -603,9 +603,29 @@ function struct_buildValuesFromSeq(){
|
|
|
for (var i = 0; i<groupList.length; i++){
|
|
|
//check if cue exist, else remove group
|
|
|
// script.log(groupList[i]);
|
|
|
+
|
|
|
+ //v1, remove cue doesn't remove group keys
|
|
|
+ // 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]);
|
|
|
+ // hasUpdated = true;
|
|
|
+ // break;
|
|
|
+ // }
|
|
|
+
|
|
|
+ //v2, remove cue removes group keys
|
|
|
var groupCue = tl_seq.cues.getItemWithName(groupList[i]);
|
|
|
if(groupCue.name==undefined){
|
|
|
- script.log("cue " + groupList[i] + "not found, removing group (keys survive this)");
|
|
|
+ script.log("cue " + groupList[i] + "not found, removing keys and group");
|
|
|
+ var groupToRemove = groups.getChild(groupList[i]);
|
|
|
+ var groupToRemoveKeyslist = util.getObjectProperties(groupToRemove.keys, true, false);
|
|
|
+ for(var removeKeyIndex = 0; removeKeyIndex< groupToRemoveKeyslist.length; removeKeyIndex++) {
|
|
|
+ var tl_removeLayer = tl_seq.layers.getItemWithName( groupToRemoveKeyslist[removeKeyIndex]) ;
|
|
|
+ var tl_removeKey = tl_removeLayer.automation.getItemWithName(groupToRemove.keys.getChild( groupToRemoveKeyslist[removeKeyIndex]).get());
|
|
|
+ script.log(tl_removeKey.name);
|
|
|
+ tl_removeLayer.automation.removeItem(tl_removeKey);
|
|
|
+ }
|
|
|
groups.removeContainer(groupList[i]);
|
|
|
hasUpdated = true;
|
|
|
break;
|