Source Filmmaker

Source Filmmaker

191 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
Sep 3, 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 (http://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
39 Comments
Nero (ZMK) Dec 29, 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] Sep 13, 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 ^^'
WICKED! Sep 12, 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
Waterplesk Aug 20, 2022 @ 10:26pm 
"it`s requiem, all what you see is real"
Chems Boger Mar 13, 2022 @ 6:08am 
well, i can't get it to work
Zа победу! Mar 1, 2020 @ 1:15pm 
Strange...it's working. Thx for the script!
Maru Feb 14, 2018 @ 10:51pm 
It's broken. Not working at all.
BonBun Films Sep 5, 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 Jul 27, 2017 @ 9:18pm 
Tried using it and it bugged out and now the focal distance is who knows where
Ponyboy Jun 16, 2017 @ 8:50pm 
moving the cmera doesnt refresh anything. i tried it 10 times and the image remains a blurry mess.