Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Public Attributes | Properties | List of all members
PartVariant Class Reference

Part variants hold information on how a part looks. It will only allow visual changes, so it will hold information regarding materials or models. A part is allowed to have mutiple variants if needed, the user can toggle this variants in the VAB/SPH when building a vessel. Or in the part selector with a small button in the corner. This class needs to be serialized so it can be copy its properties correctly to part instances. More...

Inheritance diagram for PartVariant:
IConfigNode

Public Member Functions

Transform FindChild (Transform parent, string childName)
 
string GetExtraInfoValue (string name)
 
void Load (ConfigNode node)
 Load will read a Variant node in the PartVariants module. You can set the values of the base variant in the root node, and then define each variant seperately. More...
 
 PartVariant (string name, string displayName, List< AttachNode > attachNodes)
 Empty constructor, all the other parameters have to be set manually. More...
 
 PartVariant (string name, string displayName, List< AttachNode > attachNodes, AttachNode srfAttachNode)
 Empty constructor, all the o ther parameters have to be set manually. More...
 
 PartVariant (PartVariant baseVariant)
 A constructor that will copy the properties of other variant, that way when its loaded the base stays the same. More...
 
void Save (ConfigNode node)
 No need to save anything about variants, they wont persist. More...
 
bool TryCopyMaterial (Material baseMaterial)
 Will try to add a copy a material as a variant property, if it already exists it will be skipped. More...
 
void UpdateMaterialFromExtraInfo (Material material)
 Updates the current materials with the custom information of a texture node. You can specify a shader, its properties and what material is the target. More...
 
void UpdateModel (Transform partRoot)
 

Public Attributes

string themeName
 

Properties

List< AttachNodeAttachNodes [get]
 Stack Attach Nodes More...
 
AttachRules AttachRules [get, set]
 Attach Rules More...
 
float Cost [get, set]
 The additional cost of this variant. This value is ADDED to the base item's cost. More...
 
List< string > DisabledAnimations [get, set]
 Which ModuleAnimateGeneric modules should be disabled when this variant is active. ModuleAnimateGeneric modules are identified by their animationName. More...
 
List< string > DisabledEvents [get, set]
 Which Event modules should be disabled when this variant is active. Event modules are identified by their name. More...
 
string DisplayName [get, set]
 The name displayed in the UI More...
 
List< PartGameObjectInfoInfoGameObjects [get]
 The url of this variant .mu file (empty if not needed) More...
 
float Mass [get, set]
 The additional mass of this variant. This value is ADDED to the base item's mass. More...
 
List< Material > Materials [get]
 The templetes materials for this part variant. Generated from the Texture node. More...
 
string Name [get, set]
 The name of this variant More...
 
string PrimaryColor [get, set]
 The primary color of the PAW button. More...
 
string SecondaryColor [get, set]
 The secondary color of the PAW button. More...
 
string SizeGroup [get, set]
 The sizegroup of this variant, they are used to filter out other variants that dont match in dimensions and there are things surface attached More...
 
AttachNode SrfAttachNode [get]
 Surface AttachNode More...
 

Detailed Description

Part variants hold information on how a part looks. It will only allow visual changes, so it will hold information regarding materials or models. A part is allowed to have mutiple variants if needed, the user can toggle this variants in the VAB/SPH when building a vessel. Or in the part selector with a small button in the corner. This class needs to be serialized so it can be copy its properties correctly to part instances.

Constructor & Destructor Documentation

PartVariant.PartVariant ( string  name,
string  displayName,
List< AttachNode attachNodes 
)
inline

Empty constructor, all the other parameters have to be set manually.

PartVariant.PartVariant ( string  name,
string  displayName,
List< AttachNode attachNodes,
AttachNode  srfAttachNode 
)
inline

Empty constructor, all the o ther parameters have to be set manually.

PartVariant.PartVariant ( PartVariant  baseVariant)
inline

A constructor that will copy the properties of other variant, that way when its loaded the base stays the same.

Parameters
baseVariantThe variant used as reference to copy the information from.

Member Function Documentation

Transform PartVariant.FindChild ( Transform  parent,
string  childName 
)
inline
string PartVariant.GetExtraInfoValue ( string  name)
inline
void PartVariant.Load ( ConfigNode  node)
inline

Load will read a Variant node in the PartVariants module. You can set the values of the base variant in the root node, and then define each variant seperately.

Parameters
node

Implements IConfigNode.

void PartVariant.Save ( ConfigNode  node)
inline

No need to save anything about variants, they wont persist.

Parameters
node

Implements IConfigNode.

bool PartVariant.TryCopyMaterial ( Material  baseMaterial)
inline

Will try to add a copy a material as a variant property, if it already exists it will be skipped.

Parameters
materialThe material that will be tried to be copied.
void PartVariant.UpdateMaterialFromExtraInfo ( Material  material)
inline

Updates the current materials with the custom information of a texture node. You can specify a shader, its properties and what material is the target.

Parameters
partMaterialThe part material that holds the custom information on what to update.
void PartVariant.UpdateModel ( Transform  partRoot)
inline

Member Data Documentation

string PartVariant.themeName

Property Documentation

List<AttachNode> PartVariant.AttachNodes
get

Stack Attach Nodes

AttachRules PartVariant.AttachRules
getset

Attach Rules

float PartVariant.Cost
getset

The additional cost of this variant. This value is ADDED to the base item's cost.

List<string> PartVariant.DisabledAnimations
getset

Which ModuleAnimateGeneric modules should be disabled when this variant is active. ModuleAnimateGeneric modules are identified by their animationName.

List<string> PartVariant.DisabledEvents
getset

Which Event modules should be disabled when this variant is active. Event modules are identified by their name.

string PartVariant.DisplayName
getset

The name displayed in the UI

List<PartGameObjectInfo> PartVariant.InfoGameObjects
get

The url of this variant .mu file (empty if not needed)

float PartVariant.Mass
getset

The additional mass of this variant. This value is ADDED to the base item's mass.

List<Material> PartVariant.Materials
get

The templetes materials for this part variant. Generated from the Texture node.

string PartVariant.Name
getset

The name of this variant

string PartVariant.PrimaryColor
getset

The primary color of the PAW button.

string PartVariant.SecondaryColor
getset

The secondary color of the PAW button.

string PartVariant.SizeGroup
getset

The sizegroup of this variant, they are used to filter out other variants that dont match in dimensions and there are things surface attached

AttachNode PartVariant.SrfAttachNode
get

Surface AttachNode


The documentation for this class was generated from the following file: