I'm trying to take an image from my machine and put in a object texture in UPBGE, but I'm getting this error and idk anything more I can try. The image should be taken by the BGE python script and going to the object.
This is the python code I used, the file and an example image are available here too
The render result with the right image and path in my machine
CodePudding user response:
In your code your Path is
"D:/Downloads/imagens/" imageName
First of all check if imagens is a typo (so maybe you mean images)
And this path seems like a windows-like path. For this fix you need to make:
# at your imports
import os
"D:/Downloads/imagens/".replace("/", os.sep) imageName # as path
# or /images/ if it was a typo
CodePudding user response:
Solved it! I used the same script and added a new "Base color" to the 'canvas' material.