Python 2.8 - image as plane problem The line of code worked in the past, but has stopped working now that I have had to replace the computer on which the code was originally written and tested. The error message is:

Calling operator "bpy.ops.import_image.to_plane" error, could not be found

The line of code is:


    bpy.ops.import_image.to_plane(files=[{"name":BackgroundFilename, "name":BackgroundFilename}], directory=BackgroundFolder)


The variables 'BackgroundFilename' and 'BackgroundFolder' are correct.  The file to which these variables refer exists and opens normally outside of python.

Checking the file properties, it is not blocked and everything seems normal.

Any suggestions would be appreciated.  Thanks in advance.
Enable the addon

Go to the user preferences and enable the addon "Import Images as Planes" to make the operator registered and available to scripts.



Related

Can an add-on be automatically installed and enabled?