[Bf-blender-cvs] [ef96f36ee96] blender2.8: Move background images into the camera

Campbell Barton noreply at git.blender.org
Thu Oct 26 12:57:46 CEST 2017


Commit: ef96f36ee961e7f11556570da2b9cef0a08159f9
Author: Campbell Barton
Date:   Thu Oct 26 21:40:37 2017 +1100
Branches: blender2.8
https://developer.blender.org/rBef96f36ee961e7f11556570da2b9cef0a08159f9

Move background images into the camera

This moves background images out of the 3D viewport,
to be used only as camera reference images.

For 3D viewport references,
background images can be used, see: D2827

Some work is still needed
(background option isn't working at the moment).

===================================================================

M	release/scripts/startup/bl_ui/properties_data_camera.py
M	release/scripts/startup/bl_ui/space_view3d.py
M	source/blender/blenkernel/BKE_camera.h
M	source/blender/blenkernel/intern/camera.c
M	source/blender/blenkernel/intern/image.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/versioning_legacy.c
M	source/blender/blenloader/intern/writefile.c
M	source/blender/draw/intern/draw_manager.c
M	source/blender/editors/include/ED_screen.h
M	source/blender/editors/include/ED_view3d.h
M	source/blender/editors/screen/screen_ops.c
M	source/blender/editors/space_image/image_ops.c
M	source/blender/editors/space_view3d/space_view3d.c
M	source/blender/editors/space_view3d/view3d_draw_legacy.c
M	source/blender/editors/space_view3d/view3d_edit.c
M	source/blender/editors/space_view3d/view3d_intern.h
M	source/blender/makesdna/DNA_camera_types.h
M	source/blender/makesdna/DNA_view3d_types.h
M	source/blender/makesrna/intern/rna_camera.c
M	source/blender/makesrna/intern/rna_space.c
M	source/blender/windowmanager/intern/wm_draw.c
M	source/blenderplayer/bad_level_call_stubs/stubs.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_data_camera.py b/release/scripts/startup/bl_ui/properties_data_camera.py
index f77c0ff40e8..0d0fc96550d 100644
--- a/release/scripts/startup/bl_ui/properties_data_camera.py
+++ b/release/scripts/startup/bl_ui/properties_data_camera.py
@@ -255,6 +255,107 @@ class DATA_PT_camera_dof(CameraButtonsPanel, Panel):
                 col.prop(dof_options, "blades")
 
 
+class DATA_PT_camera_background_image(CameraButtonsPanel, Panel):
+    bl_label = "Background Images"
+    bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
+
+    def draw_header(self, context):
+        cam = context.camera
+
+        self.layout.prop(cam, "show_background_images", text="")
+
+    def draw(self, context):
+        layout = self.layout
+
+        cam = context.camera
+        use_multiview = context.scene.render.use_multiview
+
+        col = layout.column()
+        col.operator("view3d.background_image_add", text="Add Image")
+
+        for i, bg in enumerate(cam.background_images):
+            layout.active = cam.show_background_images
+            box = layout.box()
+            row = box.row(align=True)
+            row.prop(bg, "show_expanded", text="", emboss=False)
+            if bg.source == 'IMAGE' and bg.image:
+                row.prop(bg.image, "name", text="", emboss=False)
+            elif bg.source == 'MOVIE_CLIP' and bg.clip:
+                row.prop(bg.clip, "name", text="", emboss=False)
+            else:
+                row.label(text="Not Set")
+
+            if bg.show_background_image:
+                row.prop(bg, "show_background_image", text="", emboss=False, icon='RESTRICT_VIEW_OFF')
+            else:
+                row.prop(bg, "show_background_image", text="", emboss=False, icon='RESTRICT_VIEW_ON')
+
+            row.operator("view3d.background_image_remove", text="", emboss=False, icon='X').index = i
+
+            if bg.show_expanded:
+                row = box.row()
+                row.prop(bg, "source", expand=True)
+
+                has_bg = False
+                if bg.source == 'IMAGE':
+                    row = box.row()
+                    row.template_ID(bg, "image", open="image.open")
+                    if bg.image is not None:
+                        box.template_image(bg, "image", bg.image_user, compact=True)
+                        has_bg = True
+
+                        if use_multiview and bg.view_axis in {'CAMERA', 'ALL'}:
+                            box.prop(bg.image, "use_multiview")
+
+                            column = box.column()
+                            column.active = bg.image.use_multiview
+
+                            column.label(text="Views Format:")
+                            column.row().prop(bg.image, "views_format", expand=True)
+
+                            sub = column.box()
+                            sub.active = bg.image.views_format == 'STEREO_3D'
+                            sub.template_image_stereo_3d(bg.image.stereo_3d_format)
+
+                elif bg.source == 'MOVIE_CLIP':
+                    box.prop(bg, "use_camera_clip")
+
+                    column = box.column()
+                    column.active = not bg.use_camera_clip
+                    column.template_ID(bg, "clip", open="clip.open")
+
+                    if bg.clip:
+                        column.template_movieclip(bg, "clip", compact=True)
+
+                    if bg.use_camera_clip or bg.clip:
+                        has_bg = True
+
+                    column = box.column()
+                    column.active = has_bg
+                    column.prop(bg.clip_user, "proxy_render_size", text="")
+                    column.prop(bg.clip_user, "use_render_undistorted")
+
+                if has_bg:
+                    col = box.column()
+                    col.prop(bg, "alpha", slider=True)
+                    col.row().prop(bg, "draw_depth", expand=True)
+
+                    col.row().prop(bg, "frame_method", expand=True)
+
+                    box = col.box()
+                    row = box.row()
+                    row.prop(bg, "offset")
+
+                    row = box.row()
+                    row.prop(bg, "use_flip_x")
+                    row.prop(bg, "use_flip_y")
+
+                    row = box.row()
+                    row.prop(bg, "rotation")
+                    row.prop(bg, "scale")
+
+
 class DATA_PT_camera_display(CameraButtonsPanel, Panel):
     bl_label = "Display"
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME', 'BLENDER_CLAY', 'BLENDER_EEVEE'}
@@ -344,6 +445,7 @@ classes = (
     DATA_PT_camera_stereoscopy,
     DATA_PT_camera_dof,
     DATA_PT_camera_display,
+    DATA_PT_camera_background_image,
     DATA_PT_camera_safe_areas,
     DATA_PT_custom_props_camera,
 )
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index da1db6836c6..1604c878595 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -3711,113 +3711,6 @@ class VIEW3D_PT_view3d_curvedisplay(Panel):
         col.prop(context.scene.tool_settings, "normal_size", text="Normal Size")
 
 
-class VIEW3D_PT_background_image(Panel):
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'UI'
-    bl_label = "Background Images"
-    bl_options = {'DEFAULT_CLOSED'}
-
-    def draw_header(self, context):
-        view = context.space_data
-
-        self.layout.prop(view, "show_background_images", text="")
-
-    def draw(self, context):
-        layout = self.layout
-
-        view = context.space_data
-        use_multiview = context.scene.render.use_multiview
-
-        col = layout.column()
-        col.operator("view3d.background_image_add", text="Add Image")
-
-        for i, bg in enumerate(view.background_images):
-            layout.active = view.show_background_images
-            box = layout.box()
-            row = box.row(align=True)
-            row.prop(bg, "show_expanded", text="", emboss=False)
-            if bg.source == 'IMAGE' and bg.image:
-                row.prop(bg.image, "name", text="", emboss=False)
-            elif bg.source == 'MOVIE_CLIP' and bg.clip:
-                row.prop(bg.clip, "name", text="", emboss=False)
-            else:
-                row.label(text="Not Set")
-
-            if bg.show_background_image:
-                row.prop(bg, "show_background_image", text="", emboss=False, icon='RESTRICT_VIEW_OFF')
-            else:
-                row.prop(bg, "show_background_image", text="", emboss=False, icon='RESTRICT_VIEW_ON')
-
-            row.operator("view3d.background_image_remove", text="", emboss=False, icon='X').index = i
-
-            box.prop(bg, "view_axis", text="Axis")
-
-            if bg.show_expanded:
-                row = box.row()
-                row.prop(bg, "source", expand=True)
-
-                has_bg = False
-                if bg.source == 'IMAGE':
-                    row = box.row()
-                    row.template_ID(bg, "image", open="image.open")
-                    if bg.image is not None:
-                        box.template_image(bg, "image", bg.image_user, compact=True)
-                        has_bg = True
-
-                        if use_multiview and bg.view_axis in {'CAMERA', 'ALL'}:
-                            box.prop(bg.image, "use_multiview")
-
-                            column = box.column()
-                            column.active = bg.image.use_multiview
-
-                            column.label(text="Views Format:")
-                            column.row().prop(bg.image, "views_format", expand=True)
-
-                            sub = column.box()
-                            sub.active = bg.image.views_format == 'STEREO_3D'
-                            sub.template_image_stereo_3d(bg.image.stereo_3d_format)
-
-                elif bg.source == 'MOVIE_CLIP':
-                    box.prop(bg, "use_camera_clip")
-
-                    column = box.column()
-                    column.active = not bg.use_camera_clip
-                    column.template_ID(bg, "clip", open="clip.open")
-
-                    if bg.clip:
-                        column.template_movieclip(bg, "clip", compact=True)
-
-                    if bg.use_camera_clip or bg.clip:
-                        has_bg = True
-
-                    column = box.column()
-                    column.active = has_bg
-                    column.prop(bg.clip_user, "proxy_render_size", text="")
-                    column.prop(bg.clip_user, "use_render_undistorted")
-
-                if has_bg:
-                    col = box.column()
-                    col.prop(bg, "opacity", slider=True)
-                    col.row().prop(bg, "draw_depth", expand=True)
-
-                    if bg.view_axis in {'CAMERA', 'ALL'}:
-                        col.row().prop(bg, "frame_method", expand=True)
-
-                    box = col.box()
-                    row = box.row()
-                    row.prop(bg, "offset_x", text="X")
-                    row.prop(bg, "offset_y", text="Y")
-
-                    row = box.row()
-                    row.prop(bg, "use_flip_x")
-                    row.prop(bg, "use_flip_y")
-
-                    row = box.row()
-                    if bg.view_axis != 'CAMERA':
-                        row.prop(bg, "rotation")
-                        row.prop(bg, "size")
-
-
 class VIEW3D_PT_transform_orientations(Panel):
     bl_space_type = 'VIEW_3D'
     bl_region_type = 'UI'
@@ -4075,7 +3968,6 @@ classes = (
     VIEW3D_PT_view3d_meshdisplay,
     VIEW3D_PT_view3d_meshstatvis,
     VIEW3D_PT_view3d_curvedisplay,
-    VIEW3D_PT_background_image,
     VIEW3D_PT_transform_orientations,
     VIEW3D_PT_etch_a_ton,
     VIEW3D_PT_context_properties,
diff --git a/source/blender/blenkernel/BKE_camera.h b/source/blender/blenkernel/BKE_camera.h
index 2234cee0e0d..27264100f1b 100644
--- a/source/blender/blenkernel/BKE_camera.h
+++ b/source/blender/blenkernel/BKE_camera.h
@@ -148,6 +148,11 @@ float          BKE_camera_multiview_shift_x(struct RenderData *rd, struct Object
 void           BKE_camera_multivie

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list