From bdc029a193affd1672da340ae0a8287e8c299356 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Wed, 2 Nov 2011 15:58:56 +0000 Subject: Toolbar UI code: * More cleanup. --- .../scripts/startup/bl_ui/space_view3d_toolbar.py | 29 ++++++---------------- 1 file changed, 8 insertions(+), 21 deletions(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 9518ccb5f80..d8ef991e68f 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -481,12 +481,9 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel): col.template_ID_preview(settings, "brush", new="brush.add", rows=3, cols=8) # Particle Mode # - - # XXX This needs a check if psys is editable. if context.particle_edit_object: tool = settings.tool - # XXX Select Particle System layout.column().prop(settings, "tool", expand=True) if tool != 'NONE': @@ -825,13 +822,11 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel, Panel): if brush.use_anchor: col.separator() - row = col.row() - row.prop(brush, "use_edge_to_edge", "Edge To Edge") + col.prop(brush, "use_edge_to_edge", "Edge To Edge") if brush.use_airbrush: col.separator() - row = col.row() - row.prop(brush, "rate", text="Rate", slider=True) + col.prop(brush, "rate", text="Rate", slider=True) if brush.use_space: col.separator() @@ -857,8 +852,7 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel, Panel): row.prop(brush, "use_pressure_jitter", toggle=True, text="") else: - row = col.row() - row.prop(brush, "use_airbrush") + col.prop(brush, "use_airbrush") row = col.row() row.active = brush.use_airbrush and (not brush.use_space) and (not brush.use_anchor) @@ -867,8 +861,7 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel, Panel): col.separator() if not image_paint: - row = col.row() - row.prop(brush, "use_smooth_stroke") + col.prop(brush, "use_smooth_stroke") col = layout.column() col.active = brush.use_smooth_stroke @@ -879,9 +872,7 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel, Panel): col = layout.column() col.active = (not brush.use_anchor) and (brush.sculpt_tool not in {'GRAB', 'THUMB', 'ROTATE', 'SNAKE_HOOK'}) - - row = col.row() - row.prop(brush, "use_space") + col.prop(brush, "use_space") row = col.row() row.active = brush.use_space @@ -1011,14 +1002,10 @@ class VIEW3D_PT_tools_brush_appearance(PaintPanel, Panel): else: col.prop(brush, "cursor_color_add", text="Color") - col = layout.column() - col.label(text="Icon:") - - row = col.row(align=True) - row.prop(brush, "use_custom_icon") + col = layout.column(align=True) + col.prop(brush, "use_custom_icon") if brush.use_custom_icon: - row = col.row(align=True) - row.prop(brush, "icon_filepath", text="") + col.prop(brush, "icon_filepath", text="") # ********** default tools for weight-paint **************** -- cgit v1.2.3 From a59f7e02f8c8b2527e6a23e440ca61a9b9992373 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Wed, 2 Nov 2011 16:19:57 +0000 Subject: Projection Paint UI: * Code cleanup, much better to understand what is going on there now. * Stencil menu was mis aligned, fixed it for UI beauty. :) --- .../scripts/startup/bl_ui/space_view3d_toolbar.py | 59 ++++++++++------------ 1 file changed, 26 insertions(+), 33 deletions(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index d8ef991e68f..591191321ee 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -1120,53 +1120,46 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel, Panel): use_projection = ipaint.use_projection col = layout.column() - sub = col.column() - sub.active = use_projection - sub.prop(ipaint, "use_occlude") - sub.prop(ipaint, "use_backface_culling") + col.active = use_projection + col.prop(ipaint, "use_occlude") + col.prop(ipaint, "use_backface_culling") - split = layout.split() - - col = split.column() - col.active = (use_projection) - col.prop(ipaint, "use_normal_falloff") + row = layout.row() + row.active = (use_projection) + row.prop(ipaint, "use_normal_falloff") - col = split.column() - col.active = (ipaint.use_normal_falloff and use_projection) - col.prop(ipaint, "normal_angle", text="") + sub = row.row() + sub.active = (ipaint.use_normal_falloff) + sub.prop(ipaint, "normal_angle", text="") - col = layout.column(align=False) - row = col.row() - row.active = (use_projection) - row.prop(ipaint, "use_stencil_layer", text="Stencil") + split = layout.split() + + split.active = (use_projection) + split.prop(ipaint, "use_stencil_layer", text="Stencil") - row2 = row.row(align=False) - row2.active = (use_projection and ipaint.use_stencil_layer) - row2.menu("VIEW3D_MT_tools_projectpaint_stencil", text=mesh.uv_texture_stencil.name) - row2.prop(ipaint, "invert_stencil", text="", icon='IMAGE_ALPHA') + row = split.row() + row.active = (ipaint.use_stencil_layer) + row.menu("VIEW3D_MT_tools_projectpaint_stencil", text=mesh.uv_texture_stencil.name) + row.prop(ipaint, "invert_stencil", text="", icon='IMAGE_ALPHA') - col = layout.column() - sub = col.column() - row = sub.row() + row = layout.row() row.active = (settings.brush.image_tool == 'CLONE') - row.prop(ipaint, "use_clone_layer", text="Layer") row.menu("VIEW3D_MT_tools_projectpaint_clone", text=mesh.uv_texture_clone.name) - sub = col.column() - sub.prop(ipaint, "seam_bleed") - - col.label(text="External Editing") + layout.prop(ipaint, "seam_bleed") + + col = layout.column() + col.label(text="External Editing:") + row = col.split(align=True, percentage=0.55) row.operator("image.project_edit", text="Quick Edit") row.operator("image.project_apply", text="Apply") - row = col.row(align=True) - row.prop(ipaint, "screen_grab_size", text="") - sub = col.column() - sub.operator("paint.project_image", text="Apply Camera Image") + col.row().prop(ipaint, "screen_grab_size", text="") - sub.operator("image.save_dirty", text="Save All Edited") + col.operator("paint.project_image", text="Apply Camera Image") + col.operator("image.save_dirty", text="Save All Edited") class VIEW3D_PT_imagepaint_options(PaintPanel): -- cgit v1.2.3 From 30f1f28a8af3b393608b5869512a8823111294ad Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 2 Nov 2011 18:55:32 +0000 Subject: Nodes: add support for shader nodes on world and lamps, in addition to materials. The internal render engine does not support them, and they are not accesible in the UI yet, but cycles will use them. --- release/scripts/startup/bl_ui/space_node.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index 708017ba749..2b2cc505f1f 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -42,7 +42,7 @@ class NODE_HT_header(Header): layout.prop(snode, "tree_type", text="", expand=True) - if snode.tree_type == 'MATERIAL': + if snode.tree_type == 'SHADER': if id_from: layout.template_ID(id_from, "active_material", new="material.new") if snode_id: -- cgit v1.2.3 From ac52c79cb19ac85e06651a7b9af2e54efcd45a97 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 2 Nov 2011 19:24:30 +0000 Subject: RenderEngine/Nodes: system to check for shading nodes compatibility * Scene.use_shading_nodes property to check if RenderEngine is using new shading nodes system, and RenderEngine.bl_use_shading_nodes to set this. * Add mechanism for tagging nodes as being compatible with the old/new system. --- release/scripts/startup/bl_ui/space_node.py | 13 +++++++++---- release/scripts/startup/bl_ui/space_view3d.py | 9 +++++---- 2 files changed, 14 insertions(+), 8 deletions(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index 2b2cc505f1f..69766b54e97 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -27,6 +27,7 @@ class NODE_HT_header(Header): def draw(self, context): layout = self.layout + scene = context.scene snode = context.space_data snode_id = snode.id id_from = snode.id_from @@ -43,10 +44,14 @@ class NODE_HT_header(Header): layout.prop(snode, "tree_type", text="", expand=True) if snode.tree_type == 'SHADER': - if id_from: - layout.template_ID(id_from, "active_material", new="material.new") - if snode_id: - layout.prop(snode_id, "use_nodes") + if scene.render.use_shading_nodes: + layout.prop(snode, "shader_type", text="", expand=True) + + if not scene.render.use_shading_nodes or snode.shader_type == 'OBJECT': + if id_from: + layout.template_ID(id_from, "active_material", new="material.new") + if snode_id: + layout.prop(snode_id, "use_nodes") elif snode.tree_type == 'TEXTURE': layout.prop(snode, "texture_type", text="", expand=True) diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index dceab4a72e8..07c860fca31 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -2143,10 +2143,11 @@ class VIEW3D_PT_view3d_display(Panel): subsub.active = scene.unit_settings.system == 'NONE' subsub.prop(view, "grid_subdivisions", text="Subdivisions") - col = layout.column() - col.label(text="Shading:") - col.prop(gs, "material_mode", text="") - col.prop(view, "show_textured_solid") + if not scene.render.use_shading_nodes: + col = layout.column() + col.label(text="Shading:") + col.prop(gs, "material_mode", text="") + col.prop(view, "show_textured_solid") layout.separator() -- cgit v1.2.3 From 5eef9374362eb1089f08d4ab5f397843d2301d7a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 3 Nov 2011 09:13:47 +0000 Subject: modify previous api feature to tag functions as permanent, use nicer decorator style, eg: # -------- import bpy from bpy.app.handlers import persistent @persistent def my_func(scene): pass bpy.app.handlers.frame_change_pre.append(my_func) --- release/scripts/modules/bpy/__init__.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'release') diff --git a/release/scripts/modules/bpy/__init__.py b/release/scripts/modules/bpy/__init__.py index 5fe5cfd7cf4..75572a6294e 100644 --- a/release/scripts/modules/bpy/__init__.py +++ b/release/scripts/modules/bpy/__init__.py @@ -54,6 +54,8 @@ def main(): # fake module to allow: # from bpy.types import Panel + sys.modules["bpy.app"] = app + sys.modules["bpy.app.handlers"] = app.handlers sys.modules["bpy.types"] = types #~ if "-d" in sys.argv: # Enable this to measure start up speed -- cgit v1.2.3 From 0e51c9014c6a1cbdfe916edf79d1ca05d796e1fd Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 3 Nov 2011 12:47:39 +0000 Subject: patch [#27917] MARKER MENUS: Unification and adding "Duplicate Marker to Scene..." from Troy Sobotka (sobotka), with edits - remove Markers from Ctrl+L menu (was out of place here and was broken from recent changes to marker operators) - further de-duplicte scripts by having all menus call the same function: marker_menu_generic(). this fixes bug [#29083] too. --- release/scripts/startup/bl_ui/space_dopesheet.py | 14 ++------ release/scripts/startup/bl_ui/space_graph.py | 12 ++----- release/scripts/startup/bl_ui/space_nla.py | 12 ++----- release/scripts/startup/bl_ui/space_sequencer.py | 14 ++------ release/scripts/startup/bl_ui/space_time.py | 44 ++++++++++++++++++------ release/scripts/startup/bl_ui/space_view3d.py | 2 -- 6 files changed, 42 insertions(+), 56 deletions(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py index 90dcc99e6d7..106bbd85717 100644 --- a/release/scripts/startup/bl_ui/space_dopesheet.py +++ b/release/scripts/startup/bl_ui/space_dopesheet.py @@ -213,18 +213,10 @@ class DOPESHEET_MT_marker(Menu): def draw(self, context): layout = self.layout - st = context.space_data - - #layout.operator_context = 'EXEC_REGION_WIN' - - layout.operator("marker.add", "Add Marker") - layout.operator("marker.duplicate", text="Duplicate Marker") - layout.operator("marker.delete", text="Delete Marker") + from .space_time import marker_menu_generic + marker_menu_generic(layout) - layout.separator() - - layout.operator("marker.rename", text="Rename Marker") - layout.operator("marker.move", text="Grab/Move Marker") + st = context.space_data if st.mode in {'ACTION', 'SHAPEKEY'} and st.action: layout.separator() diff --git a/release/scripts/startup/bl_ui/space_graph.py b/release/scripts/startup/bl_ui/space_graph.py index d4b8c415a7f..b57d421dfaf 100644 --- a/release/scripts/startup/bl_ui/space_graph.py +++ b/release/scripts/startup/bl_ui/space_graph.py @@ -144,16 +144,8 @@ class GRAPH_MT_marker(Menu): def draw(self, context): layout = self.layout - #layout.operator_context = 'EXEC_REGION_WIN' - - layout.operator("marker.add", "Add Marker") - layout.operator("marker.duplicate", text="Duplicate Marker") - layout.operator("marker.delete", text="Delete Marker") - - layout.separator() - - layout.operator("marker.rename", text="Rename Marker") - layout.operator("marker.move", text="Grab/Move Marker") + from .space_time import marker_menu_generic + marker_menu_generic(layout) # TODO: pose markers for action edit mode only? diff --git a/release/scripts/startup/bl_ui/space_nla.py b/release/scripts/startup/bl_ui/space_nla.py index ffead81c507..c878c20c8a7 100644 --- a/release/scripts/startup/bl_ui/space_nla.py +++ b/release/scripts/startup/bl_ui/space_nla.py @@ -104,16 +104,8 @@ class NLA_MT_marker(Menu): def draw(self, context): layout = self.layout - #layout.operator_context = 'EXEC_REGION_WIN' - - layout.operator("marker.add", "Add Marker") - layout.operator("marker.duplicate", text="Duplicate Marker") - layout.operator("marker.delete", text="Delete Marker") - - layout.separator() - - layout.operator("marker.rename", text="Rename Marker") - layout.operator("marker.move", text="Grab/Move Marker") + from .space_time import marker_menu_generic + marker_menu_generic(layout) class NLA_MT_edit(Menu): diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index 2e957effccd..a4dcf64b679 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -158,18 +158,8 @@ class SEQUENCER_MT_marker(Menu): def draw(self, context): layout = self.layout - #layout.operator_context = 'EXEC_REGION_WIN' - - layout.operator("marker.add", "Add Marker") - layout.operator("marker.duplicate", text="Duplicate Marker") - layout.operator("marker.delete", text="Delete Marker") - - layout.separator() - - layout.operator("marker.rename", text="Rename Marker") - layout.operator("marker.move", text="Grab/Move Marker") - - #layout.operator("sequencer.sound_strip_add", text="Transform Markers") # toggle, will be rna - (sseq->flag & SEQ_MARKER_TRANS) + from .space_time import marker_menu_generic + marker_menu_generic(layout) class SEQUENCER_MT_change(Menu): diff --git a/release/scripts/startup/bl_ui/space_time.py b/release/scripts/startup/bl_ui/space_time.py index db009fe43c2..6f8e6a574ec 100644 --- a/release/scripts/startup/bl_ui/space_time.py +++ b/release/scripts/startup/bl_ui/space_time.py @@ -36,6 +36,7 @@ class TIME_HT_header(Header): if context.area.show_menus: row.menu("TIME_MT_view") + row.menu("TIME_MT_marker") row.menu("TIME_MT_frame") row.menu("TIME_MT_playback") @@ -91,6 +92,15 @@ class TIME_HT_header(Header): row.operator("anim.keyframe_delete", text="", icon='KEY_DEHLT') +class TIME_MT_marker(bpy.types.Menu): + bl_label = "Marker" + + def draw(self, context): + layout = self.layout + + marker_menu_generic(layout) + + class TIME_MT_view(Menu): bl_label = "View" @@ -142,17 +152,6 @@ class TIME_MT_frame(Menu): def draw(self, context): layout = self.layout - layout.operator("marker.add", text="Add Marker") - layout.operator("marker.duplicate", text="Duplicate Marker") - layout.operator("marker.delete", text="Delete Marker") - - layout.separator() - - layout.operator("marker.rename", text="Rename Marker") - layout.operator("marker.move", text="Grab/Move Marker") - - layout.separator() - layout.operator("time.start_frame_set") layout.operator("time.end_frame_set") @@ -197,5 +196,28 @@ class TIME_MT_autokey(Menu): layout.prop_enum(tools, "auto_keying_mode", 'ADD_REPLACE_KEYS') layout.prop_enum(tools, "auto_keying_mode", 'REPLACE_KEYS') + +def marker_menu_generic(layout): + + #layout.operator_context = 'EXEC_REGION_WIN' + + layout.column() + layout.operator("marker.add", "Add Marker") + layout.operator("marker.duplicate", text="Duplicate Marker") + + if(len(bpy.data.scenes) > 10): + layout.operator_context = 'INVOKE_DEFAULT' + layout.operator("marker.make_links_scene", text="Duplicate Marker to Scene...", icon='OUTLINER_OB_EMPTY') + else: + layout.operator_menu_enum("marker.make_links_scene", "scene", text="Duplicate Marker to Scene...") + + layout.operator("marker.delete", text="Delete Marker") + + layout.separator() + + layout.operator("marker.rename", text="Rename Marker") + layout.operator("marker.move", text="Grab/Move Marker") + + if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 07c860fca31..3f5b7b86e89 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -976,10 +976,8 @@ class VIEW3D_MT_make_links(Menu): if(len(bpy.data.scenes) > 10): layout.operator_context = 'INVOKE_DEFAULT' layout.operator("object.make_links_scene", text="Objects to Scene...", icon='OUTLINER_OB_EMPTY') - layout.operator("object.make_links_scene", text="Markers to Scene...", icon='OUTLINER_OB_EMPTY') else: layout.operator_menu_enum("object.make_links_scene", "scene", text="Objects to Scene...") - layout.operator_menu_enum("marker.make_links_scene", "scene", text="Markers to Scene...") layout.operator_enum("object.make_links_data", "type") # inline -- cgit v1.2.3 From 4ea816837de646af124ffc82758cae37950a0a51 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 4 Nov 2011 14:36:06 +0000 Subject: Configurable sensor size: - Added support of variable size sensor width and height. - Added presets for most common cameras, also new presets can be defined by user. - Added option to control which dimension (vertical or horizontal) of sensor size defines FOV. Old behavior of automatic FOV calculation is also kept. - Renderer, viewport, game engine and collada importer/exporter should deal fine with this changes. Other exporters would be updated soon. --- release/scripts/presets/camera/APS-C_DSLR.py | 4 ++ release/scripts/presets/camera/Blender.py | 4 ++ release/scripts/presets/camera/Canon_1100D.py | 4 ++ release/scripts/presets/camera/Canon_1D.py | 4 ++ release/scripts/presets/camera/Canon_1DS.py | 4 ++ release/scripts/presets/camera/Canon_500D.py | 4 ++ release/scripts/presets/camera/Canon_550D.py | 4 ++ release/scripts/presets/camera/Canon_5D.py | 4 ++ release/scripts/presets/camera/Canon_600D.py | 4 ++ release/scripts/presets/camera/Canon_60D.py | 4 ++ release/scripts/presets/camera/Canon_7D.py | 4 ++ release/scripts/presets/camera/Nikon_D300S.py | 4 ++ release/scripts/presets/camera/Nikon_D3100.py | 4 ++ release/scripts/presets/camera/Nikon_D35.py | 4 ++ release/scripts/presets/camera/Nikon_D5000.py | 4 ++ release/scripts/presets/camera/Nikon_D5100.py | 4 ++ release/scripts/presets/camera/Nikon_D7000.py | 4 ++ release/scripts/presets/camera/Nikon_D90.py | 4 ++ release/scripts/presets/camera/Red_Epic.py | 4 ++ release/scripts/presets/camera/Red_One_2K.py | 4 ++ release/scripts/presets/camera/Red_One_3K.py | 4 ++ release/scripts/presets/camera/Red_One_4K.py | 4 ++ .../scripts/presets/camera/full_frame_35mm_film.py | 4 ++ .../scripts/presets/camera/micro_four_thirds.py | 4 ++ release/scripts/presets/camera/super_16_film.py | 4 ++ release/scripts/presets/camera/super_35_film.py | 4 ++ release/scripts/startup/bl_operators/presets.py | 19 ++++++ .../startup/bl_ui/properties_data_camera.py | 71 +++++++++++++++++----- 28 files changed, 178 insertions(+), 16 deletions(-) create mode 100644 release/scripts/presets/camera/APS-C_DSLR.py create mode 100644 release/scripts/presets/camera/Blender.py create mode 100644 release/scripts/presets/camera/Canon_1100D.py create mode 100644 release/scripts/presets/camera/Canon_1D.py create mode 100644 release/scripts/presets/camera/Canon_1DS.py create mode 100644 release/scripts/presets/camera/Canon_500D.py create mode 100644 release/scripts/presets/camera/Canon_550D.py create mode 100644 release/scripts/presets/camera/Canon_5D.py create mode 100644 release/scripts/presets/camera/Canon_600D.py create mode 100644 release/scripts/presets/camera/Canon_60D.py create mode 100644 release/scripts/presets/camera/Canon_7D.py create mode 100644 release/scripts/presets/camera/Nikon_D300S.py create mode 100644 release/scripts/presets/camera/Nikon_D3100.py create mode 100644 release/scripts/presets/camera/Nikon_D35.py create mode 100644 release/scripts/presets/camera/Nikon_D5000.py create mode 100644 release/scripts/presets/camera/Nikon_D5100.py create mode 100644 release/scripts/presets/camera/Nikon_D7000.py create mode 100644 release/scripts/presets/camera/Nikon_D90.py create mode 100644 release/scripts/presets/camera/Red_Epic.py create mode 100644 release/scripts/presets/camera/Red_One_2K.py create mode 100644 release/scripts/presets/camera/Red_One_3K.py create mode 100644 release/scripts/presets/camera/Red_One_4K.py create mode 100644 release/scripts/presets/camera/full_frame_35mm_film.py create mode 100644 release/scripts/presets/camera/micro_four_thirds.py create mode 100644 release/scripts/presets/camera/super_16_film.py create mode 100644 release/scripts/presets/camera/super_35_film.py (limited to 'release') diff --git a/release/scripts/presets/camera/APS-C_DSLR.py b/release/scripts/presets/camera/APS-C_DSLR.py new file mode 100644 index 00000000000..829e03cc5cf --- /dev/null +++ b/release/scripts/presets/camera/APS-C_DSLR.py @@ -0,0 +1,4 @@ +import bpy +bpy.context.object.data.sensor_width = 22.3 +bpy.context.object.data.sensor_height = 14.9 +bpy.context.object.data.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Blender.py b/release/scripts/presets/camera/Blender.py new file mode 100644 index 00000000000..9fa4ab752e3 --- /dev/null +++ b/release/scripts/presets/camera/Blender.py @@ -0,0 +1,4 @@ +import bpy +bpy.context.object.data.sensor_width = 32 +bpy.context.object.data.sensor_height = 18 +bpy.context.object.data.sensor_fit = 'AUTO' diff --git a/release/scripts/presets/camera/Canon_1100D.py b/release/scripts/presets/camera/Canon_1100D.py new file mode 100644 index 00000000000..54f2cf75b54 --- /dev/null +++ b/release/scripts/presets/camera/Canon_1100D.py @@ -0,0 +1,4 @@ +import bpy +bpy.context.object.data.sensor_width = 22.2 +bpy.context.object.data.sensor_height = 14.7 +bpy.context.object.data.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Canon_1D.py b/release/scripts/presets/camera/Canon_1D.py new file mode 100644 index 00000000000..0bb0e910377 --- /dev/null +++ b/release/scripts/presets/camera/Canon_1D.py @@ -0,0 +1,4 @@ +import bpy +bpy.context.object.data.sensor_width = 27.9 +bpy.context.object.data.sensor_height = 18.6 +bpy.context.object.data.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Canon_1DS.py b/release/scripts/presets/camera/Canon_1DS.py new file mode 100644 index 00000000000..158a6235f32 --- /dev/null +++ b/release/scripts/presets/camera/Canon_1DS.py @@ -0,0 +1,4 @@ +import bpy +bpy.context.object.data.sensor_width = 36.0 +bpy.context.object.data.sensor_height = 24.0 +bpy.context.object.data.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Canon_500D.py b/release/scripts/presets/camera/Canon_500D.py new file mode 100644 index 00000000000..829e03cc5cf --- /dev/null +++ b/release/scripts/presets/camera/Canon_500D.py @@ -0,0 +1,4 @@ +import bpy +bpy.context.object.data.sensor_width = 22.3 +bpy.context.object.data.sensor_height = 14.9 +bpy.context.object.data.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Canon_550D.py b/release/scripts/presets/camera/Canon_550D.py new file mode 100644 index 00000000000..829e03cc5cf --- /dev/null +++ b/release/scripts/presets/camera/Canon_550D.py @@ -0,0 +1,4 @@ +import bpy +bpy.context.object.data.sensor_width = 22.3 +bpy.context.object.data.sensor_height = 14.9 +bpy.context.object.data.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Canon_5D.py b/release/scripts/presets/camera/Canon_5D.py new file mode 100644 index 00000000000..158a6235f32 --- /dev/null +++ b/release/scripts/presets/camera/Canon_5D.py @@ -0,0 +1,4 @@ +import bpy +bpy.context.object.data.sensor_width = 36.0 +bpy.context.object.data.sensor_height = 24.0 +bpy.context.object.data.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Canon_600D.py b/release/scripts/presets/camera/Canon_600D.py new file mode 100644 index 00000000000..829e03cc5cf --- /dev/null +++ b/release/scripts/presets/camera/Canon_600D.py @@ -0,0 +1,4 @@ +import bpy +bpy.context.object.data.sensor_width = 22.3 +bpy.context.object.data.sensor_height = 14.9 +bpy.context.object.data.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Canon_60D.py b/release/scripts/presets/camera/Canon_60D.py new file mode 100644 index 00000000000..829e03cc5cf --- /dev/null +++ b/release/scripts/presets/camera/Canon_60D.py @@ -0,0 +1,4 @@ +import bpy +bpy.context.object.data.sensor_width = 22.3 +bpy.context.object.data.sensor_height = 14.9 +bpy.context.object.data.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Canon_7D.py b/release/scripts/presets/camera/Canon_7D.py new file mode 100644 index 00000000000..829e03cc5cf --- /dev/null +++ b/release/scripts/presets/camera/Canon_7D.py @@ -0,0 +1,4 @@ +import bpy +bpy.context.object.data.sensor_width = 22.3 +bpy.context.object.data.sensor_height = 14.9 +bpy.context.object.data.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Nikon_D300S.py b/release/scripts/presets/camera/Nikon_D300S.py new file mode 100644 index 00000000000..a0505bf9b9c --- /dev/null +++ b/release/scripts/presets/camera/Nikon_D300S.py @@ -0,0 +1,4 @@ +import bpy +bpy.context.object.data.sensor_width = 23.6 +bpy.context.object.data.sensor_height = 15.8 +bpy.context.object.data.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Nikon_D3100.py b/release/scripts/presets/camera/Nikon_D3100.py new file mode 100644 index 00000000000..238d9c22d12 --- /dev/null +++ b/release/scripts/presets/camera/Nikon_D3100.py @@ -0,0 +1,4 @@ +import bpy +bpy.context.object.data.sensor_width = 23.1 +bpy.context.object.data.sensor_height = 15.4 +bpy.context.object.data.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Nikon_D35.py b/release/scripts/presets/camera/Nikon_D35.py new file mode 100644 index 00000000000..e6dc62dc100 --- /dev/null +++ b/release/scripts/presets/camera/Nikon_D35.py @@ -0,0 +1,4 @@ +import bpy +bpy.context.object.data.sensor_width = 36.0 +bpy.context.object.data.sensor_height = 23.9 +bpy.context.object.data.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Nikon_D5000.py b/release/scripts/presets/camera/Nikon_D5000.py new file mode 100644 index 00000000000..a0505bf9b9c --- /dev/null +++ b/release/scripts/presets/camera/Nikon_D5000.py @@ -0,0 +1,4 @@ +import bpy +bpy.context.object.data.sensor_width = 23.6 +bpy.context.object.data.sensor_height = 15.8 +bpy.context.object.data.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Nikon_D5100.py b/release/scripts/presets/camera/Nikon_D5100.py new file mode 100644 index 00000000000..1d819cce65b --- /dev/null +++ b/release/scripts/presets/camera/Nikon_D5100.py @@ -0,0 +1,4 @@ +import bpy +bpy.context.object.data.sensor_width = 23.6 +bpy.context.object.data.sensor_height = 15.6 +bpy.context.object.data.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Nikon_D7000.py b/release/scripts/presets/camera/Nikon_D7000.py new file mode 100644 index 00000000000..1d819cce65b --- /dev/null +++ b/release/scripts/presets/camera/Nikon_D7000.py @@ -0,0 +1,4 @@ +import bpy +bpy.context.object.data.sensor_width = 23.6 +bpy.context.object.data.sensor_height = 15.6 +bpy.context.object.data.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Nikon_D90.py b/release/scripts/presets/camera/Nikon_D90.py new file mode 100644 index 00000000000..a0505bf9b9c --- /dev/null +++ b/release/scripts/presets/camera/Nikon_D90.py @@ -0,0 +1,4 @@ +import bpy +bpy.context.object.data.sensor_width = 23.6 +bpy.context.object.data.sensor_height = 15.8 +bpy.context.object.data.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Red_Epic.py b/release/scripts/presets/camera/Red_Epic.py new file mode 100644 index 00000000000..14f4abaee90 --- /dev/null +++ b/release/scripts/presets/camera/Red_Epic.py @@ -0,0 +1,4 @@ +import bpy +bpy.context.object.data.sensor_width = 30.0 +bpy.context.object.data.sensor_height = 15.0 +bpy.context.object.data.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Red_One_2K.py b/release/scripts/presets/camera/Red_One_2K.py new file mode 100644 index 00000000000..ef2708f75b2 --- /dev/null +++ b/release/scripts/presets/camera/Red_One_2K.py @@ -0,0 +1,4 @@ +import bpy +bpy.context.object.data.sensor_width = 11.1 +bpy.context.object.data.sensor_height = 6.24 +bpy.context.object.data.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Red_One_3K.py b/release/scripts/presets/camera/Red_One_3K.py new file mode 100644 index 00000000000..5ddff2746eb --- /dev/null +++ b/release/scripts/presets/camera/Red_One_3K.py @@ -0,0 +1,4 @@ +import bpy +bpy.context.object.data.sensor_width = 16.65 +bpy.context.object.data.sensor_height = 9.36 +bpy.context.object.data.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Red_One_4K.py b/release/scripts/presets/camera/Red_One_4K.py new file mode 100644 index 00000000000..8ab9b38cbd5 --- /dev/null +++ b/release/scripts/presets/camera/Red_One_4K.py @@ -0,0 +1,4 @@ +import bpy +bpy.context.object.data.sensor_width = 22.2 +bpy.context.object.data.sensor_height = 12.6 +bpy.context.object.data.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/full_frame_35mm_film.py b/release/scripts/presets/camera/full_frame_35mm_film.py new file mode 100644 index 00000000000..d3e141ba4d9 --- /dev/null +++ b/release/scripts/presets/camera/full_frame_35mm_film.py @@ -0,0 +1,4 @@ +import bpy +bpy.context.object.data.sensor_width = 36 +bpy.context.object.data.sensor_height = 24 +bpy.context.object.data.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/micro_four_thirds.py b/release/scripts/presets/camera/micro_four_thirds.py new file mode 100644 index 00000000000..36fb0aac391 --- /dev/null +++ b/release/scripts/presets/camera/micro_four_thirds.py @@ -0,0 +1,4 @@ +import bpy +bpy.context.object.data.sensor_width = 17.3 +bpy.context.object.data.sensor_height = 13.0 +bpy.context.object.data.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/super_16_film.py b/release/scripts/presets/camera/super_16_film.py new file mode 100644 index 00000000000..1e42953bf05 --- /dev/null +++ b/release/scripts/presets/camera/super_16_film.py @@ -0,0 +1,4 @@ +import bpy +bpy.context.object.data.sensor_width = 12.52 +bpy.context.object.data.sensor_height = 7.41 +bpy.context.object.data.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/super_35_film.py b/release/scripts/presets/camera/super_35_film.py new file mode 100644 index 00000000000..65ccb0f216c --- /dev/null +++ b/release/scripts/presets/camera/super_35_film.py @@ -0,0 +1,4 @@ +import bpy +bpy.context.object.data.sensor_width = 24.89 +bpy.context.object.data.sensor_height = 18.66 +bpy.context.object.data.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py index 2e42105fbf0..21ac128f177 100644 --- a/release/scripts/startup/bl_operators/presets.py +++ b/release/scripts/startup/bl_operators/presets.py @@ -195,6 +195,25 @@ class AddPresetRender(AddPresetBase, Operator): preset_subdir = "render" +class AddPresetCamera(AddPresetBase, Operator): + '''Add a Camera Preset''' + bl_idname = "camera.preset_add" + bl_label = "Add Camera Preset" + preset_menu = "CAMERA_MT_presets" + + preset_defines = [ + "cam = bpy.context.object.data" + ] + + preset_values = [ + "cam.sensor_width", + "cam.sensor_height", + "cam.sensor_fit" + ] + + preset_subdir = "camera" + + class AddPresetSSS(AddPresetBase, Operator): '''Add a Subsurface Scattering Preset''' bl_idname = "material.sss_preset_add" diff --git a/release/scripts/startup/bl_ui/properties_data_camera.py b/release/scripts/startup/bl_ui/properties_data_camera.py index 5255af40951..4adaad75e42 100644 --- a/release/scripts/startup/bl_ui/properties_data_camera.py +++ b/release/scripts/startup/bl_ui/properties_data_camera.py @@ -33,6 +33,14 @@ class CameraButtonsPanel(): return context.camera and (engine in cls.COMPAT_ENGINES) +class CAMERA_MT_presets(bpy.types.Menu): + bl_label = "Camera Presets" + preset_subdir = "camera" + preset_operator = "script.execute_preset" + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + draw = bpy.types.Menu.draw_preset + + class DATA_PT_context_camera(CameraButtonsPanel, Panel): bl_label = "" bl_options = {'HIDE_HEADER'} @@ -54,7 +62,7 @@ class DATA_PT_context_camera(CameraButtonsPanel, Panel): split.separator() -class DATA_PT_camera(CameraButtonsPanel, Panel): +class DATA_PT_lens(CameraButtonsPanel, Panel): bl_label = "Lens" COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} @@ -69,12 +77,12 @@ class DATA_PT_camera(CameraButtonsPanel, Panel): col = split.column() if cam.type == 'PERSP': + row = col.row() if cam.lens_unit == 'MILLIMETERS': - col.prop(cam, "lens") + row.prop(cam, "lens") elif cam.lens_unit == 'DEGREES': - col.prop(cam, "angle") - col = split.column() - col.prop(cam, "lens_unit", text="") + row.prop(cam, "angle") + row.prop(cam, "lens_unit", text="") elif cam.type == 'ORTHO': col.prop(cam, "ortho_scale") @@ -90,26 +98,55 @@ class DATA_PT_camera(CameraButtonsPanel, Panel): split = layout.split() + col = split.column() + col.label(text="Depth of Field:") + + col.prop(cam, "dof_object", text="") + + col = col.column() + if cam.dof_object is not None: + col.enabled = False + col.prop(cam, "dof_distance", text="Distance") + col = split.column(align=True) col.label(text="Shift:") col.prop(cam, "shift_x", text="X") col.prop(cam, "shift_y", text="Y") - col = split.column(align=True) - col.label(text="Clipping:") - col.prop(cam, "clip_start", text="Start") - col.prop(cam, "clip_end", text="End") - layout.label(text="Depth of Field:") +class DATA_PT_camera(CameraButtonsPanel, Panel): + bl_label = "Camera" + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + + def draw(self, context): + layout = self.layout + + cam = context.camera + + row = layout.row(align=True) + + row.menu("CAMERA_MT_presets", text=bpy.types.CAMERA_MT_presets.bl_label) + row.operator("camera.preset_add", text="", icon="ZOOMIN") + row.operator("camera.preset_add", text="", icon="ZOOMOUT").remove_active = True + + layout.label(text="Sensor:") split = layout.split() - split.prop(cam, "dof_object", text="") - col = split.column() + col = split.column(align=True) + if cam.sensor_fit == 'AUTO': + col.prop(cam, "sensor_width", text="Size") + else: + col.prop(cam, "sensor_width", text="Width") + col.prop(cam, "sensor_height", text="Height") - if cam.dof_object is not None: - col.enabled = False - col.prop(cam, "dof_distance", text="Distance") + col = split.column(align=True) + col.prop(cam, "sensor_fit", text="") + + layout.label(text="Clipping:") + row = layout.row(align=True) + row.prop(cam, "clip_start", text="Start") + row.prop(cam, "clip_end", text="End") class DATA_PT_camera_display(CameraButtonsPanel, Panel): @@ -127,10 +164,12 @@ class DATA_PT_camera_display(CameraButtonsPanel, Panel): col.prop(cam, "show_limits", text="Limits") col.prop(cam, "show_mist", text="Mist") col.prop(cam, "show_title_safe", text="Title Safe") + col.prop(cam, "show_sensor", text="Sensor") col.prop(cam, "show_name", text="Name") - col.prop_menu_enum(cam, "show_guide") col = split.column() + col.prop_menu_enum(cam, "show_guide") + col.separator() col.prop(cam, "draw_size", text="Size") col.separator() col.prop(cam, "show_passepartout", text="Passepartout") -- cgit v1.2.3 From 209ceb6969cf2398aa38a7a292e64ef130d5e8db Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 4 Nov 2011 15:21:34 +0000 Subject: correct some warnings, also sensor_x was being paassed to object_camera_matrix(...) for x and y args, looks like an accident --- release/scripts/startup/bl_ui/properties_data_camera.py | 2 +- release/scripts/startup/bl_ui/space_view3d_toolbar.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/properties_data_camera.py b/release/scripts/startup/bl_ui/properties_data_camera.py index 4adaad75e42..4061a331261 100644 --- a/release/scripts/startup/bl_ui/properties_data_camera.py +++ b/release/scripts/startup/bl_ui/properties_data_camera.py @@ -142,7 +142,7 @@ class DATA_PT_camera(CameraButtonsPanel, Panel): col = split.column(align=True) col.prop(cam, "sensor_fit", text="") - + layout.label(text="Clipping:") row = layout.row(align=True) row.prop(cam, "clip_start", text="Start") diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 591191321ee..96201a4b960 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -1133,7 +1133,7 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel, Panel): sub.prop(ipaint, "normal_angle", text="") split = layout.split() - + split.active = (use_projection) split.prop(ipaint, "use_stencil_layer", text="Stencil") @@ -1148,10 +1148,10 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel, Panel): row.menu("VIEW3D_MT_tools_projectpaint_clone", text=mesh.uv_texture_clone.name) layout.prop(ipaint, "seam_bleed") - + col = layout.column() col.label(text="External Editing:") - + row = col.split(align=True, percentage=0.55) row.operator("image.project_edit", text="Quick Edit") row.operator("image.project_apply", text="Apply") -- cgit v1.2.3 From 7b47a4125fa4219a0f6c1a3e8c78047211caaa53 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 4 Nov 2011 18:10:50 +0000 Subject: Camera UI: tweaking panels, move clipping back because it's not part of the preset, and move depth of field settings to a separate panel. --- .../startup/bl_ui/properties_data_camera.py | 35 +++++++++++++--------- 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/properties_data_camera.py b/release/scripts/startup/bl_ui/properties_data_camera.py index 4061a331261..0abbf281754 100644 --- a/release/scripts/startup/bl_ui/properties_data_camera.py +++ b/release/scripts/startup/bl_ui/properties_data_camera.py @@ -98,21 +98,15 @@ class DATA_PT_lens(CameraButtonsPanel, Panel): split = layout.split() - col = split.column() - col.label(text="Depth of Field:") - - col.prop(cam, "dof_object", text="") - - col = col.column() - if cam.dof_object is not None: - col.enabled = False - col.prop(cam, "dof_distance", text="Distance") - col = split.column(align=True) col.label(text="Shift:") col.prop(cam, "shift_x", text="X") col.prop(cam, "shift_y", text="Y") + col = split.column(align=True) + col.label(text="Clipping:") + col.prop(cam, "clip_start", text="Start") + col.prop(cam, "clip_end", text="End") class DATA_PT_camera(CameraButtonsPanel, Panel): bl_label = "Camera" @@ -143,11 +137,24 @@ class DATA_PT_camera(CameraButtonsPanel, Panel): col = split.column(align=True) col.prop(cam, "sensor_fit", text="") - layout.label(text="Clipping:") - row = layout.row(align=True) - row.prop(cam, "clip_start", text="Start") - row.prop(cam, "clip_end", text="End") +class DATA_PT_camera_dof(CameraButtonsPanel, Panel): + bl_label = "Depth of Field" + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + def draw(self, context): + layout = self.layout + + cam = context.camera + + layout.label(text="Focus:") + + split = layout.split() + split.prop(cam, "dof_object", text="") + + col = split.column() + + col.active = cam.dof_object is None + col.prop(cam, "dof_distance", text="Distance") class DATA_PT_camera_display(CameraButtonsPanel, Panel): bl_label = "Display" -- cgit v1.2.3