Python lowlevel

From wikinotes
Revision as of 17:28, 6 May 2018 by Will (talk | contribs) (Created page with "= Objects by Memory Location = <blockquote> {{ WARNING | Kills python process if there is an error. (including maya). }} <source lang="python"> import ctypes memoryLoc = id...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Objects by Memory Location

WARNING:

Kills python process if there is an error. (including maya).

import ctypes
memoryLoc   = id( MyClassInstance )														## Get Memory Location
ref2Class   = ctypes.cast( memoryLoc, ctypes.py_object ).value				## Retrieve Object from Memory Location