Disguise Python Reference
This page and it’s sub-pages is intended to provide a reference guide for the Python API used within Designer. Note that Designer is built on Python 2.7, so all python executed must be compatible with Python 2.7.
A .pyi stub file for the d3 module is provided here. Download and include this in your python project to provide type hints, autocomplete and code analysis for the d3 module in your IDE.
At its core, Designer has two primary systems that you will interact with:
- The Resource system, which manages objects contained within the project.
- The State system, which handles state relevance.
Resources are part of the project file and maintained throughout sessions. State is temporary and can be assumed only to be correct at the moment it is parsed, since many sources can update state.
Global Variables
blip : Blip
colours : Colours
d3 : D3
dbg : SwitchableString
nullopt : std_nullopt
os : OS
paths : PathsManager
resourceManager : ResourceManager
subsystems : SubsystemManager
Vec3 = Vec
state : D3State
d3NetManager : D3NetManager
packageSystem : PackageSystem
alertNotificationSystem : AlertNotificationSystem
d3os : OS
undo : UndoSystem
gui : Gui
d3gui : Gui
guisystem : GuiSystem
renderer : DxRenderer
Global Functions
__getattribute__(self, name: str) -> object
getattribute override for restricted scopes
getCppRawAddress(value: _BlipValue) -> int
Get the address of the blip object underlying memory
getCppTypeString(type: Type) -> str
Get the CPP type of the underlying blip object (including const &)
isCppType(type: Type) -> bool
Determine if the type is provided by the C++ layer
makeReference(value: _BlipValue) -> _BlipValue
Make a reference to the object passed in
markDirty(resource: Resource)
Mark the given object as about to become dirty
rp(resource: Resource) -> object
Make Python own the resource object passed
makeMemberNameValid(name: str) -> str
Transforms a FieldInfo name into a valid, similar-looking Python identifier which can be used to look up a member on a Python object.
clamp(v: float, lo: float, hi: float) -> float
Ensures v lies between lo and hi
tr(string: str) -> str
Does nothing at runtime: added so that extract_strings.py can pick up custom python strings for translation. see localisestring.hpp
TFormat(stringPattern: str, *args) -> str
Helper function to translate strings with interpolation
TFormatContext(context: str, stringPattern: str, *args) -> str
Helper function like TFormat, also adds context to the translation