-
Notifications
You must be signed in to change notification settings - Fork 347
how can i import my own .py file and use this in the script node? #1918
Answered
by
OmarEmaraDev
luckychris
asked this question in
Q&A
-
i have written a function in another text (.py) file and want to import this in a .py file which i want to use in a script node.
So basically my script .py file looks like this:
import driverFunctions
return driverFunctions.getTargetRelativeToCar(wantVector=True)
But i got the error:
imagehow can i realize this?
Beta Was this translation helpful? Give feedback.
All reactions
Answered by
OmarEmaraDev
May 13, 2023
I think the Blender way to do that would be:
driverFunctions = bpy.data.texts['driverFunctions.py'].as_module()
Replies: 1 comment 1 reply
-
I think the Blender way to do that would be:
driverFunctions = bpy.data.texts['driverFunctions.py'].as_module()
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
1 reply
-
Thank you very much Omar, i didn't know that method at all and it worked like a charm!!!
Beta Was this translation helpful? Give feedback.
All reactions
Answer selected by
OmarEmaraDev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment