123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- var myFloatParam = script.addFloatParameter("My Float Param","Description of my float param",.1,0,1);
- function init()
- {
-
-
-
-
- }
- function scriptParameterChanged(param)
- {
-
- script.log("Parameter changed : "+param.name);
- if(param.is(myTrigger)) script.log("Trigger !");
- else if(param.is(myEnumParam)) script.log("Key = "+param.getKey()+", data = "+param.get());
- else script.log("Value is "+param.get());
- }
- function setValue(value)
- {
- script.log("Set value "+value);
- }
- function trigger()
- {
- var sequence = root.sequences.keys;
- var layer = sequence.layers.camZoom;
- var time = sequence.currentTime.get() ;
- myFloatParam.set(layer.automation.getValueAtPosition(time+10.));
- root.customVariables.camAutomation.variables.valueAfter.valueAfter.set(layer.automation.getValueAtPosition(time+1));
- var currentKey = layer.automation.getKeyAtPosition(time);
- var nextKey = layer.automation.getItemAfter(currentKey);
- if(nextKey!=undefined){
-
- var duration = nextKey.position.get() - time;
- var value = nextKey.value.get();
- root.customVariables.camAutomation.variables.value.value.set(value);
- root.customVariables.camAutomation.variables.time.time.set(duration);
- }
- }
|