0
$\begingroup$

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.

$\endgroup$
2
$\begingroup$

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.

enter image description here

Related

Can an add-on be automatically installed and enabled?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.