diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-10-06 13:25:33 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-10-06 13:25:33 +0300 |
commit | ea606a7847a316a82b365155f666b33e81ff4c2e (patch) | |
tree | d58158c83fd66000fbe9db0c45fa39b6fc02076e /release | |
parent | d7d32ad45217736c677edd22906d980d03aeb175 (diff) | |
parent | 3df139c53062a141403ea9d359715ca3635c243c (diff) |
Merge branch 'master' into blender28
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/modules/bl_previews_utils/bl_previews_render.py | 13 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d_toolbar.py | 50 |
2 files changed, 38 insertions, 25 deletions
diff --git a/release/scripts/modules/bl_previews_utils/bl_previews_render.py b/release/scripts/modules/bl_previews_utils/bl_previews_render.py index b4f0b8dd3b8..71208ef3485 100644 --- a/release/scripts/modules/bl_previews_utils/bl_previews_render.py +++ b/release/scripts/modules/bl_previews_utils/bl_previews_render.py @@ -278,7 +278,7 @@ def do_previews(do_objects, do_groups, do_scenes, do_data_intern): bbox[1].z = v.z def objects_bbox_calc(camera, objects, offset_matrix): - bbox = (Vector((1e9, 1e9, 1e9)), Vector((-1e9, -1e9, -1e9))) + bbox = (Vector((1e24, 1e24, 1e24)), Vector((-1e24, -1e24, -1e24))) for obname, libpath in objects: ob = bpy.data.objects[obname, libpath] object_bbox_merge(bbox, ob, camera, offset_matrix) @@ -305,6 +305,17 @@ def do_previews(do_objects, do_groups, do_scenes, do_data_intern): cos = objects_bbox_calc(camera, objects, offset_matrix) loc, ortho_scale = camera.camera_fit_coords(scene, cos) camera.location = loc + # Set camera clipping accordingly to computed bbox. + min_dist = 1e24 + max_dist = -1e24 + for co in zip(*(iter(cos),) * 3): + dist = (Vector(co) - loc).length + if dist < min_dist: + min_dist = dist + if dist > max_dist: + max_dist = dist + camera.data.clip_start = min_dist / 2 + camera.data.clip_end = max_dist * 2 if lamp: loc, ortho_scale = lamp.camera_fit_coords(scene, cos) lamp.location = loc diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 0f9dd117c14..5430b108642 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -1080,8 +1080,8 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel): # use_frontface col.separator() - row = col.row() - row.prop(brush, "use_frontface", text="Front Faces Only") + col.prop(brush, "use_frontface", text="Front Faces Only") + col.prop(brush, "use_projected") # direction col.separator() @@ -1131,12 +1131,22 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel): self.prop_unified_strength(row, context, brush, "strength", text="Strength") self.prop_unified_strength(row, context, brush, "use_pressure_strength") + col.separator() col.prop(brush, "vertex_tool", text="Blend") if brush.vertex_tool != 'SMEAR': col.prop(brush, "use_accumulate") col.separator() + col.prop(brush, "use_frontface", text="Front Faces Only") + row = col.row() + row.prop(brush, "use_frontface_falloff", text="Falloff Angle") + sub = row.row() + sub.active = brush.use_frontface_falloff + sub.prop(brush, "falloff_angle", text="") + + col.prop(brush, "use_projected") + col = layout.column() col.prop(toolsettings, "use_auto_normalize", text="Auto Normalize") col.prop(toolsettings, "use_multipaint", text="Multi-Paint") @@ -1162,15 +1172,23 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel): self.prop_unified_strength(row, context, brush, "strength", text="Strength") self.prop_unified_strength(row, context, brush, "use_pressure_strength") - # XXX - TODO - # row = col.row(align=True) - # row.prop(brush, "jitter", slider=True) - # row.prop(brush, "use_pressure_jitter", toggle=True, text="") col.separator() col.prop(brush, "vertex_tool", text="Blend") - col.prop(brush, "use_accumulate") col.prop(brush, "use_alpha") + if brush.vertex_tool != 'SMEAR': + col.prop(brush, "use_accumulate") + col.separator() + + col.prop(brush, "use_frontface", text="Front Faces Only") + row = col.row() + row.prop(brush, "use_frontface_falloff", text="Falloff Angle") + sub = row.row() + sub.active = brush.use_frontface_falloff + sub.prop(brush, "falloff_angle", text="") + + col.prop(brush, "use_projected") + col.separator() col.template_ID(settings, "palette", new="palette.new") @@ -1761,19 +1779,7 @@ class VIEW3D_PT_tools_weightpaint_options(Panel, View3DPaintPanel): wpaint = tool_settings.weight_paint col = layout.column() - col.label("Falloff:") - row = col.row() - row.prop(wpaint, "falloff_shape", expand=True) - row = col.row() - row.prop(wpaint, "use_backface_culling") - row = col.row() - row.prop(wpaint, "use_normal_falloff") - sub = row.row() - sub.active = (wpaint.use_normal_falloff) - sub.prop(wpaint, "normal_angle", text="") - col = layout.column() - row = col.row() - row.prop(wpaint, "use_group_restrict") + col.prop(wpaint, "use_group_restrict") obj = context.weight_paint_object if obj.type == 'MESH': @@ -1806,10 +1812,6 @@ class VIEW3D_PT_tools_vertexpaint(Panel, View3DPaintPanel): col = layout.column() col.label("Falloff:") row = col.row() - row.prop(vpaint, "falloff_shape", expand=True) - row = col.row() - row.prop(vpaint, "use_backface_culling") - row = col.row() row.prop(vpaint, "use_normal_falloff") sub = row.row() sub.active = (vpaint.use_normal_falloff) |