Skip to content
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

Taichi not installing automatically with addon install in Blender v3.0 #24

Open
codesavory opened this issue Jan 2, 2022 · 7 comments

Comments

@codesavory
Copy link

Traceback (most recent call last): File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\modules\addon_utils.py", line 351, in enable mod = __import__(module_name) File "C:\Users\surya\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\BlenderPythonRenderer-main\__init__.py", line 1, in <module> from . import engine File "C:\Users\surya\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\BlenderPythonRenderer-main\engine.py", line 3, in <module> from .render.render import Render File "C:\Users\surya\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\BlenderPythonRenderer-main\render\render.py", line 1, in <module> from .scene import Scene File "C:\Users\surya\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\BlenderPythonRenderer-main\render\scene.py", line 1, in <module> from .mesh import MeshCache File "C:\Users\surya\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\BlenderPythonRenderer-main\render\mesh.py", line 1, in <module> import taichi as ti ModuleNotFoundError: No module named 'taichi'

I am trying to install the addon as a standalone zip into Blender v3.0. But I am getting the error, taichi not found. I suppose this can be solved by externally installing taichi, but you mentioned that it would be installed automatically.

Secondly, I would like to support the project and want to setup a symlink to the git repo as an addon. Do you think you could add the instructions for the same or point to relevant resources. Thank you, and amazing project!

@bsavery
Copy link
Owner

bsavery commented Jan 3, 2022

So this code:

def check_for_taichi():

Should be installing taichi automatically. Looking at it now though. It might be calling that AFTER the engine is imported (which then calls import taichi). Should be pretty easy to fix.

Secondly, yeah you can do this two ways with developing and running the add-on.

  1. Git clone the repo here to your blender add-on directory. Probably not the best idea but it would work.
  2. Doing a symlink like you said. I know they can be more complicated than they need to be on windows but generally I think you'd do:
    mklink /D "C:\Users\<MYNAME>\Documents\GitHub\BlenderPythonRenderer" "C:\Users\<MYNAME>\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\BlenderPythonRenderer" Substituting MYNAME for you user name and wherever you actually cloned the git repo. On linux of Mac you do ln -s`.
  3. I also know its possible to set the "scripts" directory in your blender preferences to point to the GitHub directory.
  4. There's actually some way you can run blender from the command line and load a script / add-on, perhaps I should add a command line script to do that?

@bsavery
Copy link
Owner

bsavery commented Jan 3, 2022

Also let me know where you're interested to contribute. I have a few things I'm hoping to wrap up today to really increase the speed of renders, but working on lights, materials would be helpful.

@codesavory
Copy link
Author

Sure, I would love to contribute to lighting and materials, that's where my interest and specialization lies. Let me know if there is anything specific you would like me to look into - bugs or enhancements. Looking to set aside 20% of my time on this. Note - Yet to set the code base workflow and walk through the code, but I think I can pick it up on the go. Looking forward!

@codesavory
Copy link
Author

codesavory commented Jan 8, 2022

Alright, got everything setup, it was a lot more challenging than expected. I wanted to share them here for windows -

  1. To setup a symlink -
  • mklink [options] <Link> <Target>. Target is the file/folder that exists, and Link is the created one that links to the target.
  • In our example, the locations needs to be reversed - mklink /D "C:\Users\<MYNAME>\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\BlenderPythonRenderer" "C:\Users\<MYNAME>\Documents\GitHub\BlenderPythonRenderer". Substituting MYNAME for you user name and wherever you actually cloned the git repo.
  1. To install Taichi in Blender -
  • Open command prompt as Admin
  • Change to python location of Blender - C:\Program Files\Blender Foundation\Blender 3.0\3.0\python\bin>
  • Ensure that pip is installed in Site-Packages of this Blender - 'python.exe -m ensurepip' should point to c:\program files\blender foundation\blender 3.0\3.0\python\lib\site-packages
  • Double-check with this command - python.exe -m pip --version
  • Install Taichi - python.exe -m pip install taichi
  • Check if installed correctly - python.exe -m pip list

@codesavory
Copy link
Author

codesavory commented Jan 8, 2022

Quick question, the scene when changed to BPR renderer out of the box doesn't render the box, but that's alright. Can you update me on how to make the cube into a diffuse material and add an emissive light? I don't see many properties in the materials tab or having added a light. This is more so about how does one uses blender UI features to make the scene supported to be rendered by the engine? Any comments or resources help, thanks!

Uploading the scene here - base_scene.zip

@shankarsivarajan
Copy link

For using pip in Blender, I recommend blender_pip.

@bsavery
Copy link
Owner

bsavery commented Feb 22, 2022

Thanks. I've used something a bit similar. I guess if I make this more usable for users we could do something like that. Unless you want to create a pull request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants