-
-
Notifications
You must be signed in to change notification settings - Fork 325
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
No blender installation found #205
Comments
I just encountered the same issue. I dived into the sourced code and found that Ursina locates Blender installation in if application.development_mode:
if platform.system() == 'Windows':
# get blender path by getting default program for '.blend' file extention
import shlex
import winreg
try:
class_root = winreg.QueryValue(winreg.HKEY_CLASSES_ROOT, '.blend')
with winreg.OpenKey(winreg.HKEY_CLASSES_ROOT, r'{}\shell\open\command'.format(class_root)) as key:
command = winreg.QueryValueEx(key, '')[0]
default_blender = shlex.split(command)[0]
default_blender = Path(default_blender)
application.blender_paths['default'] = default_blender
blender_foundation_directory = default_blender.parent.parent
for blender_installation in blender_foundation_directory.glob('*'):
first_folder = tuple(blender_installation.glob('*'))[0] # version
version_name = first_folder.name[:3]
application.blender_paths[version_name] = list(blender_installation.glob('blender.exe'))[0]
except:
pass
elif platform.system() == 'Linux':
# Use "which" command to find blender
which_process = subprocess.run(('which', 'blender'), stdout=subprocess.PIPE)
if which_process.returncode == 0:
blender_exec = which_process.stdout.decode().strip()
application.blender_paths['default'] = blender_exec Because if you call The logic behind locating Blender in Ursina is straightforward: use Here is my solution:
elif platform.system() == 'Darwin':
which_process = subprocess.run(('which', 'blender'), stdout=subprocess.PIPE)
if which_process.returncode == 0:
blender_exec = which_process.stdout.decode().strip()
application.blender_paths['default'] = blender_exec
|
Thanks so much! It did indeed work. |
Hi! I am having some issues with loading blender files. I am trying to load a (fairly complicated, not too bad) blender file, but ursina bombs with this error:
(for reference this is the code running it all)
It seems to think that I don't have blender installed??? I do, here is a ss of it displaying the same model I am trying to load:
I am not really sure why this is happening, so any help is greatly appreciated!
Info:
The text was updated successfully, but these errors were encountered: