Bryan Woods
Forum Replies Created
-
Thanks Dan. Thats solving part of my issues. I’m now seeing the correct number of keyframes indicated, but the first keyframe created is always a regular keyframe (diamond), while the others are linear Hold frames (square with a notch cut into its left side). Also, the distance in frames from the first keyframe to the second is two frames, but every keyframe after the second is one frame apart. So the input for duration between the hold keyframes isn’t being set properly.
-
Here’s the closest I’ve come so far however I can’t figure out how to convert keyframes to hold keyframes, and its not skipping the set number of frames I want. :
{//Set Undo Group
app.beginUndoGroup("xsheet_remap");//Define project and active items
var activeItem = app.project.activeItem;
var selectedLayer = activeItem.selectedLayers[0];
var curTime = activeItem.time;//testing variables
var numFrames = 5;
var holdLength = .6;//Meat and Potatoes
for (var f=1; f<=numFrames; f++){
if (selectedLayer.timeRemapEnabled == false){
selectedLayer.timeRemapEnabled = true;
}else{
selectedLayer.timeRemap.addKey(f);
selectedLayer.timeRemap.setInterpolationTypeAtKey(selectedLayer, KeyframeInterpolationType.LINEAR, KeyframeInterpolationType.HOLD);
curTime+holdLength;
}
}app.endUndoGroup("xsheet_remap");
} -
Ok, lets think about this a different way. What I really need to accomplish is setting a hold keyframe for every frame of an animation’s key poses. We know what the frame rate is and how long each frame needs to be held out for, so really, I just need to set up a system to take an input of How many key poses are there, and how long each hold keyframe needs to be for.
So here’s the process:
Ask user how many frames in the image sequence there are. Save that value and call it “f”.
Ask the user how long each frame should last (in frames). Save this as “fLength”.Now, from the current time indicator in your comp, on the selected layer, go through each frame and set a hold keyframe for the set amount of time. Lets say frame 1 of the comp has a hold keyframe on time remap set to “1”. Advance 4 frames, then set another hold keyframe on time remap, this time as “2”. Advance 4 more frames, set another hold keyframe, this one as “3”, etc. Make sense?
So what I know so far is I need a loop to advance through the given number of frames, and to advance each set hold keyframe by one, but I don’t know how to do that. I know if you do something like lets say “i++’, this will advance the loop, but how do I say when I set a hold keyframe, to advance the value of that hold keyframe by one?
Here’s some rough code that I have at the moment (and some sudo code):
{//Set Undo Group
app.beginUndoGroup("xsheet_remap");//Define project and active items
var proj = app.project;
var theComp = proj.activeItem;
var selectedLayers = theComp.selectedLayers;activeLayer = comp.selectedLayers[0];
curTime = comp.time;var numFrames = parseFloat(prompt("Number of frames"));
var holdLength = parseFloat(prompt("Hold each frame this # of frames"));for (var f=1; f<numFrames; f++ ){
activeLayer.timeRemap.addKeyAtTime(f);
advance "holdLength"; //sudo code
}app.endUndoGroup("xsheet_remap");
} -
No suggestions yet? Bummer. 🙁
If anyone is not sure what I’m trying to do here, please let me know and I can elaborate. I know this will require a script, not just an expression, but how to start the script and take values from a spreadsheet i’m not sure about and looking for suggestions.
-
Aweseome, yeah I noticed the discrepency as well. Seems to be working properly. I added a check for source text. At this point I think i’ve covered every possible expression property, but do you know if there is a way to just create one statement that just accepts a value had an expression and converts its value? Instead of writing out planning for every possible expression attribute…
Thanks for your help on this! Much easier than the steps I had in mind.
-
I’m not getting any life from your above code. Are you sure convertExpressionToValue is a valid function? Or do we need to define it? Because I run this at the moment on my selected layers, and nothing happens. Not even an error message pops up.
-
Ok, that could be an option. I wasn’t aware that this could be another way. If it removes the trimming/extending steps, that would be awesome. From your code you posted, would I use this for every check of each type of expression like in Dan’s code? Or would this be enough if we just applied this to a selected layer and it converts to setvalue for every expression in a layer?
Thanks for your suggestion!
-
Bryan Woods
June 22, 2013 at 12:35 am in reply to: Save AE frame to Photoshop layers WITH EDITABLE TEXTWhy isn’t this just part of AE in the first place? Wouldn’t this make sense if you already offer the feature to export to photoshop? Isn’t this THE reason to use this feature?! The nearsightedness of this just blows my mind! And you’re telling me to request finishing a feature that was only 75% thought through?! There’s no way putting my vote in or trying to encourage others to vote for this will do any good because there will never be enough votes to make it a priority! You might as well just remove the feature entirely so as to not give false hope or suggest it possible to have two different Adobe applications (god forbid) play nicely together.
Just another stupid inconvenience I’ve discovered of AE that makes my life miserable, but I can’t do anything about it because I have to USE your software to make a living.
Disgusting.
-
Ah, makes sense. Thank you for the explanation!
-
Ah, I should have noticed that your “myComp” was essentially the same thing as my “theComp” variable. They were calling the same thing, just broken out more.
What is the difference though between .layer[maxIndex] and .layer(maxIndex)? I don’t follow why the change in brackets to parenthesis.
Thanks again for your help on this Dan. I always greatly appreciate your support.