-
I'm following the basic example for polarized rendering. I compiled the system following the instructions, and modified the
In my notebook I first run import mitsuba as mi
mi.set_variant('scalar_spectral_polarized') and I get no error, so I guess the system is properly recognizing the poloarized variant. However, when I import the scene = mi.load_file('Scenes/cbox_pol.xml') ---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
File C:\Program Files\mitsuba3\build\Release\python\mitsuba\__init__.py:107, in MitsubaVariantModule.__getattribute__(self, key)
104 with _dr.scoped_rtld_deepbind():
105 modules = (
106 _import('mitsuba.mitsuba_ext'),
--> 107 _import('mitsuba.mitsuba_' + variant + '_ext'),
108 )
110 super().__setattr__('_modules', modules)
File C:\ProgramData\Miniconda3\envs\mitsuba_rendering\Lib\importlib\__init__.py:126, in import_module(name, package)
125 level += 1
--> 126 return _bootstrap._gcd_import(name[level:], package, level)
File <frozen importlib._bootstrap>:1204, in _gcd_import(name, package, level)
File <frozen importlib._bootstrap>:1176, in _find_and_load(name, import_)
File <frozen importlib._bootstrap>:1140, in _find_and_load_unlocked(name, import_)
ModuleNotFoundError: No module named 'mitsuba.mitsuba_scalar_spectral_polarized_ext'
During handling of the above exception, another exception occurred:
AttributeError Traceback (most recent call last)
Cell In[12], line 1
----> 1 scene = mi.load_file('Scenes/cbox_pol.xml')
File C:\Program Files\mitsuba3\build\Release\python\mitsuba\__init__.py:253, in MitsubaModule.__getattribute__(self, key)
251 sub_suffix = '' if submodule is None else f'.{submodule}'
252 module = _sys.modules[f'mitsuba.{variant}{sub_suffix}']
--> 253 result = module.__getattribute__(key)
255 # Add set_variant(), variant() and variant modules to the __dict__
256 if submodule is None and key == '__dict__':
File C:\Program Files\mitsuba3\build\Release\python\mitsuba\__init__.py:113, in MitsubaVariantModule.__getattribute__(self, key)
111 except ImportError as e:
112 if str(e).startswith('No module named'):
--> 113 raise AttributeError('Mitsuba variant "%s" not found.' % variant)
114 else:
115 raise AttributeError(e)
AttributeError: Mitsuba variant "scalar_spectral_polarized" not found. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
You need to compile this variant yourself -- it's not one that we ship by default. Please read the documentation on how to make builds with additional variants of the system. |
Beta Was this translation helpful? Give feedback.
-
If your custom Mitsuba build succeeded, then the most likely issue is that |
Beta Was this translation helpful? Give feedback.
-
Thank you, I finally understood what I needed to do. My understanding was that all variants were installed by cmake, and I just needed to specify the ones I wanted to use in the |
Beta Was this translation helpful? Give feedback.
Thank you, I finally understood what I needed to do. My understanding was that all variants were installed by cmake, and I just needed to specify the ones I wanted to use in the
mitsuba.conf
.Instead, cmake builds only the variants specified in the
mitsuba.conf
file. So, if one wants to add a new variant they need to change themitsuba.conf
file adding the desired variant, and then run again cmake to build again the whole thing.