Bug #9444
scaling root part from a partModule
100%
Description
This is a problem only triggered by using the modding API.
To scale parts in the flight scene, TweakScale does the following from the OnLoad method of its partModule:
part.transform.GetChild(0).localScale = newScale;
part.transform.GetChild(0).hasChanged = true;
part.transform.hasChanged = true;
This works fine when Launching a new vessel. In other situations (load / revert to launch) it only works for non-root parts.
Doing this for the root part on load or 'revert to launch' has two problems:- Changing camera modes is broken afterwards (already reported as issue #3364, which is still happening)
- KSP ignores the written scale. So the part that was scaled an launch seems to revert to the original scale as soon as the scene is reloaded. Since this is technically a different problem, I report it here as a separate issue. See also #5041, which caused the exact same symptoms when using the stock config value "rescaleFactor".
Relevant discussion on Github, searching for a workaround:
https://github.com/pellinor0/TweakScale/issues/3
- install any version of TweakScale older than v2.2.7.1 (for example v2.2.1 for KSP 1.1):
https://github.com/pellinor0/TweakScale/commit/0939f7a4c76013a3a690cf997aacc21bc45fd5be - go to VAB
- take an MK1 pod
- scale to 2.5m
- launch => pod spawns on the launchpad in the correct scale (2.5m)
- revert to launch => pod reverts to 1.25m scale (and the camera is broken as in #3364)
History
#1 Updated by pellinor over 8 years ago
Solved, thanks to NathanKell! It was not a KSP bug but a hardcoded assumption in TweakScale: part.transform.GetChild(0) is not always the "model" tran?form. In the error case it leads to a transform named "main camera pivot", which explains both this issue and #3364.
So both issues can be closed as "not a bug".
#2 Updated by TriggerAu over 8 years ago
- Status changed from New to Needs Clarification
#3 Updated by pellinor over 8 years ago
This bug was traced back to a wrong usage of the API, so it can be closed now.
#4 Updated by pellinor over 8 years ago
- Status changed from Needs Clarification to Resolved
- % Done changed from 0 to 100
This is not a bug, see the above comments.
#5 Updated by TriggerAu about 8 years ago
- Status changed from Resolved to Closed