Malcolm Ricci
Forum Replies Created
-
Malcolm Ricci
July 10, 2020 at 12:11 pm in reply to: ‘Infallible Scale Expression’ – Problems with auto scaling images to comp sizeThanks for the replies Tomas and Filip.
Filip I’ve just realised that you responded on the other thread. Apologies for not getting back to you earlier.
It seems pretty complex but I’ll give it a whirl and follow it step by step and get back to you 🙂
-
Malcolm Ricci
July 6, 2020 at 2:57 pm in reply to: ‘Infallible Scale Expression’ – Problems with auto scaling images to comp sizeHey guys,
So I’ve run into another problem with this expression.
The expression that I’m currently using was provided by Dan and it works great with jpegs, however when it comes to applying it to pngs, the expression calculates the boundary box of the png, rather than the content of the png itself.
Therefore although the expression does indeed scale the png to the required size, some pngs end up looking larger or smaller than others due to the difference in ‘space’ between the actual image and the boundary box of the image.
Is there a way to modify this expression so that it could calculate the ‘pixels’ or ‘content’ of the layer, rather than the boundary box?
I know of a script that can do this, it’s called ‘Auto Crop’ if I’m not mistaken, however I have to work with expressions and not scripts since the rendering is taking place on a server with just the AE render engine running.
I’ve uploaded three images for your reference.
Any help with this would be greatly appreciated.
Thanks,
Malcolmw = thisLayer.width;
h = thisLayer.height;
try{
p = thisLayer.source.pixelAspect;
}catch(e){
p = 1;
}
compW = thisComp.width;
compH = thisComp.height;
compP = thisComp.pixelAspect;
if ((w*p)/h > (compW*compP)/compH){
s = ((compW*compP)/(w*p))*100;
}else{
s = (compH/h)*100;
}
[s,s] -
Malcolm Ricci
July 6, 2020 at 10:45 am in reply to: Is there a way to know the width and height of a layer similar to sourceRectAtTime?Hey guys,
By any chance do you know whether there is an expression that could be used instead of the Auto-Crop 2 script please?
I need it to be an expression as the project file is shared over multiple computers and some of them cannot have any scripts installed on them.
Thanks,
Malcolm -
Malcolm Ricci
July 3, 2020 at 4:25 pm in reply to: ‘Infallible Scale Expression’ – Problems with auto scaling images to comp sizeSOLVED – apparently there was a conflict with the name of the comp being the same as the image, which made the remote input bypass the image with the expression and replaced the comp directly.
Thanks for the feedback just the same.
-
Malcolm Ricci
July 3, 2020 at 7:33 am in reply to: ‘Infallible Scale Expression’ – Problems with auto scaling images to comp sizeHey Filip,
Thanks for your reply. Since writing this post I found out that CC2019 and 2020 have the option of changing the engine from Javascript-engine to legacy-extendscript, however when checking it it seems that it was already set to legacy-extendscript.
In the meantime, I am trying to figure out whether the expressions are active but providing the wrong numbers, or are they throwing an error and disabled, but I am not 100% sure how to go about this as the network that I set up is using an After Effects render engine rather than the full version of After Effects.
I feel I may be a little over my head with this yet at the same time think that it is something very simple that I am overlooking.
I am going to install the full version of After Effects on the network and open it and see whether the expressions are still active or not and take it from there.
What baffles me the most is that I have been using this set up for around six months now and had absolutely no issues with the expression with regard to .jpegs, so there must be something going on with the fact that they are .pngs rather than .jpegs.
If anyone else has come across this issue I’d be really grateful for any other feedback on this. In the meantime, I will post my findings in case someone else is also stuck with this.
Thanks,
Malcolm -
Malcolm Ricci
July 2, 2020 at 5:33 pm in reply to: ‘Infallible Scale Expression’ – Problems with auto scaling images to comp sizeHey guys,
I know that this is a bit of an old thread, and Dan very kindly provided the expression that I was after and this has worked fine, however I’m having a little trouble with it again.
So the set up that I’m working with is that I create an automated template and have the client fill this in remotely, via third-party software. Now the expression that Dan provided allows the images to auto-scale to fit, so whatever image the client provides, it will automatically scale and fit into the required composition.
Now this has been working fine for the last 6 months or so, however I have only ever used it with .jpegs. Today I created a template which required .pngs and not .jpegs. When I tested out the expression on my computer, it seemed to work fine and accepted the new .pngs and scaled them and everything, however when working remotely it seems that After Effects is bypassing/ignoring the expression completely and just importing the .png with it’s original size.
The only conclusion that I can come to at this point is that I created the template on cc2020 and the remote server works with CC2019 (first project doing so), however I was under the impression that expressions work across different versions as they are universal pieces of code.
Could there be something else that I’m missing? As I’m really wrecking my brain on this one.
If anyone has ever encountered anything similar and has any advice or feedback I’d really appreciate it.
Thanks,
Malcolm -
Thanks for the feedback Andrei.
At the moment this is something I’m planning to learn so that I could apply it when the right project comes along, so it isn’t really urgent per se and as things stand I’ll try and figure it out. Thanks for the offer though.
I am currently scouring through many posts and feeds on Creative Cow and saving bits and pieces here and there, so I could hopefully come up with a solution.
If I do not figure it out by the time a job on these lines comes along then I’ll get in touch, so thanks for reaching out.
Cheers guys 🙂
-
Hey Tomas,
Thanks for your reply.
So essentially yes, I’m assuming that a custom script/expression would need to be created whereby all of this could be done remotely.
With regard to having AE running on a remote server, we are trying to avoid this as much as possible and simply have the render engine running, mainly due to the logistics involved.
I believe the most probable solution is that the animated shape (font) layers would already be uploaded within the project and an expression could link each text ‘letter’ typed remotely to it’s corresponding animated font. This is basically what scripts such as Font Manager are doing, but I assume that this could also be done via expressions. I’m just not there yet with regard to expression knowledge, so I am still researching and trying to find the right expression combination. Probably something related to if/else statements.
The issue here would then be that kerning, spacing, line adjustment, and anything else related to type design would then have to also be incorporated into the expression (just as they are in scripts such as Font Manager), so I’m assuming that if this is even at all possible via expressions, it would have to be one beast of an expression.
If I haven’t explained myself well enough let me know.
Either way, thanks for the input guys, I hope that I could come to bottom of this some way or other, as I truly believe that it may be possible.
Cheers.
-
Thanks for the reply Andrei.
I’ve actually come across some of your work on Envato before and liked quite a few of them ☺
The reason why I haven’t purchased any of them or anything similar to them is that I thought that you would have to have some kind of script for the text input, but since the text is going to be updated remotely, the after effects render engine on the remote server can’t have any scripts installed on it before hand, which I believe would result in this not working properly.
Not sure if I’ve explained myself well. If not let me know.
Thanks,
-
Malcolm Ricci
December 6, 2019 at 9:26 am in reply to: ‘Infallible Scale Expression’ – Problems with auto scaling images to comp sizeThanks for this.
Apologies for the delay, but it’s working exactly as I need it to now ☺
Malcolm.