After some research i found the image filepath was defined as the first index in layers under the property filename and so wrote this code.
Code: Select all
data.raw["electric-pole"]["small-electric-pole"]["pictures"].layers[0].filename = "$FILEPATH"
Is this just me being bad a lua or misunderstanding how factorio handles its data.
Because i dont want have to redefine the entire layers field from scratch but with different filepaths which i know works but is really tedious.
Any help is appreciated!