Source Filmmaker

Source Filmmaker

932 ratings
Directional Scale Controls (Stretching)
23
11
3
16
4
4
7
7
3
3
5
2
3
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)
10
Dec 5, 2023 @ 11:11pm
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)
294 Comments
LLIoKoJIad  [author] Apr 28 @ 2:30am 
by changing the texture, other way it's mapped to the UV coordinates
is it possible to remove the texture stretch and make it loop?
brunoski | blw.tf Feb 7 @ 7:18am 
idk python but how do i autoexecute it without knowing python?
Oximator Feb 2 @ 3:36am 
это самый лучший скрипт в SFM, который я видел!:dealerrizz:
DangerDude066 Jan 27 @ 9:22am 
LLIoKoJIad  [author] Jan 26 @ 9:46pm 
@DangerDude066

So, without altering the script in any way, I attached an unrigged bone to other model's unrigged bone, then applied the rig to the second model and everything worked just fine. Can you make a proof of concept video where you reproduce your problem from start to end?
DangerDude066 Jan 26 @ 6:10pm 
animating this is gonna suck lol, please get back to me when you do :P
LLIoKoJIad  [author] Jan 26 @ 6:08pm 
@DangerDude066

sad! I will try to find a solution later
DangerDude066 Jan 26 @ 5:58pm 
just tryed that, nope :/
LLIoKoJIad  [author] Jan 26 @ 5:53pm 
@DangerDude066

You may try to do it before applying the rig on a real bone