diff options
author | Bastien Montagne <bastien@blender.org> | 2022-05-30 18:15:37 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-05-30 18:16:13 +0300 |
commit | 4267c6280a41e3f5d00ab0ce55b5a1df622903b5 (patch) | |
tree | 49a90add19b5b917cff77f97397b8e4d4af57900 | |
parent | dd2ed1c55cf50cbd5640ff00c6991c3c53dcefe0 (diff) |
Fix (unreported) missing rna_path function for BackgroundImage struct.
-rw-r--r-- | source/blender/makesrna/intern/rna_camera.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c index 92df7293c2e..52ec2bee128 100644 --- a/source/blender/makesrna/intern/rna_camera.c +++ b/source/blender/makesrna/intern/rna_camera.c @@ -111,6 +111,20 @@ static void rna_Camera_background_images_clear(Camera *cam) WM_main_add_notifier(NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, cam); } +static char *rna_Camera_background_image_path(const PointerRNA *ptr) +{ + const CameraBGImage *bgpic = ptr->data; + Camera *camera = (Camera *)ptr->owner_id; + + const int bgpic_index = BLI_findindex(&camera->bg_images, bgpic); + + if (bgpic_index >= 0) { + return BLI_sprintfN("background_images[%d]", bgpic_index); + } + + return NULL; +} + static void rna_Camera_dof_update(Main *bmain, Scene *scene, PointerRNA *UNUSED(ptr)) { SEQ_relations_invalidate_scene_strips(bmain, scene); @@ -179,6 +193,7 @@ static void rna_def_camera_background_image(BlenderRNA *brna) RNA_def_struct_sdna(srna, "CameraBGImage"); RNA_def_struct_ui_text( srna, "Background Image", "Image and settings for display in the 3D View background"); + RNA_def_struct_path_func(srna, "rna_Camera_background_image_path"); RNA_define_lib_overridable(true); |