-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weird bug when using pip lib that connects to the external camera. #373
Comments
Hi @TheBricktop You are talking about Godot editor, so you know there is multiple way Godot run a project:
So I advice you to make sure you are not by mistake running multiple instance of the python code that would then fight over connecting to your camera...
there is no main function in godot-python (this is because it's godot that decides which class should be loaded, then ask godot-python load the corresponding python file). So everything in you class's file will be executed and if you have a |
but the question remains : how to stop godot python from autoexecuting every python script on start of the editor because its locking some of the features and hardware before the actual game can start. My problem stems from need to block the execution of functions that im holding in a helper classes, so i dont know if i should to stuff all the class into the "if name" block. also there is a weird bug that does not allow exporting the variables in the script to the editor, i cant put my finger on why. let me post my script here to examine what is wrong with it :
EDIT: |
Hey another issue ive ran into and this one is particulary weird :
im using depthai from pypi to connect to the stereocamera and get some frames.
While it can use the python interpreter provided by the godot-python module and it runs ok, the moment godot editor links to it it stops recognizing the device.
I know this is very soecific problem and I can't possibly expect anyone to have this particular sensor but im rather asking about what might block a working device out of godot-python when they are connected.
Another weird thing was when one of my scripts in python had def main (): and then main() construction because it started automatically when editor started and was running in the background.
Both problems might be connected, and i think that the reslution could be to start the "daemon" that operates the device and after that another script would read the incoming data but thats a wild guess.
Edit:
The possible culprit might be that godot language server runs through all of the init and main functions in provided *.py files and then it effectively blocks the device from being used again as it is already engaged.
The text was updated successfully, but these errors were encountered: