all blends are yours to do with as you please and are your property. gpl only applies to code that directly interfaces with blender/upbge import bpy or import bge, etc.
rust isnt part of blender, is it? it probably has its own license and rules.
come on, we are all sick of answering these questions. use the search feature.
to be on the safe side, keep you code separate in a scripts folder and import it into you game.
lets say you have a script called myawesomecode.py in a folder names scripts
then you simply import it into you project and it stays independent the same way importing Rust does.
example:
import bge
from scripts import myawesomecode
but no “import bge” in your code in you scripts folder
Keep in mind gpl on scripts using the bge module however you import it stays under gpl.
It’s not the fact that
import bge
#or
from bge import logic
Makes your script(s) gpl bound, but using the module makes it bound. Meaning if you got a .py file where you import everyting
import bge
import my script
import 100 more of my scripts
Then that .py is gpl bound but also any script that is using the module, so ‘my script’ uses something like this:
scene = bge.logic.getCurrentScene()
Then that whole file is gpl bound as well. Unfortunately this can’t be avoided, because even with functions someday you will need the bge module to grab something.
But then again, for some things you can actually work around the gpl. Simply to use the same method as above, importing scripts, but then put everything that needs the bge module into the gpl bound script, and then import that script in your script.py and only call the function you need in your script.py.
Example:
#gpl bound script
import bge
def getscene():
scene = bge.logic.getCurrentScene()
return scene
# not gpl bound
import my_gpl_bound_stuff as my_script
def pingpong(cont):
scene = my_script.getscene()
this is the wrong order, if import gpl-bound-stuff into non-gpl-code is the same as importing bge, you non-gpl turns gpl, if you want to avoid infecting you non-gpl code keep it a dependency.
One would think so indeed, but no it wil not be gpl bound, because import bge alone will not gpl the script. using 1 of the bge api’s makes it gpl bound.
As you can see in my example, the non gpl script does not use any api. the bound gpl script does.
I hear you think about yeah but you import script into script, YES! indeed and the non gpl script has nothing to do with gpl in this case, because the other script holds the code. (importing a script into a script will not make it 1 script, it stays 2 sepperated scripts(1 with and 1 without gpl))
So if anyone would ask to see your code, you only have to supply the gpl script with all the functions you use in your other scripts, as long as you do not use any bge api in your non gpl scripts.
So if you use one script to call bge and import all your scripts, and then use the bge.logic inside the imported scripts, then everything will fall under gpl.