mitsuba-renderer / mitsuba-blender

Mitsuba integration add-on for Blender
BSD 3-Clause "New" or "Revised" License
280 stars 37 forks source link

Failed to load Mitsuba package. #83

Closed mengyuan-lee closed 11 months ago

mengyuan-lee commented 11 months ago

Issue Title Failed to load Mitsuba package.

Bug Description When I install this package in Blender 3.3 as suggested, it always returns "Failed to load Mitsuba package.". I checked the source code and found that it is aroused by exception in init_mitsuba(context). But I do not find out how to fix it.

I have tried different versions of python and different versions of Blender, neither works.

bathal1 commented 11 months ago

Could you please provide more details regarding your setup ? What OS are you using, how did you install the add-on, which version ? Did you click on "install dependencies via pip" in the addon settings ? Or are you trying to use a custom Mitsuba build ?

mengyuan-lee commented 11 months ago

I use it on win10. I added it (I tried both v2 and v3) into blender 3.3 by clicking “edit”, “preferences”,  “add-ons”, “install”, and selecting the zip archive. There is no button about “install dependencies via pip”, just a button about “update dependencies”. I clicked it and found that “failed to load mitsuba”. I have tried to use a custom mitsuba build. I used “pip install mitsuba” in cmd and mitsuba 5.0 was installed. I copied the path of mitsuba 5.0 to install the addon in blender, but it returned “failed to load custom mitsuba. Please verify the path to the build directory.”.

bathal1 commented 11 months ago

When using versions of blender before 3.5, you will need to run blender with the flag --python-use-system-env in order for it to find the packages installed via pip when clicking on "Install/update dependencies". Please try the following:

Blender should now be able to load mitsuba, please let me know if it doesn't

Please also note that the "custom build" you are describing is not what we mean by that. Installing mitsuba via pip in a different python environment will likely lead to errors because of mismatches between versions of mitsuba and/or python. The intended way is to clone mitsuba and build it, and then put the path to the build folder in the addon settings. This is usually not necessary though, as installing the packages via pip should work in most cases.

mengyuan-lee commented 11 months ago

It works now. Thanks.