Post #3993: It works with the image from the active camera in the scene

📋 Metadata

🏷️ Tags

macro scripting advanced solved

  • Macro Editor
  • Python Scripting
  • Property Editor

💬 Content

It works with the image from the active camera in the scene

solo

L.prop(C.scene.camera.data.background_images[-1], 'alpha', slider=True, text=text, icon=icon)

or with contexts

None if C.scene.camera == None else( None if len(C.scene.camera.data.background_images) == 0 or not C.scene.camera.data.background_images else (None if C.scene.camera.data.background_images[-1].source != 'IMAGE' else L.prop(C.scene.camera.data.background_images[-1], 'alpha', slider=True, text=text, icon=icon)))

🔗 View on Blender Artists