UpdateFeatures on instances

Hi there
I have a small export script that set up some instances, remove some characters and export it.
It fails on the export because it’s not updating the features when exporting that instance.
How do I make an “Update Features” on an instance(not the font only the instance) via script?
I’ve tried this TemporaryVariableInstance_A.customParameters['Update Features'] = True but that doesn’t work.

My code looks like this:

# Temporary Variable Instance - A (Only the space glyph) 
TemporaryVariableInstance_A = GSInstance(type=INSTANCETYPEVARIABLE)
TemporaryVariableInstance_A.name = "Web variable A"
TemporaryVariableInstance_A.customParameters['fileName'] = f"{font.familyName} - A"
TemporaryVariableInstance_A.customParameters['Keep Glyphs'] = "space"
TemporaryVariableInstance_A.customParameters['Update Features'] = True
font.instances.append(TemporaryVariableInstance_A)

print("== Exporting Website - Protected files ==")
print(font.export(Format=VARIABLE, Containers=[PLAIN, WOFF, WOFF2], FontPath=os.path.expanduser(subfolder_paths["Website - Protected files"]), UseProductionNames=UseProductionNames, AutoHint=TTF_AutoHint))
print()

Are those features set to “Generate automatically”?

If you run this from a script, you can remove the features directly.

I’m not sure exactly what you mean. But it would also be cool if I could just do that export without features. How do I flag that in the generate function?

Just do font.features = None before the font.export?

Yeah that makes sense. But that would remove the features from the glyph-file completely, right? so then I would loose the features for good after an export right?
Isn’t there a way to say export without features, something like font.export(Format=VARIABLE, Features=NONE) or even better instance.generate(Format=TTF, Features=UPDATE) ?

You could add “Remove Feature” parameters to the instance. But that would be too complicated.

not if you copy the font before. In your setup, you would end up with an extra instance in the font, too.

So add this at the top of your script:

font = font.copy() 

Thanks!