Re-enable Python bindings for Properties::Type (fixes the Blender plugin) #1570
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR re-enables the Python bindings for Properties::Type. The motivation for this is that the Blender importer queries the types of properties (e.g., https://github.com/mitsuba-renderer/mitsuba-blender/blob/5a12adda2d0da3ccf3c125a54e36f7cf57988957/mitsuba-blender/io/importer/emitters.py#L52), which currently is broken.
One minor complication is that the enum is nested in Properties, which itself is variant dependent. However, the enum isn't. I therefore added some logic to detect if the type was already bound, similar to the
MI_PY_CHECK_ALIAS
macro. I am not sure if this is the best option, but it seems to work.I also modified the unit tests to exercise the functionality