Source Filmmaker

Source Filmmaker

1,080 ratings
Directional Scale Controls (Stretching)
24
16
11
7
7
5
4
4
3
3
3
3
2
2
2
2
101
   
Award
Favorite
Favorited
Unfavorite
Script
Tags: SFM
File Size
Posted
Updated
17.904 KB
Mar 5, 2023 @ 2:10pm
Mar 7, 2023 @ 4:57pm
4 Change Notes ( view )

Subscribe to download
Directional Scale Controls (Stretching)

Description
This script adds xyz scale controls for selected dag.

Credits:
- Me
- Unknown Soldier aka @0TheSpy

Github: https://github.com/kumfc/sfm-tools/tree/master/directional-scale-controls


Important
- You should run this script from embedded python interpreter!
- Not compatible with Source 2 Filmmaker.
- Works with all models.

Installation
Just subscribe to this item!
Additionally, if you're familiar with Python - invoke Directional Scale Patch's main() from sfm_init.py so it will be executed automatically on startup.

Usage
To create controls, execute Directional Scale Controls from "DAG Utilities Menu" in dag (bone) submenu.

To display the scale changes, you should execute Directional Scale Patch script from Scripts menu (navbar) every time you restart SFM.

Known issues
Problem: Applying this script on multiple ancestor dags may cause FPS drops when posing their childs. E.g. applying it to spine3, spine4 and neck will cause some lags when posing the head. This happens because SFM has retarded expression handling in slider controls. However, it doesn't affect completed animation and happens only when you directly change pos/rot from the interface. Dags without such ancestors or from any other "Animation Set" in the session won't cause the FPS drops. Not really problematic until you want to rescale every bone in the model with poor CPU aboard.

Solution: This script has an unused function create_attr_slider_simple which creates slider without the use of an expression. Just swap function names with original create_attr_slider. This slider type, however, is limited to [0, 1] range and not remapable. To bypass this limit use Facial Flex Unlocker (which unlocks not only flexes but all sliders in general) or Graph Editor mode — not UI-friendly, but lag-free.



Problem: In order to minimize the effect from previous issue, I simplified the expression and by that sacrificed "Remap Slider Range" functionality.

Solution: Actually, with the use of master-scale you can stretch the dag up to 64 times in every direction, but if you want more, or, for some reason, negative values — use Facial Flex Unlocker or simply Graph Editor mode.



Problem: Directions on different bones even of single model are oriented differently. X may be Y or Z can be X in relation to the world.

Solution: Presented X Y Z is actually local bone orientation. That's not a bug.



Problem: Jigglebones (if there's any) of attached models (e.g. hats) will slightly distort after Undo (CTRL+Z) on scale controls.

Solution: Just hide-unhide the distorted model to normalize it.



Problem: Under some conditions RGB position/orientation controls (as well as skeleton) can be stretched and hardly usable. It started to happen after we added support for locked bones and attached cosmetics. Why? Because these 3D-controls are the very same kind of attached objects as hats.

Solution: We're still searching for a way to separate that effect. It seems unreasonable for us to revert the update, so you can change it manually if you want. Just comment these two lines (add # at the beginning):
line 325: mwrite(i_patch_skip_read_parent_override, patch_skip_read) line 371: mwrite(i_patch_rescale_2, patch_rescale_jump_2)

This will prevent the attached/locked elements from rescaling. If you still want them, don't comment these lines, but instead adapt to use Graph Editor mode or "yellow circle" controls.


This is a beta release. If you faced any bugs or issues not listed above - report it to the project's GitHub.

If you faced a crash, provide the screencast recording and essential steps to reproduce. If it affects specific models - write the model name and it's source. Double check that it happens ONLY when patch is applied and not a general SFM issue.

Includes:
sfm\dag\exact\count1\Directional_Scale_Controls.py
sfm\mainmenu\umfc\Directional_Scale_Patch.py
Popular Discussions View All (5)
11
Jul 15, 2025 @ 3:42pm
Beginner's Guide
CommanderCTC
4
Nov 21, 2024 @ 3:51pm
It disappears when you rotate :/
JIIINGJING
2
Nov 24, 2023 @ 2:00pm
Crashes on execution
Sabi.The.Bunny(STB)
318 Comments
Apr 27 @ 12:19pm 
well i did edit the script the one time to change the values so i can have finer control.
the script by default is at a range of like, 0 to 10 with a default of 1. i changed it the one time with your help so the ranges are 0 to 1 with a default of 1, and id use the flex unlocker to go above 1.
idr what i changed exactly, but i guess that change made it bug out in the way ive been talking about because its had this bug since i can remember, since reinstalling obviously reverted that change.
Apr 27 @ 12:11pm 
@TurnTwister

Didn't know it can download workshop content. Either way I doubt reinstalling this script can somehow affect any of it's logic. Might be that you restarted SFM and by that unloaded some other script or plugin that broke the thing. If you'll get that bug in the future, take a look on what else is enabled in that session. If you'll find a conflicting addon, post it here, I'll take a look.
Apr 27 @ 11:44am 
crowbar, its a source engine toolset thing mainly (i think). the main things ive used it for is decompiling and compiling models (.mdl's), but it also has a tool for downloading workshop items as a zip wherever. works so long as you have the game, i use it for easily downloading gmod and sfm workshop content without needing to fiddle around with either of the programs native systems or folder structures
https://steamcommunity.com/groups/CrowbarTool
Apr 27 @ 11:14am 
@TurnTwister

Redownloaded what using what? :curious_mechanic:
Apr 27 @ 10:12am 
interesting, just redownloaded it using crowbar and it fixed it
Apr 27 @ 9:59am 
@TurnTwister

Checked it. Doesn't reproduce for me, works as expected. And nobody reported it before, should've been an issue to somebody. Do you have any other scripts/plugins enabled/installed that may mess with the control channels?
Apr 27 @ 9:51am 
heres a video. its a very annoying bug if you need a lot of something, since you need to open up the model viewer, spawn in a new one, and apply the scale control to any and all bones you want/need
https://streamable.com/s24gqx
Apr 27 @ 8:51am 
@TurnTwister

So it does copy the changed scale and rescale controls but those controls no longer make effect? If so, looks like an SFM bug (maybe it doesn't copy the transform channels)
Apr 26 @ 8:01pm 
idk if you know this bug already or not
when you apply the scale script to a bone, and copy+paste the animation set/model, the scale sliders on the pasted one(s) do not work, and inherit the values of the original one that was copied. The same goes if you copy+paste a copy; it will only inherit the slider values of the very first original.
lmk if you want footage or something, in case i explained it poorly
Apr 24 @ 10:08am 
@christel.schreiber.1

Apply it to the root bone (not rootTransform though).