FOV Animation

User avatar
Emmanuel
Chief Warrant Officer
Posts: 651
Joined: 14 Jun 2009, 06:47

FOV Animation

Post by Emmanuel »

VRay has a great Field of View option.
I wonder if this could be animated, to aim focus at a different distance just the way we can do with a real camera.

Any idea ?
User avatar
trueBlue
Captain
Posts: 5214
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: FOV Animation

Post by trueBlue »

Short answer, No, you can not use scripts when Rendering
But it is possible and I am in the process of creating a script for Vray Depth of Field
But it is complicated and currently only possible in tS7.61B8 with Clinton Reese's D3D Render scripts
There is no D3D Render scripts for tS76

I do not think Vray's Depth of Field uses a Camera, it is for rendering the View (Eye Camera)

Edit: I was able to animate the Vray DOF using a script, but found out the D3D Render scripts does not work with Vray
Screenshot.png
User avatar
trueBlue
Captain
Posts: 5214
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: FOV Animation

Post by trueBlue »

New development!
As you may know the Vray node is hidden in the Workspace scene
I created an OnComputeOutputs script with a DOFFocalDist number Output
Vray DOF Script.png
Vray DOF Script.png (15.14 KiB) Viewed 6072 times
I created another jScript that connects the above connection to the Vray node
I Recorded a couple of Distance Keyframes 0 - 60 Frames
Then rendered the Vray animation
Vray DOF animation.png
untitled0029.png
Edit: I can not believe this works but it does!
VRay DOF.png
tS76 VRay Depth of Field

Used to Keyframe - Vray DOF in Workspace

Select - Opens the Keying panel
Connect - Connects VRay DOF to Vray
Disconnect - Disconnects VRay DOF
User avatar
clintonman
Captain
Posts: 5429
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: FOV Animation

Post by clintonman »

Wow! Nice work. Are you going to add other vray attributes for animation?
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5214
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: FOV Animation

Post by trueBlue »

clintonman wrote: 10 Nov 2021, 15:12 Wow! Nice work. Are you going to add other vray attributes for animation?
Maybe, question is what attributes?

I can NOT believe this even works!
As you know with 3D objects that are keyframed there is a visible AnimClip inside the object
This VRay DOF is a jScript object/script and does not have an inside container
As shown the Vray and AnimClip nodes are hidden, they are not visible in the Link Editor
OnComputeOutputs.png
Is it possible to pass a sequence of different strings in a jScript object String attribute/connector, like the Sequence Player does with bitmaps?
User avatar
clintonman
Captain
Posts: 5429
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: FOV Animation

Post by clintonman »

Maybe, question is what attributes?
Maybe the environment color and intensity and I think vray has it's own background color.

Is it possible to pass a sequence of different strings in a jScript object String attribute/connector, like the Sequence Player does with bitmaps?
I don't know. What would you use it for?
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5214
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: FOV Animation

Post by trueBlue »

clintonman wrote: 10 Nov 2021, 16:28 Maybe, question is what attributes?
Maybe the environment color and intensity and I think vray has it's own background color.

Is it possible to pass a sequence of different strings in a jScript object String attribute/connector, like the Sequence Player does with bitmaps?
I don't know. What would you use it for?
The Vray node does not have a Background Color
Workspace uses a PhotoRender node
Ha, so I will answer my own question along with your question...
It is possible!
PhotoRender.png
Animated Backgrounds and or Color :bananathumb:
VRay Background panel.png
VRay Background panel.png (5.04 KiB) Viewed 6034 times
.
https://united3dartists.com/forum/viewt ... 537#p61537

Rendered a sequence with VRay DOF and VRay Background Color as a Vray Background Image
VRay Background.png
User avatar
trueBlue
Captain
Posts: 5214
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: FOV Animation

Post by trueBlue »

@Emmanuel
Here is the tS76 VRay DOF
Works in tS761 & Rosetta too

Please test and let me know how it works for you

Tip
It is not necessary to Keyframe the DOF On Off checkbox if you want DOF for your entire animation, just enable it on the VRay DOF panel

If you want to Keyframe the DOF at a certain point in time where is is not enabled, here is an example:

Go to the frame in your animation where you would like to enable DOF, Uncheck DOF and set a Keyframe from the Keying panel
Go to the next frame, Check DOF and set a Keyframe
Go to the frame where you want DOF disabled, Uncheck DOF and set a Keyframe
Warning! Do NOT add the DOF On Off to the Keying template
Add to keying template.png
Add to keying template.png (16.16 KiB) Viewed 6006 times
This included VRay DOF.RsObj does not have any keyframes applied to it, so do not overwrite your original copy
You can save the keyframed VRay DOF.RsObj with your RsScn scene, just press the Connect button after loading the saved scene for further editing

https://united3dartists.com/forum/viewt ... 536#p61536
User avatar
Emmanuel
Chief Warrant Officer
Posts: 651
Joined: 14 Jun 2009, 06:47

Re: FOV Animation

Post by Emmanuel »

It doesn't work for me.
Perhaps, I am doing wrong.

Here is my step by step :
- I load a Workspace scene (no Modeler window opened)
- I drag the VRay DOF in a LE window and clic its SELECT button > the panel shows up in the stack panel below VRay options and the Keying panel opens.I can see in that panel the new DOF_On_Off keying possibility.
- I clic the CONNECT button > a message is telling me that VRay DOF now has control of the Vray Depth of Field.
- In the Keying panel, I clic to add a DOF_On_Off keyframe. A new keyframe is created in the Anim View at Frame 0.
- In the Anim view, I drag the timeline cursor to frame 30, then in the VRay DOF panel, change the Distance value, and next add a keyframe in the Keying panel. A keyframe is created at Frame 30.

As I drag the timeline cursor, the distance doesn't update in the VRay DOF panel.
As I try different renders at different frames, it renders the last Distance value only.

What I am missing ?
User avatar
trueBlue
Captain
Posts: 5214
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: FOV Animation

Post by trueBlue »

Emmanuel wrote: 11 Nov 2021, 16:03 It doesn't work for me.
Perhaps, I am doing wrong.

Here is my step by step :
- I load a Workspace scene (no Modeler window opened)
- I drag the VRay DOF in a LE window and clic its SELECT button > the panel shows up in the stack panel below VRay options and the Keying panel opens.I can see in that panel the new DOF_On_Off keying possibility.
- I clic the CONNECT button > a message is telling me that VRay DOF now has control of the Vray Depth of Field.
- In the Keying panel, I clic to add a DOF_On_Off keyframe. A new keyframe is created in the Anim View at Frame 0.
- In the Anim view, I drag the timeline cursor to frame 30, then in the VRay DOF panel, change the Distance value, and next add a keyframe in the Keying panel. A keyframe is created at Frame 30.

As I drag the timeline cursor, the distance doesn't update in the VRay DOF panel.
As I try different renders at different frames, it renders the last Distance value only.

What I am missing ?
First step - press the Connect button
Second step - press the Select button
Tip: Ctrl + Drag the VRay DOF panel from the Stack into the 3D View

Add the Distance to the Keying panel
It should look like this with a Red dot:
Distance.png
Distance.png (3.79 KiB) Viewed 5995 times
Go to Frame 0, set the Distance value, then from the Keying panel, RMB - SetKeyframe
Go to Frame 30, change the Distance value, then from the Keying panel, RMB - SetKeyframe
Make sure the DOF is checked on the VRay DOF panel

Tip: Open a new 3D View, set this 3D View to the same size as your render image size, and change the main 3D View to the Link Editor
Render Animation
Screenshot 2021-11-11 085719.png
Post Reply