### Set up Python Virtual Environment for Windows Build Source: https://github.com/niklas2902/py4godot/blob/master/README.md This sequence of commands creates and activates a Python virtual environment, then installs project dependencies from `requirements.txt`. This is an optional step to manage project-specific packages without affecting the global Python installation. ```console python -m venv virtual_python .\virtual_python\Scripts\activate pip install -r requirements.txt ``` -------------------------------- ### Set up Python Virtual Environment for Linux Build Source: https://github.com/niklas2902/py4godot/blob/master/README.md This sequence of commands creates and activates a Python virtual environment, then installs project dependencies from `requirements.txt`. This is an optional step to manage project-specific packages without affecting the global Python installation. ```console python3 -m venv venv source venv/bin/activate pip install -r requirements.txt ``` -------------------------------- ### Workaround for Cython on Python 3.12 on Linux Source: https://github.com/niklas2902/py4godot/blob/master/README.md Addresses a dependency issue with Cython on Python 3.12 by installing `setuptools` and copying `distutils`. This is a necessary workaround because Python 3.12 no longer provides `distutils` directly, which Cython might depend on. ```console pip install setuptools python copy_distutils.py ``` -------------------------------- ### Define Custom Godot Node3D Class with py4godot Source: https://github.com/niklas2902/py4godot/blob/master/README.md This snippet illustrates the definition of a custom Node3D class in Python for Godot Engine using the py4godot library. It includes examples of declaring various property types (int, float, bool, Vector3), defining a custom signal with an integer argument, and implementing the '_ready' and '_process' lifecycle methods. A private method is also shown to prevent it from appearing in the Godot editor. ```Python # file: node3d.py from py4godot.methods import private from py4godot.signals import signal, SignalArg from py4godot.classes import gdclass from py4godot.classes.core import Vector3 from py4godot.constants.constants import VECTOR3_UP from py4godot.classes.Node3D import Node3D @gdclass class node3d(Node3D): # define properties like this test_int: int = 5 test_float: float = 5.2 test_bool: bool = True test_vector: Vector3 = Vector3.new3(1,2,3) # define signals like this test_signal = signal([SignalArg("test_arg", int)]) def _ready(self) -> None: pass # put initialization code here def _process(self, delta:float) -> None: pass # put dynamic code here # Hide the method in the godot editor @private def test_method(self): pass ``` -------------------------------- ### Generate and Compile Minimized Development Build on Windows Source: https://github.com/niklas2902/py4godot/blob/master/README.md These commands enable a faster, minimized build suitable for development or simpler projects. It generates a subset of files and compiles them in 'dev' mode, excluding some classes for quicker iteration. ```console python generate.py -dev_build=True python cythonize_files.py -mode="dev" ``` -------------------------------- ### Compile py4godot Project for Linux 64-bit Source: https://github.com/niklas2902/py4godot/blob/master/README.md Compiles the entire py4godot project for the Linux 64-bit platform using the GCC compiler. The compiled output will be located in the `build/py4godot` directory. ```console python build.py --target_platform=linux64 --compiler=gcc ``` -------------------------------- ### Generate and Compile Minimized Development Build on Linux Source: https://github.com/niklas2902/py4godot/blob/master/README.md These commands enable a faster, minimized build suitable for development or simpler projects. It generates a subset of files and compiles them in 'dev' mode, excluding some classes for quicker iteration. ```console python generate.py -dev_build=True python cythonize_files.py -mode="dev" ``` -------------------------------- ### Generate Cython Files for Windows Build Source: https://github.com/niklas2902/py4godot/blob/master/README.md Executes the `generate.py` script to prepare necessary files for Cython compilation. These files are later used to generate C++ code from Python classes. ```console python generate.py ``` -------------------------------- ### Generate Cython Files for Linux Build Source: https://github.com/niklas2902/py4godot/blob/master/README.md Executes the `generate.py` script to prepare necessary files for Cython compilation. These files are later used to generate C++ code from Python classes. ```console python generate.py ``` -------------------------------- ### Compile py4godot Project for Windows 64-bit Source: https://github.com/niklas2902/py4godot/blob/master/README.md Compiles the entire py4godot project for the Windows 64-bit platform using the MSVC compiler. The compiled output will be located in the `build/py4godot` directory. ```console python build.py --target_platform=windows64 --compiler=msvc ``` -------------------------------- ### Compile Python Classes to C++ with Cython on Windows Source: https://github.com/niklas2902/py4godot/blob/master/README.md Runs the `cythonize_files.py` script to convert Python classes into C++ files using Cython. This process can be time-consuming and its performance can be optimized by adjusting `NTHREADS` and `BATCH_SIZE` parameters based on system resources. ```console python cythonize_files.py ``` -------------------------------- ### Compile Python Classes to C++ with Cython on Linux Source: https://github.com/niklas2902/py4godot/blob/master/README.md Runs the `cythonize_files.py` script to convert Python classes into C++ files using Cython. This process can be time-consuming and its performance can be optimized by adjusting `NTHREADS` and `BATCH_SIZE` parameters based on system resources. ```console python cythonize_files.py ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.