---
title: "D3 API Documentation"
description: "Base class documentation"
url: https://developer.disguise.one/python-api/docs/
---

# 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](/assets/d3.pyi). 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:

1.  The [Resource](/plugins/docs/resource#resource) system, which manages objects contained within the project.
2.  The [State](/plugins/docs/d3state#d3state) 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

#### **os** : _[OS](/python-api/docs/os#os)_

#### **paths** : _[PathsManager](/python-api/docs/pathsmanager#pathsmanager)_

#### **resourceManager** : _[ResourceManager](/python-api/docs/resourcemanager#resourcemanager)_

#### **subsystems** : _[SubsystemManager](/python-api/docs/subsystemmanager#subsystemmanager)_

#### **Vec3** = Vec

#### **state** : _[D3State](/python-api/docs/d3state#d3state)_

#### **d3NetManager** : _[D3NetManager](/python-api/docs/d3netmanager#d3netmanager)_

#### **alertNotificationSystem** : _[AlertNotificationSystem](/python-api/docs/alertnotificationsystem#alertnotificationsystem)_

#### **d3os** : _[OS](/python-api/docs/os#os)_

#### **guisystem** : _[GuiSystem](/python-api/docs/guisystem#guisystem)_

## 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](/python-api/docs/resource#resource)_)

Mark the given object as about to become dirty

#### **rp**(resource: _[Resource](/python-api/docs/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.

#### **originalMemberName**(name: _str_) -> _str_

Inverse of makeMemberNameValid for the keyword-clash rename only.

Returns the original C++ name if `name` was renamed (e.g. trailing underscore added) to  
dodge a Python keyword/restricted name. Returns `name` unchanged otherwise. Cannot invert  
the non-identifier-character substitution or the leading-digit prefix, since those are  
not invertible without the original.

#### **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
