Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2022-06-08 18:49:40 +0300
committerBastien Montagne <bastien@blender.org>2022-06-08 19:00:42 +0300
commit8843705f651f0150d22b9f99e4cac9b7a641adbf (patch)
tree36f253ae253908dbfa00616bfe6c869d7d0640bc /source/blender/makesrna/intern/rna_camera.c
parentd62e6f122575a0a8292e731fecebe663589e81ea (diff)
Fix (unreported) missing rna path for some background image properties.
RNA camera code did not handle path for its image/movieclip users sub-data, and moviclip RNA struct definition did not have a rna path function at all.
Diffstat (limited to 'source/blender/makesrna/intern/rna_camera.c')
-rw-r--r--source/blender/makesrna/intern/rna_camera.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c
index dcf0647392e..9628c6b2d65 100644
--- a/source/blender/makesrna/intern/rna_camera.c
+++ b/source/blender/makesrna/intern/rna_camera.c
@@ -125,6 +125,24 @@ static char *rna_Camera_background_image_path(const PointerRNA *ptr)
return NULL;
}
+char *rna_CameraBackgroundImage_image_or_movieclip_user_path(const PointerRNA *ptr)
+{
+ const char *user = ptr->data;
+ Camera *camera = (Camera *)ptr->owner_id;
+
+ int bgpic_index = BLI_findindex(&camera->bg_images, user - offsetof(CameraBGImage, iuser));
+ if (bgpic_index >= 0) {
+ return BLI_sprintfN("background_images[%d].image_user", bgpic_index);
+ }
+
+ bgpic_index = BLI_findindex(&camera->bg_images, user - offsetof(CameraBGImage, cuser));
+ if (bgpic_index >= 0) {
+ return BLI_sprintfN("background_images[%d].clip_user", bgpic_index);
+ }
+
+ return NULL;
+}
+
static bool rna_Camera_background_images_override_apply(Main *bmain,
PointerRNA *ptr_dst,
PointerRNA *ptr_src,
@@ -272,6 +290,7 @@ static void rna_def_camera_background_image(BlenderRNA *brna)
prop = RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
+ RNA_def_property_struct_type(prop, "ImageUser");
RNA_def_property_pointer_sdna(prop, NULL, "iuser");
RNA_def_property_ui_text(
prop,