Using "bbox D_ZSIZE" as value for a keyframe?

   4790   9   2
User Avatar
Member
411 posts
Joined: June 2015
Offline
I'm trying to rig a keyframe of my camera animation to the D_ZSIZE of a bound node. The purpose behind that is to resize the travel length of my camera according to that bounding box so i don't have to maunally change the camera keyframe each time i update that bouding box it's travelling through. Is it possible please?

My alternative would be to animate the camera along a path and resize that path using the bbox method, but i'd like to know if it's possible to use relative parameters as keyframes.

Cheers,

A.
User Avatar
Member
5 posts
Joined: May 2018
Offline
Are you looking to have one keyframe be controlled by the D_ZSIZE of your bound node but other keyframes that are unrelated to the D_ZSIZE?
User Avatar
Member
411 posts
Joined: June 2015
Offline
Vanderbolt
Are you looking to have one keyframe be controlled by the D_ZSIZE of your bound node but other keyframes that are unrelated to the D_ZSIZE?

Well the first keyframe of that camera animation is a “0” value. The camera (actually a null parent of it) starts from the center of the scene.
I'm creating tunnel loops type of animation for VJ content. I created a dynamic procedural system that generates random variations of tunnels that build up along the camera animation, all that based on few simple parameters (see pics attached). A funky little tech dynamic tunnel generator. And just to make it neater before making an HDA out of it i'd like to rig the end of the camera travel to a relative value that matches the “bbox D_ZSIZE” of a bound node that is part of the system. That bound node obviously wraps up the entire generated tunnel which z_scale/z_length slightly differs from one seed to an other. Not much, but it does change a little bit and i need the cam traveling distance to match that length accurately to make sure it loops perfectly for each new tunnel variations / seed. So since it all starts from “zero” (center of my scene) the BBOX D_ZSIZE would always match the length of my tunnel.
Beside not really wanting to add a geo curve for a path follow camera animation in the system, i've also often wnated to use intrinsics attributes as relative parameters for keyframes but never really found out how to do that.


So far when i keyframe the tz of my camera helper with bbox(“../geo1/bound1”, D_ZSIZE) on the end frame of my animation the keyframe does not interpolate from the 0 value at the start of my animation. It stays at 0 and jumps to the bbox relative value only on the keyed frame.

Cheers,

A.
Edited by Adriano - Oct. 12, 2018 18:24:55

Attachments:
Tunnel5.JPG (363.8 KB)
Tunnel4.JPG (243.1 KB)
Tunnel3.JPG (259.7 KB)
Tunnel2.JPG (428.8 KB)
Tunnel1.JPG (441.6 KB)
Bound.JPG (220.2 KB)

User Avatar
Member
5 posts
Joined: May 2018
Offline
Wow! those look really cool! I'm just popping in on my break so a short answer. I'm not sure if it's possible to interpolate automatically, however if the frame length of each tunnel remains consistent you could set a key on an unrelated channel of 0 at frame 0 and 1 at the final frame and use that to interpolate between 0 and your bbox size with multiplication. Attached file is non-commercial if that makes any difference.

Cheers.

Edit: Be sure to go to the animation editor and pull the animation curve linear for a smooth loop
Edited by Vanderbolt - Oct. 12, 2018 19:51:56

Attachments:
0_to_Bbox.hipnc (100.5 KB)

User Avatar
Member
411 posts
Joined: June 2015
Offline
Vanderbolt
Wow! those look really cool! I'm just popping in on my break so a short answer. I'm not sure if it's possible to interpolate automatically, however if the frame length of each tunnel remains consistent you could set a key on an unrelated channel of 0 at frame 0 and 1 at the final frame and use that to interpolate between 0 and your bbox size with multiplication. Attached file is non-commercial if that makes any difference.

Cheers.

Edit: Be sure to go to the animation editor and pull the animation curve linear for a smooth loop

Thanks for the kind word, still a work in progress, looking forward to render some samples out.

Awesome trick to interpolate that bbox expression, i feel silly i didn't think about it myself. Thank you so much for that one, for sure something i'm going to use and abuse. And yes, my frame range is always the same format for this type of output, 30 seconds loop, 900 frames, so i can work with that.

Cheers,

A.
Edited by Adriano - Oct. 12, 2018 22:28:41
User Avatar
Staff
3464 posts
Joined: July 2005
Offline
check the file
if you alt+LMB on the tz parameter of the camera you will add a key, if you click on the name of the parameter you will switch to the expression mode - so you can see the expression on the parameter - in this case the key's expression will be bezier()
but we don't want that - we want a different expression
so click inside the tz parameter and then do alt+e
this will bring up the expression editor
I then just replaced
bezier()
with
bbox("/obj/tube1", D_ZMAX) + 2
this will get the max value of the bounding box in Z
I added 2 just to keep the camera outside the tube - but you can play with that yourself
inside the tube I animated the height parameter
hit Play and you'll see the effect.

Attachments:
cam_to_D_ZMAX.hip (81.2 KB)

Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
411 posts
Joined: June 2015
Offline
goldfarb
check the file
if you alt+LMB on the tz parameter of the camera you will add a key, if you click on the name of the parameter you will switch to the expression mode - so you can see the expression on the parameter - in this case the key's expression will be bezier()
but we don't want that - we want a different expression
so click inside the tz parameter and then do alt+e
this will bring up the expression editor
I then just replaced
bezier()
with
bbox("/obj/tube1", D_ZMAX) + 2
this will get the max value of the bounding box in Z
I added 2 just to keep the camera outside the tube - but you can play with that yourself
inside the tube I animated the height parameter
hit Play and you'll see the effect.


Thanks a lot, Micheal for helping. I understand you're porposing an alternative “effect”, right? But the point of my post / question was to never have to manually update any keyframes and make it relative to the bboz dimensions of my tunnel. So if a user generates a new tunnel he never has to worry about the camera travelling the required distance to make it loop accurately. Hence why the multiplier option proposed priory works in my context. That tunnel generator will always create chunks of tunnels that are then duplicated in the Z axis. And the dynamic growth of its elements is triggered by an attribute transfer using the segment_lenth of a resample node parented to the camera animation. (With a little offset). So it look like the Tunnel is building up in front of the camera and also disappears right before getting out of frame (or not, user's choice). I clip the camera view as well using the same relative bbox d_size value to make sure it loops in the depth as well.

I can send you the file privately if you want to have a look at it.

Cheers,

A.
User Avatar
Staff
3464 posts
Joined: July 2005
Offline
not really sure what you're after, is the tunnel being dynamically built based on the position of the camera?
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
411 posts
Joined: June 2015
Offline
goldfarb
not really sure what you're after, is the tunnel being dynamically built based on the position of the camera?

Some parts made out of lines and points yes. Those lines are being created from a hidden steady boolean-made structure, but there is the option to render that structure as well along with the dynamically built lines and points (which are used to also light up that architectural structure). Attached is an example of a preliminary more minimalistic set up i built few days ago Where only the lines and points are rendered. And as mentioned before they are revealed by an attribute transfer (resample “segment_length” attribute) with fall off based on the camera position. I then delete all segments that under a certain threshold to clean up the tiny segments populating the scene around my center of focus, as the resample node with tiny segment_length left a bunch of dots everywhere, it wasn't clean.

Cheers,

A.
Edited by Adriano - Oct. 13, 2018 13:34:17

Attachments:
Leds.Tunnel.v06.Color (00828).jpg (768.7 KB)

User Avatar
Member
411 posts
Joined: June 2015
Offline
goldfarb
not really sure what you're after, is the tunnel being dynamically built based on the position of the camera?

here, this is how the lines / points build up and fade out, while the environment structure behind it is steady. I might make it dynamic as well later, but for now it's just there. Now in order to avoid that issue i had to use the bbox D_Zsize i just used two clip nodes and a mirror node to always set that structure z_scale to a fix number (40 units, 2 x 20 fo the original cliped and its z_mirrored version). Not my firtst choice, but that works. Then Vanderbolt proposed his method and my clipping became irrelevant / useless. But id' still wnat to learn how to use intrinsics relative values for keyframes, also relative values for slopes and acceleration of keyframes.

Cheers,

A.
Edited by Adriano - Oct. 13, 2018 14:32:39

Attachments:
Tunnel.Tech.Mix.mp4 (14.2 MB)

  • Quick Links