srctools.instancing
Implements support for collapsing instances.
-
class
srctools.instancing.
FixupStyle
(value) Bases:
Enum
The kind of fixup style to use.
-
PREFIX
= 0 Entities will be named
inst_name-ent_name
.
-
SUFFIX
= 1 Entities will be named
ent_name-inst_name
.
-
NONE
= 2 Entities will remain named
ent_name
.
-
-
class
srctools.instancing.
Instance
(name: str,)
filename: str,
pos: Vec,
orient: Matrix,
fixup_type: FixupStyle,
outputs: Iterable[Output] = (),
fixup: Iterable[FixupValue] = (), Represents an instance with all the values required to collapse it.
-
class
srctools.instancing.
Manifest
() Additional options set in VMM manifests.
-
class
srctools.instancing.
Param
() Configuration for a specific fixup variable.
-
class
srctools.instancing.
InstanceFile
(vmf: VMF) Represents an instance VMF which has been parsed.
-
proxy_inputs
: Dict[Tuple[str, str], Output] Inputs into the instance. The key is the parts of the instance:name;input string.
-
-
srctools.instancing.
get_inst_locs
(map_filename: Path) FileSystemChain Given a map filename, find sdk_content and produce the lookup locations.
The chained filesystem will first look relative to the map, then in
sdk_content/maps/
if that’s a parent directory.
-
srctools.instancing.
collapse_all
() None Searches for
func_instance
in the map, then collapses them.Parameters: - vmf – The map to analyse.
- fsys – The filesystem is used to find the relevant instances.
- recur_limit – The recursion limit indicates how many instances can be contained in another - if it’s exceeded they’re left in the map.
- fgd – The FGD is used to determine how to handle keyvalues. If not provided, an internal database from HammerAddons is used.
-
srctools.instancing.
collapse_one
(vmf: VMF,) None
inst: Instance,
file: InstanceFile,
fgd: Optional[FGD] = None,
visgroup: Union[bool, VisGroup] = False, Collapse a single instance into the map.
The FGD is the data used to localise keyvalues. If none an internal database will be used. The visgroup parameter controls how visgroups are handled: