Code: Select all
label show_bg(bg_name, tr=None):
show expression "bg " + bg_name at tr
So, the most logical would be to pass a "neutral" or "identity" transform that does nothing, when I want to show the BG as such.TypeError: 'NoneType' object is not callable
This doesn't seem to be defined natively, which means I need to define my own dummy transform that does nothing:
Code: Select all
transform identity:
pass
Or, in order to support both passing a transform and no transform, create two cases:
Code: Select all
label show_bg(bg_name, tr=None):
if tr:
show expression "bg " + bg_name at tr
else:
show expression "bg " + bg_name
UPDATE: tested both methods, they do work