1

I'm using nexrender package to automate after effects template & data driven video based. in AE program I have 2 images. 1 image with a blending mode (stroke-png.png), the second image gets the effect and mask into. as you can see here

enter image description here enter image description here

when I edit the JSON I want to change the photo dynamically so I change it

{
"src": "https://images.unsplash.com/photo-1501901609772-df0848060b33?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1000&q=809",
"type": "image",
"layerName": "Change this Photo"

}

enter image description here

How can I add image with the blending effect? in the last time it not get the effect I want. in the nexrender package I see there is a way to use jsx scripting or avlayer-frameblending..

when I create new preComp from the layer and change the image as in the json - it still not show me the effect and not good as in the picture above.. enter image description here

 {
    "src": "https://images.unsplash.com/photo-1501901609772-df0848060b33?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1000&q=809",
    "type": "image",
    "layerName": "ImageChange"
  },
Manspof
  • 598
  • 26
  • 81
  • 173

1 Answers1

-1

You could use jsx scripting, but I think an easier method would be to create a new precomp of your image. (Right click the layer and choose Pre-compose...). That way you can leave your blending mode and mask settings on the Comp layer.

You can then replace the image inside your new Composition, no need for jsx!

Jespertheend
  • 1,814
  • 19
  • 27
  • I tried it but it still doesn't work.. I edit my post with your suggestion to let you see what I did. – Manspof Nov 08 '21 at 22:22
  • It seems like you correctly made the precomp. What exactly isn't working? – Jespertheend Nov 08 '21 at 22:33
  • it still show me the image without the effect small as the picture I added above https://i.stack.imgur.com/dKuXZ.png – Manspof Nov 08 '21 at 22:36
  • 1
    By the way, if you click "Toggle Switches / Modes" at the bottom of your layers, you can see when a layer has its mode set to a stencil/silhouette. Depending on how you created the precomp it might have moved the stencil mode inside the precomp. – Jespertheend Nov 08 '21 at 22:38
  • Ah, judging from that screenshot I think the image you have replaced it with is simply too small. Does this also happen when you try to replace it with an image that has the exact same resolution? Or do both images already have the same resolution? – Jespertheend Nov 08 '21 at 22:41
  • I just tested it now.. when the image has the exact same resolution it working good.. but what I'm trying to do is when any image dynamically I add it should fit good event the resolution is small.. is there any way to do it? – Manspof Nov 08 '21 at 22:47
  • Maybe with jsx scripting? – Manspof Nov 08 '21 at 22:50
  • You could use layer expressions for this. Let my try something. – Jespertheend Nov 08 '21 at 22:55
  • If you alt click the watch icon of `scale` on your image layer (not the precomp) you can enter the following expression to resize the image to the comp width: `var size = thisComp.width / thisLayer.width * 100; [size, size]` – Jespertheend Nov 08 '21 at 23:22
  • it change the size of the image and when I export it it not good, as you can see here https://pasteboard.co/G5zOnN7R3wpZ.jpg.. what I think we need to do is to add property:scale as here and make expression as you can see here https://pastebin.com/eMqaVWe0 .. but in my example when the image resolution is high it not working good (it too close - kind of zoom X10) but if the image resolution is low and small photo it works good.. do u have any idea how to handle it? – Manspof Nov 08 '21 at 23:51
  • Your screenshot seems to be working correctly. I think you just need to drag it to the center of the comp. If it is replaced with another image, does it not scale correctly? If you prefer the image to be sized to the height of the comp you can replace the two `width`s of the expression with `height`. – Jespertheend Nov 09 '21 at 13:16
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/239057/discussion-between-manspof-and-jespertheend). – Manspof Nov 09 '21 at 22:52