Callbacks that stick to specific nodes

Callbacks that stick to specific nodes

TurboChiken
Contributor Contributor
773 Views
6 Replies
Message 1 of 7

Callbacks that stick to specific nodes

TurboChiken
Contributor
Contributor

I've made a customized camera rig, consisting of a camera and a target node. Just like Max's native target camera, I want to make it so if the user deletes one of the nodes, the other one gets deleted. Or if one is renamed, the other one is renamed to matched.

 

Therefor I need to find a way to attach callbacks that stay permanently with the nodes, and not necessarily the scene itself (for instance if the camera rig gets merged into another scene, the callback needs to go with it). Any ideas?

0 Likes
774 Views
6 Replies
Replies (6)
Message 2 of 7

klvnk
Collaborator
Collaborator

if you use the "old" "built in" look at controller you can get the delete linkage for free (as with target cameras and lights)  

 

so to make p2 look at p1 use.....

 

 

$Point01.lookat = $Point02

 

 

seems backwards but hey ho 🙂 if you now delete one it will delete the other and visa versa.

 

 

0 Likes
Message 3 of 7

TurboChiken
Contributor
Contributor

I didn't realize it came with that correlated delete feature, thanks for the tip! Unfortunately since you can't set the upnode on that lookat controller, the gimbal lock as the camera points up or down is a deal breaker for me. Plus, I'd still like a way to have names update automatically.

0 Likes
Message 4 of 7

klvnk
Collaborator
Collaborator

you can set the target as the upnode.

0 Likes
Message 5 of 7

TurboChiken
Contributor
Contributor

Didn't know that. Now I learned two things today 🙂 That being said, I tried assigning the .lookat property and it didn't assign the controller. I'm using 2021, they've probably finally discontinued it.

0 Likes
Message 6 of 7

klvnk
Collaborator
Collaborator

check with a targeted light or camera. (looking in the sdk seems like not a lot has changed)

 

 

$Point001.lookat = $camera001
$camera01.transform.controller.UseTargetAsUpNode = true

works in 2020

 

 

0 Likes
Message 7 of 7

TurboChiken
Contributor
Contributor

Ah, there it is. How did I never notice that before? Well, for my camera rig in question, I still need to avoid a Max target camera solution, so my original question about callbacks still stands. But at least now when I do use targeted cameras I know how to void the gimbal lock. Thanks.

0 Likes