Data Objects¶
CAS Part¶
- class CommonCASPart(cas_part_id, body_type=None)¶
Bases:
objectA class that contains information about a CAS Part.
- Parameters:
cas_part_id (int) – The decimal identifier of a CAS Part.
body_type (Union[CommonBodySlot, BodyType, int, None], optional) – The place on a Sims person the CAS Part gets applied to. If not specified, then the Body Type of the CAS Part itself will be used. Default is None.
- property body_type¶
The place on a Sims person the CAS Part gets applied to.
- property cas_part_id¶
The decimal identifier of a CAS Part.
Outfit¶
- class CommonOutfit(outfit_parts)¶
Bases:
CommonSerializableContains information on the CAS Parts that make up an outfit.
- Parameters:
outfit_parts (Dict[Union[CommonBodySlot, BodyType, int], int]) – A mapping of CAS Parts organized by Body Slot.
- apply_to_outfit_io(outfit_io, override_all=False)¶
Apply the outfit parts of this outfit to an outfit io.
- Parameters:
outfit_io (CommonSimOutfitIO) – An instance of an Outfit IO.
override_all (bool, optional) – If True, then all outfit parts on the outfit io will be removed before applying the parts from this outfit. If False, no parts will be removed. Default is True.
- Return type:
None
- apply_to_sim(mod_identity, sim_info, outfit_category_and_index=None, override_all=False)¶
Apply the outfit parts to the outfit of a Sim.
- Parameters:
mod_identity (CommonModIdentity) – The identity of the mod making the change.
sim_info (SimInfo) – An instance of a Sim.
outfit_category_and_index (Union[Tuple[OutfitCategory, int], None], optional) – The Category and Index of the outfit to copy to. Default is the current outfit of the Sim.
override_all (bool, optional) – If True, then all outfit parts on the outfit of th Sim will be removed before applying the parts from this outfit. If False, no parts will be removed. Default is True.
- Return type:
None
- clone()¶
Create a clone of the outfit.
- Returns:
A clone of the outfit.
- Return type:
- classmethod deserialize(data)¶
Deserialize the object from a JSON Serializable form.
- Returns:
The deserialized form of the object or None if it fails to deserialize.
- Return type:
Union[CommonSerializableType, None]
- classmethod from_outfit_io(outfit_io, include_body_slots=None)¶
Create an outfit from an Outfit IO.
- Parameters:
outfit_io (CommonSimOutfitIO) – An instance of an Outfit IO.
include_body_slots (Tuple[Union[CommonBodySlot, BodyType, int]], optional) – A collection of body slots to include. If set to None, all body slots will be included. Default is None.
- Returns:
An Outfit created from the outfit io.
- Return type:
- classmethod from_sim(mod_identity, sim_info, outfit_category_and_index=None, include_body_slots=None)¶
Create an outfit from the outfit of a Sim.
- Parameters:
mod_identity (CommonModIdentity) – The identity of the mod making the change.
sim_info (SimInfo) – An instance of a Sim.
outfit_category_and_index (Union[Tuple[OutfitCategory, int], None], optional) – The Category and Index of the outfit to copy from. Default is the current outfit of the Sim.
include_body_slots (Tuple[Union[CommonBodySlot, BodyType, int]], optional) – A collection of body slots to include. If set to None, all body slots will be included. Default is None.
- Returns:
An Outfit created from the Sim.
- Return type:
- get_all_by_cas_part(cas_part)¶
Retrieve the Body Slots a CAS Part is attached to.
- Parameters:
cas_part (Union[CommonBodySlot, BodyType, int]) – The CAS Part to look for.
- Returns:
A collection of body slots the CAS Part is attached to or an empty collection if the CAS Part is not attached to the outfit.
- Return type:
Tuple[Union[CommonBodySlot, BodyType, int]]
- get_by_body_slot(body_slot)¶
Retrieve the CAS Part ID at a Body Slot.
- Parameters:
body_slot (Union[CommonBodySlot, BodyType, int]) – A body slot.
- Returns:
The decimal identifier of the CAS Part located at the body slot on the outfit or -1 if the body slot is not found.
- Return type:
int
- has_body_slot(body_slot)¶
Determine if the Outfit has a Body Slot.
- Parameters:
body_slot (Union[CommonBodySlot, BodyType, int]) – A body slot.
- Returns:
True, if the outfit has the specified body slot. False, if not.
- Return type:
bool
- has_cas_part(cas_part)¶
Determine if the Outfit has a CAS Part.
- Parameters:
cas_part (int) – The decimal identifier of a CAS Part.
- Returns:
True, if the outfit contains the specified CAS Part. False, if not.
- Return type:
bool
- property outfit_parts¶
A library of Body Slots to CAS Part Ids
- remove_by_body_slot(body_slot)¶
Remove a CAS Part by a Body Slot.
- Parameters:
body_slot (Union[CommonBodySlot, BodyType, int]) – A body slot.
- remove_by_cas_part(cas_part)¶
Remove all Body Slots containing a CAS Part.
- Parameters:
cas_part (int) – The decimal identifier of a CAS Part.
- serialize()¶
Serialize the object into a JSON Serializable form.
- Returns:
A serializable representation of the object.
- Return type:
Union[str, Dict[str, Any]]
- set_outfit_part(body_slot, cas_part)¶
Set the CAS Part id at a Body Slot.
- Parameters:
body_slot (Union[CommonBodySlot, BodyType, int]) – A body slot.
cas_part (int) – The decimal identifier of a CAS Part.
Object Containment Slot¶
- class CommonObjectContainmentSlot(slot_name_hash, slot_types)¶
Bases:
objectA slot used for containing other objects within an object.
Note
A place that other objects can be placed at on an object.
- Parameters:
slot_name_hash (int) – The hashed name of the slot.
slot_types (Tuple[SlotType]) – A collection of slot types within this containment slot.
- property slot_name_hash¶
The hashed name of the slot.
- property slot_types¶
The types of slots.