Source Filmmaker

Source Filmmaker

985 ratings
Directional Scale Controls (Stretching)
24
11
3
16
4
4
7
7
3
3
5
2
3
2
2
2
   
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 (3)
11
Jul 15 @ 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)
306 Comments
yuuri Oct 23 @ 5:33pm 
Does this work with IK rigs? I tried to attach an IK script to a rig that had some parts scaled with this but for some reason the limb just distorts and the IK for it is messed up.
Scientist Vovik Oct 20 @ 10:53am 
Не работает. дизлайк. хyйня. переделывай
6o6PoBa9l cTpy9I JIe4eHue rPu60M  [author] Oct 14 @ 8:38pm 
@Caidenz

I guess it heavilly depends on the model rig weights. You can make a screen recording and link the problematic model, I will check.
Caidenz Oct 13 @ 8:39pm 
Everything is working perfectly! but with most of my models, when the Directional Scale Controls are applied, the eyes/pupils distort when moving them up/down or left/right. is there a solution to this?
Iateurcookies Oct 6 @ 7:02am 
oh nwm i tried to modify the count1 script and not the umfc one.
Iateurcookies Oct 5 @ 1:10pm 
where do i run "mwrite(i_patch_skip_read_parent_override, patch_skip_read)"?
Aether Aug 23 @ 12:19am 
a
KenDoStudios Aug 20 @ 12:52pm 
directional patch is not found! help!
LineX240 Jun 16 @ 4:03am 
thats a feature SFM should have by default, thx mate
OceFist May 30 @ 6:08pm 
Ah nevermind, i just noticed the diccussions up there and all you had to do was select rotation only lol