Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to Reflect a Layer?

Contributor ,
Feb 23, 2020 Feb 23, 2020

I have pair of cartoon characters in a live action fish tank.

Screen Shot 2020-02-23 at 11.24.34 PM.png

I have added a copy of the character layer to look like it is reflected in the glass. (Along with a couple of added effects to look more like a reflection.)

Screen Shot 2020-02-23 at 11.25.14 PM.png

How can I get the reflection character to move in the identical opposite way of the original layer? I know I can't simply parent the reflection to the original layer, because the reflection will always go the wrong way.

 

Do I have to do this manually?

TOPICS
How to
3.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 24, 2020 Feb 24, 2020

I didn't say it was a C4D file, I said if you make the layers 3D then you can use the C4D rendering option to create a reflection as I did in the screenshot.

 

If you want to keep your layers 2D then set the scale of the copy to -100, 100 and edit the expression by removing the reference to Z like this:

 

src=thisComp.layer("Shape Layer Fish").position;
cx = src [0] - thisComp.width/2;
x =  value[0] - cx;
y = value [1];

[x * 2, y]

 

The reason you are getting the error in the expression is that

...
Translate
Community Expert ,
Feb 24, 2020 Feb 24, 2020

I am assuming these are 3D layers. If they are then you can set up reflections if you can deal with the sluggish performance of the C4D render engine by setting up a comp like this:

Screenshot_2020-02-24 04.20.05_Ng2VRf.png

I have shown you all of the properties you have to modify. Make sure you understand the limitations of using the C4D rendering engine. You'll have to figure out how to deal with any effects and blend modes you need to sell the effect.

 

Another option would be to use Standard 3D and set up parenting and add this expression to the reflection layer copy.

 

 

 

 

src=thisComp.layer("Shape Layer Fish").position;
cx = src [0] - thisComp.width/2;
x =  value[0] - cx;
y = value [1];
z = value[2];
[x * 2, y, z]

 

 

 

 

This is what that would look like. You adjust where the reflection meets the master by manipulating the x value of the anchor point on the reflection layer. Blend modes and distortion effects will help you sell the reflection. That setup would look like this:

Screenshot_2020-02-24 05.19.00_8tNMZV.png

If your layers are 2D just delete the Z references from the expression to remove the error and scale the reflection layer by -100% in X.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 24, 2020 Feb 24, 2020

Thank you for your reply. This was not in C4D, and it wasn't a 3D layer, but I changed it from 2D to 3D to use the expression you gave me.

 

Do you know why it would give me the error that says "src is not defined"? The layer with the reflection is layer 3, and the source is "body" on layer 4.

Screen Shot 2020-02-24 at 8.53.50 AM.png

 

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 24, 2020 Feb 24, 2020

I didn't say it was a C4D file, I said if you make the layers 3D then you can use the C4D rendering option to create a reflection as I did in the screenshot.

 

If you want to keep your layers 2D then set the scale of the copy to -100, 100 and edit the expression by removing the reference to Z like this:

 

src=thisComp.layer("Shape Layer Fish").position;
cx = src [0] - thisComp.width/2;
x =  value[0] - cx;
y = value [1];

[x * 2, y]

 

The reason you are getting the error in the expression is that there is a typo. Src should not be capitalized. 

 

The Anchor Point on your body layer should be right on the nose of the fish.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 24, 2020 Feb 24, 2020

Great! That works for the position; will that expression work for the rotation, too, if I change the word "position" to "rotation" or is that a different animal?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 24, 2020 Feb 24, 2020

Rotation, when parented, gets awfully complicated because of the axis of rotation between the parent and child is on the parent layer's Anchor Point. If you want to animate the rotation you'll have to add the transform effect to both layers then tie the rotation of one to the other by adding a minus sign. That's by far the easiest solution:

Screenshot_2020-02-24 09.15.14_YZKjQZ.png

- thisComp.layer("body").effect("Transform")("Rotation")

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 24, 2020 Feb 24, 2020

Is there something prohibiting you from creating the animation of the (non-reflected) characters, then move that entire animation into a precomp?

Use one precomp as the main fish, and the second (scaled -100% on x) as the reflection?

I think it'd be easier to control multiple components of animation in that reflection. (plus easy use of effects/trackmattes)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 24, 2020 Feb 24, 2020

Hi, thank you for asking. I am animating the fish movements in the context of the scene that he is in, so it will be better for me to animation him there, and use Rick's expression for the position of the fish reflection. For the rotations, I will just copy the rotation keyframes for the original, paste them into the reflection layer, and add a minus sign in front of all of them!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 24, 2020 Feb 24, 2020

If you animate the fish with the background layer set as a Guide Layer, that entire composition can be used as your precomp, without the need to address each layer individually.

Just dump it into a new comp. duplicate it. flip the duplicate. add your background.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 24, 2020 Feb 24, 2020

Just get the free Videocopilot Reflect plugin.
No need to muck around with expression, and WAY more options ...

http://www.videocopilot.net/presets/reflection_plug-in/

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 24, 2020 Feb 24, 2020
LATEST

VFXbear, Completely forgot about that free plug-in from Video Copilot. It's a very easy option. It would be even better if you could set the blend modes for only the reflection without duplicating the layer and setting the copy to reflection only.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines