ADOBE AFTER EFFECTS: Forum Expressions Tutorials Podcasts Creative Cloud

Scaling up a 3D stroke

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
James DeanScaling up a 3D stroke
by on Sep 11, 2015 at 12:19:58 pm

Hi all,

I've got a LOT of comps each containing a single solid with 3D stroke and a camera.

I'd like to try up-rezing the comps to about 4 times their current resolution. Pre-composing and scaling creates predictably soft results. Pre-composing, scaling and using continuous transforms doesn't help. Using the Detail Preserving Upscale plugin doesn't look any better than a conventional scale.

SO, I'm trying to rebuild the comps. My thought process is this:

1) Change the dimensions of the comp. I'm doing this through scripting rather than the AE front end so that it doesn't 'helpfully' recentre everything.
2) Update the solid to match the new comp dimensions.

3)Since masks and effect properties are stored internally relative to the dimension of the solid, the mask shape and spatial effect parameters have all been multiplied by 4. I use a script to scale them back.

Now every parameter (effect settings, camera position, mask co-ordinates) are the same in my new and old comps but I'm not getting anything even visually close to the original comp.

Has anyone else tried to achieve something similar?



Return to posts index

Dave LaRondeRe: Scaling up a 3D stroke
by on Sep 11, 2015 at 4:05:44 pm

Sorry, but you have to re-do those 3D strokes. Like EVERY effect in AE, it's bitmapped, and when you scale it up, you lose resolution.

Dave LaRonde
Promotion Producer
KGAN (CBS) & KFXA (Fox) Cedar Rapids, IA

Return to posts index

James DeanRe: Scaling up a 3D stroke
by on Sep 11, 2015 at 7:36:42 pm

Hi Dave,

I agree that the end result of running the effect is a bitmap, but 3D Stroke is parametrically controlled, so I'm looking for a way to change the parameters to give me the same image at a higher res.

I pushed on with my original thinking and I think I've got it cracked...

Should anyone need to do this or something similar then the code below should do it (WARNING - SCRAPPY CODE WITH NO ERROR CHECKING! - SAVE YOUR PROJECT FIRST!). Just run this from the ExtendScript Toolkit.

scaleFactor = 5; // this is what we're going to scale the comp by
targetLayer = "stroke 2" //put the name of the layer containing 3D Stroke

app.beginUndoGroup("rescale 3D Stroke comp");
c = app.project.activeItem;
originalEffect = c.layer(targetLayer).effect("3D Stroke");
bend = originalEffect("Bend").value;
pos = originalEffect("XY Position").value;
d = c.duplicate(); = + "(x"+scaleFactor+")"
d.width = d.width*scaleFactor;
d.height = d.height*scaleFactor;
l = d.layer(targetLayer);

var strokeEffect = l.effect("3D Stroke");
strokeEffect("XY Position").setValue(pos/scaleFactor);

tempLayer = d.layers.addSolid([0,0,0],"scriptSolid", d.width, d.height, 1.0);
myShape = l.mask(1).maskShape.value;
var verts = [];
for(e in myShape.vertices) {
var oldPoint = myShape.vertices[e];
var newPoint = [(oldPoint[0]-(d.width/2))/scaleFactor +(d.width/2),(oldPoint[1]-(d.height/2))/scaleFactor + (d.height/2)];
myShape.vertices = verts;

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2016 All Rights Reserved