Jump to: Board index » General » Fusion

Expressions

Learn about 3D compositing, animation, broadcast design and VFX workflows.
  • Author
  • Message
Offline

jsghost777

  • Posts: 82
  • Joined: Tue Apr 09, 2024 7:42 am
  • Real Name: Jake Coetzee

Expressions

PostWed May 15, 2024 12:00 pm

I want to use an expression for rotation but I'm not figuring out what the correct way to do it is.

For example, if I want to use an expression for the center of an ellipse mask, it'll be Ellipse1.Center.X/Y and whatever I want to do. I'm not sure what the expression for rotation is...? I've tried rotation but only get red nodes :lol: ...

I've looked through the manual - Chapter 12, 22, 29 https://documents.blackmagicdesign.com/ ... Manual.pdf but don't really see anything that gives examples of this. I 100% might've missed it but I only saw the sin/cos formulas for rotation which isn't what I'm looking for.

Is there a site or a document where the formulas are listed?
Offline

xunile

  • Posts: 3109
  • Joined: Mon Apr 23, 2018 5:21 am
  • Real Name: Eric Eisenmann

Re: Expressions

PostWed May 15, 2024 3:54 pm

Have you tried Ellipse1.Angle?
Win 10 Home | Intel i7 - 10700f 64 GB 1 TB GB SSD 2 TB SSD
RTX-3060 12 GB | Resolve Studio 18.6.6| Fusion Studio 18.6.6

Win 10 Home | Intel Core I7-7700HQ 32 GB 1 TB NVME SSD 1 TB SATA SSD
GTX-1060-6GB | Resolve 17.4.6
Offline

Sander de Regt

  • Posts: 3851
  • Joined: Thu Nov 13, 2014 10:09 pm

Re: Expressions

PostWed May 15, 2024 6:58 pm

Also, the easiest way to discover this is by either pickwhipping it - the correct name will autofill, or while you're pointing at the thing you want the expression to link to, look at the bottom left of the screen.
The script/expression name of the parameter will be shown there.
Sander de Regt

ShadowMaker SdR
The Netherlands
Offline

jsghost777

  • Posts: 82
  • Joined: Tue Apr 09, 2024 7:42 am
  • Real Name: Jake Coetzee

Re: Expressions

PostThu May 16, 2024 5:08 am

xunile wrote:Have you tried Ellipse1.Angle?


I did try it, but the moment I put X/Y it goes red as well. Maybe I'm just missing something very obvious. Or what I'm trying to do isn't exactly the correct way. I'm going to try the pickwhip technique, I completely forgot about that. Then I'll let you know what I was typing and what it should've been if it even works at all
Offline

jsghost777

  • Posts: 82
  • Joined: Tue Apr 09, 2024 7:42 am
  • Real Name: Jake Coetzee

Re: Expressions

PostThu May 16, 2024 5:09 am

Sander de Regt wrote:Also, the easiest way to discover this is by either pickwhipping it - the correct name will autofill, or while you're pointing at the thing you want the expression to link to, look at the bottom left of the screen.
The script/expression name of the parameter will be shown there.


:shock: I completely forgot about this. And I do it so often :? ... Thanks! I'll try it now
Offline

jsghost777

  • Posts: 82
  • Joined: Tue Apr 09, 2024 7:42 am
  • Real Name: Jake Coetzee

Re: Expressions

PostThu May 16, 2024 5:13 am

So I was typing: Transform3D1_1.Angle.X, Transform3D1_1.Angle.Y ... I got this from a previous thing I did where I used Ellipse1.Center.X, Ellipse1.Center.Y (this one worked).

What I actually should've been using as expression is: Transform3D1_1.Transform3DOp.Rotate.X, Transform3D1_1.Transform3DOp.Rotate.Y - I would never have gotten this on my own.

Thanks Sander for reminding me to use pickwhipping!

Side note: I'm assuming that the Op.Rotate means "operation", "rotation"? If that's the case it actually makes sense.
Offline

jsghost777

  • Posts: 82
  • Joined: Tue Apr 09, 2024 7:42 am
  • Real Name: Jake Coetzee

Re: Expressions

PostThu May 16, 2024 5:34 am

This is a little on a different topic but on the same file I'm working on. So, I've got an animated polyline. Now, when I publish this polyline to reuse it with an other node, why does the scaling and positioning change? Is there a way to avoid it?

So, the yellow line is the reused polyline, just for an example, and the polyline you see is the original. I don't get why they change position/size/whatever else. I don't necessarily want to use it with another polyline, but the moment I publish and connect to it, the scaling and everything is wrong. I usually sit for a while with a transform node and fiddle until I get it to match as best as I can, but there has to be a better way?
Attachments
Screenshot 2024-05-16 at 07.31.49.png
Screenshot 2024-05-16 at 07.31.49.png (639.13 KiB) Viewed 1265 times
Offline

Sander de Regt

  • Posts: 3851
  • Joined: Thu Nov 13, 2014 10:09 pm

Re: Expressions

PostThu May 16, 2024 6:46 am

This usually happens if the resolutions of the two items aren't the same.
Say you have a 4K background, but the line is drawn on a 2K background. Merging them as is will make them look different. If you want to reuse stuff you have to make sure it all is working at the same rez.
Sander de Regt

ShadowMaker SdR
The Netherlands
Offline

jsghost777

  • Posts: 82
  • Joined: Tue Apr 09, 2024 7:42 am
  • Real Name: Jake Coetzee

Re: Expressions

PostThu May 16, 2024 7:17 am

Sander de Regt wrote:This usually happens if the resolutions of the two items aren't the same.
Say you have a 4K background, but the line is drawn on a 2K background. Merging them as is will make them look different. If you want to reuse stuff you have to make sure it all is working at the same rez.


Ah, ok, I'll take a look at my resolution. Just merge with background nodes if they're not the same to get the same resolution all around.
Offline

jsghost777

  • Posts: 82
  • Joined: Tue Apr 09, 2024 7:42 am
  • Real Name: Jake Coetzee

Re: Expressions

PostThu May 16, 2024 8:01 am

Sander de Regt:


Man, I'm struggling with something here.

Ok, so I've got the polyline published. Then I use a transform node, modified to path, then in modifiers I went to "right click for shape animation" and connected to the polyline. So, now I've got an image following the path.

My issue is, the scene is in 3D, so there's rotation and so on. I then connected the standard transform to an image plane and then to a 3D transform in order to get rotation settings. I've got the image to rotate along with the camera, but I can't get it to stay on the polyline. I thought using the same rotation expressions as before would help, but they don't as the image needs to be rotated on the X axis by -45 in order for it to show up the way I want, and then using the expressions causes different movent patterns especially when I connect a second 3D Transform.

Any ideas how to do this?
Attachments
Screenshot 2024-05-16 at 09.58.54.png
Screenshot 2024-05-16 at 09.58.54.png (690.01 KiB) Viewed 1177 times
Offline

Sander de Regt

  • Posts: 3851
  • Joined: Thu Nov 13, 2014 10:09 pm

Re: Expressions

PostThu May 16, 2024 8:09 am

Ah, I didn't know it was in 3D.

So what does the original polyline do?
Sander de Regt

ShadowMaker SdR
The Netherlands
Offline

jsghost777

  • Posts: 82
  • Joined: Tue Apr 09, 2024 7:42 am
  • Real Name: Jake Coetzee

Re: Expressions

PostThu May 16, 2024 8:18 am

Sander de Regt wrote:Ah, I didn't know it was in 3D.

So what does the original polyline do?


Yip, I forgot to mention it's in 3D. I forget that 3D needs a lot of workarounds compared to 2D.

It's just the yellow path you see there. So it's basically tracking a supposed travel path that is animated via path length to draw itself out. So I want to add the image/logo at the front end of the path so it looks like the image is moving with it.
Offline

Sander de Regt

  • Posts: 3851
  • Joined: Thu Nov 13, 2014 10:09 pm

Re: Expressions

PostThu May 16, 2024 8:24 am

Well, how did you get the yellow path in the 3D world? Did you just put it on an imageplane?
Sander de Regt

ShadowMaker SdR
The Netherlands
Offline

jsghost777

  • Posts: 82
  • Joined: Tue Apr 09, 2024 7:42 am
  • Real Name: Jake Coetzee

Re: Expressions

PostThu May 16, 2024 8:34 am

Sander de Regt wrote:Well, how did you get the yellow path in the 3D world? Did you just put it on an imageplane?


Yes. So I used a background to give it color, then used border width to give it shape and then into an imageplane. That's why I decided to insert the image via imageplane as well, seemed like the best way to go.

I'll attach the node tree so you can see.

The Merge3D2 is where I inserted the image that I want to be at the leading end of the path, not sure if it's in the correct spot.
Attachments
Screenshot 2024-05-16 at 10.33.36.png
Screenshot 2024-05-16 at 10.33.36.png (222.59 KiB) Viewed 1167 times
Offline

Sander de Regt

  • Posts: 3851
  • Joined: Thu Nov 13, 2014 10:09 pm

Re: Expressions

PostThu May 16, 2024 8:36 am

Well, if you merge the image/logo over the image before feeding it into the imageplane, then your problem would be solved wouldn't it?
Sander de Regt

ShadowMaker SdR
The Netherlands
Offline

jsghost777

  • Posts: 82
  • Joined: Tue Apr 09, 2024 7:42 am
  • Real Name: Jake Coetzee

Re: Expressions

PostThu May 16, 2024 8:43 am

Also, is it possible to get a depth/height map from a really really flat image? I'll attach the image so you can see what I mean. I wanted to use the attached image, it's why KrunoSmithy gave me these tutorials to follow in the first place (this was the map I was trying to fold), but I can't get a height map from it. I tried some online places and I also tried a photoshop tutorial and some others, but it seems to me this image is simply too flat. And it's the best one I can get for this map unless I can somehow redesign it myself, and I have no clue how to do that
Attachments
MapSCSH.jpg
MapSCSH.jpg (1019.81 KiB) Viewed 1164 times
Offline

jsghost777

  • Posts: 82
  • Joined: Tue Apr 09, 2024 7:42 am
  • Real Name: Jake Coetzee

Re: Expressions

PostThu May 16, 2024 8:53 am

Sander de Regt wrote:Well, if you merge the image/logo over the image before feeding it into the imageplane, then your problem would be solved wouldn't it?


Yes, and no. Yes, it follows more accurately, but I don't have any control over its rotation (that I know of) since I lose the Transform3D.

I tried going through another Renderer into the merge but that gives me the same problem as before, an offset I can't get rid of.

Damn, I thought I had it by changing the angle and pivot in the standard transform node, but that also gives the offset and causes it to go in a completely different direction. I wonder if I should try using the paint node instead of the polygon.
Offline

jsghost777

  • Posts: 82
  • Joined: Tue Apr 09, 2024 7:42 am
  • Real Name: Jake Coetzee

Re: Expressions

PostThu May 16, 2024 9:45 am

Ok, I think I got it. Not exactly the way I wanted, but it's close enough. And it at least rotates to face the camera which is great. Only thing I wanted more was to have it upright (so kinda like it's standing on its chin instead of lying down flat). Right now it seems to move like a ghost over the surface :lol: But I'll fiddle some more, there has to be a way. Oh, and I did it your way - merging it before the image plane.

Edit:

Ok, so I ran it through another image plane into a Renderer and merged it and now it works, no offset. Now all I have left is to figure out which exact settings give me the best rotation and then also why it gets masked when I rotate it a certain way or lift it a certain amount (gets cut off like I put a mask on it even though I didn't)
Attachments
Screenshot 2024-05-16 at 11.47.43.png
Screenshot 2024-05-16 at 11.47.43.png (354.58 KiB) Viewed 1115 times
Offline

Sander de Regt

  • Posts: 3851
  • Joined: Thu Nov 13, 2014 10:09 pm

Re: Expressions

PostFri May 17, 2024 6:43 am

It sounds like you're learning a lot doing this project. Good for you!
Sander de Regt

ShadowMaker SdR
The Netherlands

Return to Fusion

Who is online

Users browsing this forum: No registered users and 26 guests