Project

General

Profile

Bug #9444

scaling root part from a partModule

Added by pellinor about 8 years ago. Updated over 7 years ago.

Status:
Closed
Severity:
Low
Assignee:
-
Category:
Plugins/Add-Ons
Target version:
-
Start date:
04/23/2016
% Done:

100%

Version:
Platform:
Windows
Expansion:
Language:
English (US)
Mod Related:
No
Votes:
Arrow u r green
Arrow d r red

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

Reproduction:

History

#1 Updated by pellinor about 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 almost 8 years ago

  • Status changed from New to Needs Clarification

#3 Updated by pellinor almost 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 7 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 over 7 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF