eradiate.test_tools.types.check_scene_element#
- eradiate.test_tools.types.check_scene_element(instance, mi_cls=None, ctx=None, drop_parameters=True)[source]#
Perform kernel dictionary checks on a scene element.
This function checks if the scene element can produce a valid kernel dictionary template, as well as an appropriate parameter table.
The returned Mitsuba object and parameter table can be used to perform additional checks.
- Parameters:
instance (
NodeSceneElement
orCompositeSceneElement
) – Node scene element to check.mi_cls (
mitsuba.Object
) – Mitsuba class the node scene element expands to. Must be set if instance is aNodeSceneElement
; ignored otherwise.ctx (
KernelContext
, optional) – If provided, the kernel dictionary context to use. Otherwise, a default context is created.drop_parameters (
bool
, default:True
) – IfTrue
, the Mitsuba scene parameter table will be stripped off from untracked parameters.
- Returns:
mi_obj (
mitsuba.Object
) – Mitsuba object the scene element was expanded to. See notes for details.mi_params (
dict
) – Parameter table of the Mitsuba objects generated by the tested scene element.
Notes
If instance is a
NodeSceneElement
, the corresponding Mitsuba object type is checked against mi_cls.If instance is a
CompositeSceneElement
, the corresponding Mitsuba objects are automatically encapsulated into amitsuba.Scene
object.