gdnative_python/pythonscript/godot/__init__.py

45 lines
1.3 KiB
Python
Raw Normal View History

# Start with a sanity check to ensure the loading is done from Godot-Python
# (and not from a regular Python interpreter which would lead to a segfault).
# The idea is we should have the following loading order:
2023-06-02 11:13:10 +02:00
# pandemonium binary -> pythonscript.so -> _pandemonium.so -> pandemonium/__init__.py
import sys
2023-06-02 11:13:10 +02:00
if "_pandemonium" not in sys.modules:
raise ImportError(
2023-06-02 11:13:10 +02:00
"Cannot initialize pandemonium module given Godot GDNative API not available.\n"
"This is most likely because you are running code from a regular Python interpreter"
2023-06-02 11:13:10 +02:00
" (i.e. doing something like `python my_script.py`) while pandemonium module is only available"
" to Python code loaded from Godot through Godot-Python plugin."
)
del sys
2023-06-02 11:13:10 +02:00
from pandemonium._version import __version__
from pandemonium.tags import (
MethodRPCMode,
PropertyHint,
PropertyUsageFlag,
rpcdisabled,
rpcremote,
rpcmaster,
rpcpuppet,
rpcslave,
rpcremotesync,
rpcsync,
rpcmastersync,
rpcpuppetsync,
signal,
export,
exposed,
)
2023-06-02 11:13:10 +02:00
from pandemonium.pool_arrays import (
PoolIntArray,
PoolRealArray,
PoolByteArray,
PoolVector2Array,
PoolVector3Array,
PoolColorArray,
PoolStringArray,
)
2023-06-02 11:13:10 +02:00
from pandemonium.builtins import *
from pandemonium.bindings import *