How to load/import a PNG image as plane via Blender's Python API? I have the following snippet to load an image as plane; however, this seems to be obsolete in newer versions of Blender such as 2.79.

bpy.ops.import_image.to_plane(use_shadeless=True, files=[{'name':file_path}])


I need to import a local PNG image as plane that will always face camera. What is the new API to do so in version 2.79?

The error I'm receiving in the console is:

Traceback (most recent call last):
  File "C:\~~~~\Text", line 17, in &lt;module&gt;
  File "C:\Program Files\Blender Foundation\Blender\2.79\scripts\modules\bpy\ops.py", line 189, in __call__
    ret = op_call(self.idname_py(), None, kw)
AttributeError: Calling operator "bpy.ops.import_image.to_plane" error, could not be found
Error: Python script fail, look in the console for now...
The use_shadeless has been replaced with shader which accepts values of DIFFUSE, SHADELESS or EMISSION.

bpy.ops.import_image.to_plane(shader='SHADELESS', files=[{'name':file_path}])


For other options, if you manually do an import image as planes and have python tooltips enabled you can find the property name in the tooltips