MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / isLoadedFromEmbeddedPython

Function isLoadedFromEmbeddedPython

Source/Falcor/FalcorPython.cpp:38–50  ·  view source on GitHub ↗

* This function checks if the falcor module is loaded from a Falcor * application running the embedded python interpreter (e.g. Mogwai). */

Source from the content-addressed store, hash-verified

36 * application running the embedded python interpreter (e.g. Mogwai).
37 */
38static bool isLoadedFromEmbeddedPython()
39{
40 try
41 {
42 auto os = pybind11::module::import("os");
43 std::string value = os.attr("environ")["FALCOR_EMBEDDED_PYTHON"].cast<pybind11::str>();
44 return value == "1";
45 }
46 catch (const std::exception&)
47 {}
48
49 return false;
50}
51
52PYBIND11_MODULE(falcor_ext, m)
53{

Callers 1

PYBIND11_MODULEFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected