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

Make this expression work with 3d layers

Contributor ,
Mar 11, 2021 Mar 11, 2021

Based on this tutorial.

Gradient Controller - After Effects Tutorial - YouTube

 

Is it possible to make this expression work with 3D layers? I need to zoom into one circle with the camera, but continuous rasterization won't work as I can't make the layer 3d. I am no expert at expressions but I was wondering if the 'X' could be modified. The expression error is asking for 2 numbers where the x is. Maybe x,y but I am not sure? 

 

x = thisComp.layer("Gradient").sampleImage(transform.position, [.5,.5]/2, true, time)[0];
100*[x,x]

 

Thank you 

Best regards

Julian

TOPICS
Expressions
932
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
LEGEND ,
Mar 11, 2021 Mar 11, 2021

sampleImage() is a 2D function, so I'm not clear what you actually want. In the tutorial it merely defines an imaginary area for the dots to sample the underlying map. They simply chose to simplyfy it by making the sampel area square, so they only have to define the X value. There would technically be no difference if the dots were 3D layers. This doesn't solve your zoom issue at all therefore, but I really have no idea what you actually need for your project. You need to offer a better explanation or perhaps even a screenshot to clarify.

 

Mylenium

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 ,
Mar 11, 2021 Mar 11, 2021

If you want to use a 3D layer's position to sample another 3D layer's color values you have to use the layer space transformations. I don't have time to dig into it right now but it gets complicated because sampleImage(point, radius) works on the Layer Space of the layer. Using toComp() or toWorld() on the sample point, which is usually a Null layer will give you X and Y coordinates based on the comp but trying to convert comp or world space to layer space will probably get pretty tricky. 

 

If you are trying to control the scale of a layer based on the camera position you don't need sampleImage(), you would use length.

 

We need a lot better description of what you are trying to do and a screenshot embedded using the toolbar. the screenshot needs to show at least 2 views so we can see where the layers are in 3D space and the description needs to explain what you want to happen when the camera moves.

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 ,
Mar 14, 2021 Mar 14, 2021
LATEST

Sorry for the late reply, as the forum notification went into the spam folder.

Thanks for the reply from you both. I always suppected a this wouldn't work on a 3d layer and why should it. 

 

I have found a work around, and moved on.

Using this techneque to control a dot effect which forms a logo. The final logo hold as a dot design in it with a text strapline. 

I wanted to zoom into the logos dots, which was made in illustrator and use the 3d camera to zoom in on one dot and place a presenter in it. But because of the 'collape tranformation issue' when 'continuous rasterization'  is activated it is not possible to do this.  The tranformations wont work on a precomposed layer. And the layer vector will not look good.

 

It is a bit complex to explain but I found that I could just but the presenters in a circle over the top and zoom in.  I could of just used a 2D transform on a precomp, but that is more of a clucky way of zooming in. 

 

I love the effect and it looks very organic, I could of probably done the same thing with Trapcode form but I managed without it. It is a bit of a slow effect but looks good.

 

 

 

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