Hey there,
For an export tool, I need to create a maya window.
The window creates a button for each successfull export to copy the output path.
Problem is, after the window is copied, all the buttons point to the same path.
When printing the output path at button creation, they are correct: the args seem to become wrong once the window is actually created.
So the problem is with loop variables get captured by the lambda.
What is happening is that data is being looked up when the lambda function is called (the button is clicked) not when the lambda function is defined.
One option would be to use functools.partial instead, or another option would be to pass data into the lambda at definition time: