Initialize Mitsuba Python variant in SceneManager for custom plugin registration - #26
Initialize Mitsuba Python variant in SceneManager for custom plugin registration#26WeiPhil wants to merge 1 commit into
Conversation
dvicini
left a comment
There was a problem hiding this comment.
Mostly looks good. It would just be good to clarify the error message
| if (!TfPyInvoke("mitsuba", "set_variant", variant)) { | ||
| TF_WARN( | ||
| "Failed to set Mitsuba Python variant '%s'; Python-defined plugins " | ||
| "(e.g. volprim_rf_basic) will be unavailable.", |
There was a problem hiding this comment.
Will be unavailable or might be unavailable if there is a variant mismatch?
There was a problem hiding this comment.
Will be unavailable. I think there are only two scenarios in which case this fails. Mitsuba was built without python support or a wrong PYTHONPATH was set or mitsuba doesn't have that variant which can only happen if we load a different mitsuba build that the one we ship with hdmitsuba, e.g the pip version which I think we do warn isn't supported. In case we just switch variant this work seemlessly. Maybe we can rephrase as
"Could not import mitsuba in Python or set variant X — check PYTHONPATH points at the same Mitsuba build hdmitsuba was compiled against."
There was a problem hiding this comment.
Okay makes sense. Yes let's just add a sentence that this means the Mitsuba Python module was not found.
Also, should this code initially import mitsuba? I think right now this may not work if mitsuba was previously not imported?
This allows python-based plugins to automatically get registered in the render delegate (e.g. volprim_rf_basic) that would otherwise never get registered from the C++ side of things.