Skip to content

How to initialize an integrator instance by a scene's parameters? #507

Answered by njroussel
Mephisto405 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Mephisto405

Plugins in Mitsuba have a unidirectional parent->child relationship, which makes something like you're trying to do a bit complicated as usually the scene is the parent and the integrator is one of its children. There's not really a way to (easily) get around this.

There are a few options to work around it though. The issue here is that the __init__ constructor cannot take the mi.Scene it is a part of as an argument, however you can use any other method or even create a new method which takes a scene as a parameter.
A few options:

  1. Add a new initialize(scene: mi.Scene) method to your integrator which you need to explicitly call.
  2. Make sample() check if it already has initia…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Mephisto405
Comment options

Answer selected by Mephisto405
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants