Source Filmmaker

Source Filmmaker

202 ratings
[SFM-Script] Useful script to manipulate a camera's focal distance more easily
   
Award
Favorite
Favorited
Unfavorite
Universe: Team Fortress
Script
Tags: SFM
File Size
Posted
11.046 KB
3 Sep, 2014 @ 6:13pm
1 Change Note ( view )

Subscribe to download
[SFM-Script] Useful script to manipulate a camera's focal distance more easily

Description
As requested in this post (https://steamhost.cn/steamcommunity_com/workshop/discussions/-1/540744937411842687/?appid=1840) we finally have a script that links the focal distance to a bone, so that you just have to position the bone onto the model you want to have a nice focus on.

To use it, install it by subscribing (duh), and then you just have to execute the script on a camera through the 'Rig' menu (RMB on a camera in the Animation Set Editor).

Made by Yandros.

Known bug : you may need to move the camera with the work camera (for instance, after executing the script or moving the camera through its viewport) in order for the data to be refreshed. You don't need to confirm the change, though.

The source code is pretty easy to understand ; if you are wondering about learning SFM Python scripting, why don't you give it a try ? ;)
Here, have a look : http://pastebin.com/bZWF6a3a
38 Comments
Nero (ZMK) 29 Dec, 2022 @ 11:47am 
So, all it did was add the bone. No matter what I try, nothing happens. I've followed the instructions and read them several times over, so why isn't it working?
Señor Maracuyá  [author] 13 Sep, 2022 @ 11:55am 
@famix oh that's interesting to hear! It does give a hint towards fixing the script. If we look at the pastebin in the description, on lines 46 and 47 we can see the code that ensures that moving the "bone" does trigger updates to the focal distance.
This means that maybe adding an extra similar lines to connect to the camera's own position could be the desired fix!
It's been a while since I've last touched SFM, so this may be more suitable for somebody other than me ^^'
Famix 12 Sep, 2022 @ 3:32pm 
It won't work properly for a moving camera. It will only keep focus for one frame and the rest bugs out
waterpleskalka 20 Aug, 2022 @ 10:26pm 
"it`s requiem, all what you see is real"
Zа победу! 1 Mar, 2020 @ 1:15pm 
Strange...it's working. Thx for the script!
Chicken Jockey 14 Feb, 2018 @ 10:51pm 
It's broken. Not working at all.
bonbun 5 Sep, 2017 @ 9:18am 
well it messed up and now it won't let me remove the rig. thanks, i just ruined a great shot of my animation
Italian 27 Jul, 2017 @ 9:18pm 
Tried using it and it bugged out and now the focal distance is who knows where
Ponyboy 16 Jun, 2017 @ 8:50pm 
moving the cmera doesnt refresh anything. i tried it 10 times and the image remains a blurry mess.
Soviet Stache 1 Oct, 2016 @ 1:17pm 
YOU ARE A GOD AMONG MEN THANK YOU