I would like to add the prop from Properties > Camera > Focal Length to a panel in the 3D View, but I can't seem to get it right.
class MyPanel(bpy.types.Panel) : bl_space_type = "VIEW_3D" bl_region_type = "UI" bl_label = "My Panel" def draw(self, context) : TheLayout = self.layout TheLayout.prop(context.space_data, "lens") #Like this, but for the Camera's focal length.
The console suggests:
And this gives me the value of the function:
But how do I make a widget with this function in a 3D View panel?