Python lowlevel: Difference between revisions

From wikinotes
(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...")
 
(No difference)

Latest revision as of 17:28, 6 May 2018

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