Changing an INI config to a GlobalDefines

You use the CyGlobalContext functions

  • getDefineINT(key)
  • getDefineFLOAT(key)
  • getDefineSTRING(key)
For example,

Code:
from CvPythonExtensions import *

gc = CyGlobalContext()
bEnabled = gc.getDefineINT("MAD_ENABLED") > 0
szName = gc.getDefineSTRING("MAD_DISPLAY_NAME")

The import line is from memory, so grab it from some other Python module. The rest should work as advertised.
 
Well, you need to make new values in the GlobalDefines.xml file, of course, and you can access those values in C++, but I assumed you wanted it in Python.
 
Top Bottom