/* SEQUENCE GROUPING MANAGEMENT MODULE allows to define a template of layers, then create groups of keys using that template groups are composed of one key per layer and a cue cue is used to define the time position of the keys values of each key can be changed keys are grouped by name, and groups can be saved/loaded to a file */ // var parameterPath = local.parameters; // var valuesPath = local.values; var rebuildValues = script.addTrigger("rebuild values", "adds a key at current cursor position" ); var refreshKeys = script.addTrigger("refresh keys", "truc"); var printKeys = script.addTrigger("printKeys","truc"); var moveKey = script.addTrigger("moveKey","truc"); var sequence_structure = { params: {}, groups:{}, keys:{ cues:{}, layers:{} } }; //WAS tl_groups /*group0 : { inCue : {pan : "key", tilt : "key", zoom : "key", dim : "key", focus : "key"}, outCue : {pan : "key", tilt : "key", zoom : "key", dim : "key", focus : "key"} }*/ function init() { script.log("LOADED SEQUENCE GROUPING MANAGEMENT MODULE "); // script.log(); if(testSequenceFile()){loadSequenceFile();} // printMethodsAndProperties(local.parameters.sequenceFile); //test if a file is already defined, //if yes load it, if no refresh sequences enum // if(local.parameters.sequenceFile.getAbsolutePath() != ""){ // script.log("file ok"); // loadSequenceFile(); // } // else{ // local.parameters.sequence.setAttribute("readonly",false); // refreshSequenceEnum(); // } function moduleParameterChanged(param){ script.log("received " + param.name); if (param.name == "sequenceFile") {} else if (param.name == "loadSequence"){loadSequenceFile();} else if (param.name == "exportSequence") { exportSequenceFile();} else if (param.name == "refreshList"){refreshSequenceEnum();} else if (param.name == "sequence"){ var seq = root.sequences.getItems()[local.parameters.sequence.get()]; sequence_structure.params.sequence = seq.name ; script.log(seq.name); // local.parameters.removeContainer("groupTemplate"); // seqCont = local.parameters.addContainer("groupTemplate"); // if (seq.layers.getItems().length){ // for(var j=0 ; j> "+seq[i].name + " " + seq[i].position.get() + " " + seq[i].listSize.get() ); } } else{script.log("nothing to print");} } /////////////////////// VALUES FUNCTIONS /////////////////////// /* Values hold all keys, presented in group containers a nogroup container shows keys that are not grouped */ // function clearValues(){ // var values = local.values.getItems(); // } function rebuildValuesStructure() { script.log("updating values structure"); //empty current structure local.getChild("Values").removeContainer("newGroup"); local.getChild("Values").removeContainer("groups"); local.getChild("Values").removeContainer("ungrouped"); //rebuild containers var ng_cont = local.values.addContainer("New group"); var g_cont = local.values.addContainer("groups"); var ug_cont = local.values.addContainer("ungrouped"); // rebuild new group ng_cont.addTrigger("add group", "adds a new group at cursor time with below values"); ng_cont.addFloatParameter("group time", "time position where the group will be created ", 0., 0.); var layer_cont = ng_cont.addContainer("layers values"); var layers = util.getObjectProperties(sequence_structure.keys.layers) ; for (var i=0; i