diff options
Diffstat (limited to 'release/scripts')
22 files changed, 381 insertions, 78 deletions
diff --git a/release/scripts/modules/bpy_extras/image_utils.py b/release/scripts/modules/bpy_extras/image_utils.py index f45f9c6f225..551940b26e2 100644 --- a/release/scripts/modules/bpy_extras/image_utils.py +++ b/release/scripts/modules/bpy_extras/image_utils.py @@ -22,6 +22,7 @@ __all__ = ( "load_image", ) + # limited replacement for BPyImage.comprehensiveImageLoad def load_image(imagepath, dirname="", diff --git a/release/scripts/modules/bpy_extras/mesh_utils.py b/release/scripts/modules/bpy_extras/mesh_utils.py index b6d8a1fcf16..2062fe4485f 100644 --- a/release/scripts/modules/bpy_extras/mesh_utils.py +++ b/release/scripts/modules/bpy_extras/mesh_utils.py @@ -27,6 +27,7 @@ __all__ = ( "ngon_tesselate", ) + def mesh_linked_faces(mesh): """ Splits the mesh into connected faces, use this for seperating cubes from @@ -267,6 +268,7 @@ def ngon_tesselate(from_data, indices, fix_loops=True): fix_loops: If this is enabled polylines that use loops to make multiple polylines are delt with correctly. ''' + from mathutils.geometry import tesselate_polygon from mathutils import Vector vector_to_tuple = Vector.to_tuple diff --git a/release/scripts/modules/bpy_extras/view3d_utils.py b/release/scripts/modules/bpy_extras/view3d_utils.py index 45f537ebd2f..01ac543aec7 100644 --- a/release/scripts/modules/bpy_extras/view3d_utils.py +++ b/release/scripts/modules/bpy_extras/view3d_utils.py @@ -25,6 +25,7 @@ __all__ = ( "location_3d_to_region_2d", ) + def region_2d_to_vector_3d(region, rv3d, coord): """ Return a direction vector from the viewport at the spesific 2d region @@ -48,7 +49,7 @@ def region_2d_to_vector_3d(region, rv3d, coord): out = Vector(((2.0 * coord[0] / region.width) - 1.0, (2.0 * coord[1] / region.height) - 1.0, -0.5 - )) + )) w = (out[0] * persinv[0][3]) + \ (out[1] * persinv[1][3]) + \ @@ -114,6 +115,8 @@ def location_3d_to_region_2d(region, rv3d, coord): :return: 2d location :rtype: :class:`Vector` """ + from mathutils import Vector + prj = Vector((coord[0], coord[1], coord[2], 1.0)) * rv3d.perspective_matrix if prj.w > 0.0: width_half = region.width / 2.0 diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index 3c1b454e72e..eaa7563c757 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -20,7 +20,6 @@ from _bpy import types as bpy_types import _bpy -from mathutils import Vector StructRNA = bpy_types.Struct.__bases__[0] StructMetaPropGroup = _bpy.StructMetaPropGroup @@ -144,18 +143,21 @@ class _GenericBone: def x_axis(self): """ Vector pointing down the x-axis of the bone. """ + from mathutils import Vector return Vector((1.0, 0.0, 0.0)) * self.matrix.to_3x3() @property def y_axis(self): """ Vector pointing down the x-axis of the bone. """ + from mathutils import Vector return Vector((0.0, 1.0, 0.0)) * self.matrix.to_3x3() @property def z_axis(self): """ Vector pointing down the x-axis of the bone. """ + from mathutils import Vector return Vector((0.0, 0.0, 1.0)) * self.matrix.to_3x3() @property diff --git a/release/scripts/modules/console/intellisense.py b/release/scripts/modules/console/intellisense.py index 00f7dbd3657..072d467ff86 100644 --- a/release/scripts/modules/console/intellisense.py +++ b/release/scripts/modules/console/intellisense.py @@ -120,22 +120,25 @@ def expand(line, cursor, namespace, private=True): from . import complete_calltip matches, word, scrollback = complete_calltip.complete(line, cursor, namespace) + prefix = os.path.commonprefix(matches)[len(word):] no_calltip = False else: matches, word = complete(line, cursor, namespace, private) + prefix = os.path.commonprefix(matches)[len(word):] if len(matches) == 1: scrollback = '' else: # causes blender bug [#27495] since string keys may contain '.' # scrollback = ' '.join([m.split('.')[-1] for m in matches]) + word_prefix = word + prefix scrollback = ' '.join( - [m[len(word):] - if (word and m.startswith(word)) + [m[len(word_prefix):] + if (word_prefix and m.startswith(word_prefix)) else m.split('.')[-1] for m in matches]) no_calltip = True - prefix = os.path.commonprefix(matches)[len(word):] + if prefix: line = line[:cursor] + prefix + line[cursor:] cursor += len(prefix) diff --git a/release/scripts/modules/rna_prop_ui.py b/release/scripts/modules/rna_prop_ui.py index 9311987e2e7..b0fb3b66d0a 100644 --- a/release/scripts/modules/rna_prop_ui.py +++ b/release/scripts/modules/rna_prop_ui.py @@ -111,12 +111,16 @@ def draw(layout, context, context_member, property_type, use_edit=True): continue row = layout.row() - convert_to_pyobject = getattr(val, "convert_to_pyobject", None) + to_dict = getattr(val, "to_dict", None) + to_list = getattr(val, "to_list", None) val_orig = val - if convert_to_pyobject: - val_draw = val = val.convert_to_pyobject() - val_draw = str(val_draw) + if to_dict: + val = to_dict() + val_draw = str(val) + elif to_list: + val = to_list() + val_draw = str(val) else: val_draw = val @@ -131,7 +135,7 @@ def draw(layout, context, context_member, property_type, use_edit=True): row.label(text=key) # explicit exception for arrays - if convert_to_pyobject and not hasattr(val_orig, "len"): + if to_dict or to_list: row.label(text=val_draw) else: if key in rna_properties: diff --git a/release/scripts/startup/bl_operators/mesh.py b/release/scripts/startup/bl_operators/mesh.py index 89802d7ba5c..996b38ae571 100644 --- a/release/scripts/startup/bl_operators/mesh.py +++ b/release/scripts/startup/bl_operators/mesh.py @@ -152,7 +152,6 @@ class MeshMirrorUV(bpy.types.Operator): if j is not None: fmap[i] = j - done = [False] * len(faces) for i, j in fmap.items(): if not fuvsel[i] or not fuvsel[j]: @@ -170,10 +169,10 @@ class MeshMirrorUV(bpy.types.Operator): v1 = faces[j].vertices[:] v2 = [vmap[k] for k in faces[i].vertices[:]] - for k in range(len(uv1)): - k_map = v1.index(v2[k]) - uv1[k].x = - (uv2[k_map].x - 0.5) + 0.5 - uv1[k].y = uv2[k_map].y + if len(v1) == len(v2): + for k in range(len(v1)): + k_map = v1.index(v2[k]) + uv1[k].xy = - (uv2[k_map].x - 0.5) + 0.5, uv2[k_map].y if is_editmode: bpy.ops.object.mode_set(mode='EDIT', toggle=False) diff --git a/release/scripts/startup/bl_operators/nla.py b/release/scripts/startup/bl_operators/nla.py index 923ca92a162..469e9015e62 100644 --- a/release/scripts/startup/bl_operators/nla.py +++ b/release/scripts/startup/bl_operators/nla.py @@ -16,17 +16,16 @@ # # ##### END GPL LICENSE BLOCK ##### -# <pep8 compliant> +# <pep8-80 compliant> import bpy -def pose_info(): +def pose_frame_info(obj): from mathutils import Matrix info = {} - obj = bpy.context.object pose = obj.pose pose_items = pose.bones.items() @@ -51,7 +50,6 @@ def pose_info(): except: binfo["matrix_pose_inv"] = Matrix() - print(binfo["matrix_pose"]) info[name] = binfo for name, pbone in pose_items: @@ -67,45 +65,86 @@ def pose_info(): matrix = binfo_parent["matrix_pose_inv"] * matrix rest_matrix = binfo_parent["matrix_local_inv"] * rest_matrix - matrix = rest_matrix.inverted() * matrix + binfo["matrix_key"] = rest_matrix.inverted() * matrix + + return info - binfo["matrix_key"] = matrix.copy() +def obj_frame_info(obj): + info = {} + # parent = obj.parent + info["matrix_key"] = obj.matrix_local.copy() return info -def bake(frame_start, frame_end, step=1, only_selected=False): +def bake(frame_start, + frame_end, step=1, + only_selected=False, + do_pose=True, + do_object=True, + do_constraint_clear=False, + ): + scene = bpy.context.scene obj = bpy.context.object pose = obj.pose + frame_back = scene.frame_current + + if pose is None: + do_pose = False - info_ls = [] + if do_pose is None and do_object is None: + return None + + pose_info = [] + obj_info = [] frame_range = range(frame_start, frame_end + 1, step) - # could spped this up by applying steps here too... + # ------------------------------------------------------------------------- + # Collect transformations + + # could speed this up by applying steps here too... for f in frame_range: scene.frame_set(f) - info = pose_info() - info_ls.append(info) + if do_pose: + pose_info.append(pose_frame_info(obj)) + if do_object: + obj_info.append(obj_frame_info(obj)) + f += 1 + # ------------------------------------------------------------------------- + # Create action + + # incase animation data hassnt been created + atd = obj.animation_data_create() action = bpy.data.actions.new("Action") + atd.action = action - bpy.context.object.animation_data.action = action + if do_pose: + pose_items = pose.bones.items() + else: + pose_items = [] # skip - pose_items = pose.bones.items() + # ------------------------------------------------------------------------- + # Apply transformations to action - for name, pbone in pose_items: + # pose + for name, pbone in (pose_items if do_pose else ()): if only_selected and not pbone.bone.select: continue + if do_constraint_clear: + while pbone.constraints: + pbone.constraints.remove(pbone.constraints[0]) + for f in frame_range: - matrix = info_ls[int((f - frame_start) / step)][name]["matrix_key"] + matrix = pose_info[(f - frame_start) // step][name]["matrix_key"] - #pbone.location = matrix.to_translation() - #pbone.rotation_quaternion = matrix.to_quaternion() + # pbone.location = matrix.to_translation() + # pbone.rotation_quaternion = matrix.to_quaternion() pbone.matrix_basis = matrix pbone.keyframe_insert("location", -1, f, name) @@ -121,10 +160,35 @@ def bake(frame_start, frame_end, step=1, only_selected=False): pbone.keyframe_insert("scale", -1, f, name) + # object. TODO. multiple objects + if do_object: + if do_constraint_clear: + while obj.constraints: + obj.constraints.remove(obj.constraints[0]) + + for f in frame_range: + matrix = obj_info[(f - frame_start) // step]["matrix_key"] + obj.matrix_local = matrix + + obj.keyframe_insert("location", -1, f) + + rotation_mode = obj.rotation_mode + + if rotation_mode == 'QUATERNION': + obj.keyframe_insert("rotation_quaternion", -1, f) + elif rotation_mode == 'AXIS_ANGLE': + obj.keyframe_insert("rotation_axis_angle", -1, f) + else: # euler, XYZ, ZXY etc + obj.keyframe_insert("rotation_euler", -1, f) + + obj.keyframe_insert("scale", -1, f) + + scene.frame_set(frame_back) + return action -from bpy.props import IntProperty, BoolProperty +from bpy.props import IntProperty, BoolProperty, EnumProperty class BakeAction(bpy.types.Operator): @@ -144,10 +208,31 @@ class BakeAction(bpy.types.Operator): default=1, min=1, max=120) only_selected = BoolProperty(name="Only Selected", default=True) + clear_consraints = BoolProperty(name="Clear Constraints", + default=False) + bake_types = EnumProperty( + name="Bake Data", + options={'ENUM_FLAG'}, + items=(('POSE', "Pose", ""), + ('OBJECT', "Object", ""), + ), + default={'POSE'}, + ) def execute(self, context): - action = bake(self.frame_start, self.frame_end, self.step, self.only_selected) + action = bake(self.frame_start, + self.frame_end, + self.step, + self.only_selected, + 'POSE' in self.bake_types, + 'OBJECT' in self.bake_types, + self.clear_consraints, + ) + + if action is None: + self.report({'INFO'}, "Nothing to bake") + return {'CANCELLED'} # basic cleanup, could move elsewhere for fcu in action.fcurves: diff --git a/release/scripts/startup/bl_operators/object_align.py b/release/scripts/startup/bl_operators/object_align.py index 89b02fc98b0..889972da53c 100644 --- a/release/scripts/startup/bl_operators/object_align.py +++ b/release/scripts/startup/bl_operators/object_align.py @@ -22,6 +22,7 @@ import bpy from mathutils import Vector from blf import gettext as _ + def align_objects(align_x, align_y, align_z, align_mode, relative_to): cursor = bpy.context.scene.cursor_location diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py index 21640fa3ee6..a8bb3227b3c 100644 --- a/release/scripts/startup/bl_operators/object_quick_effects.py +++ b/release/scripts/startup/bl_operators/object_quick_effects.py @@ -23,9 +23,26 @@ import bpy from bpy.props import BoolProperty, EnumProperty, IntProperty, FloatProperty, FloatVectorProperty -class MakeFur(bpy.types.Operator): - bl_idname = "object.make_fur" - bl_label = "Make Fur" +def object_ensure_material(obj, mat_name): + """ Use an existing material or add a new one. + """ + mat = mat_slot = None + for mat_slot in obj.material_slots: + mat = mat_slot.material + if mat: + break + if mat is None: + mat = bpy.data.materials.new(mat_name) + if mat_slot: + mat_slot.material = mat + else: + obj.data.materials.append(mat) + return mat + + +class QuickFur(bpy.types.Operator): + bl_idname = "object.quick_fur" + bl_label = "Quick Fur" bl_options = {'REGISTER', 'UNDO'} density = EnumProperty(items=( @@ -80,9 +97,157 @@ class MakeFur(bpy.types.Operator): return {'FINISHED'} +class QuickExplode(bpy.types.Operator): + bl_idname = "object.quick_explode" + bl_label = "Quick Explode" + bl_options = {'REGISTER', 'UNDO'} + + style = EnumProperty(items=( + ('EXPLODE', "Explode", ""), + ('BLEND', "Blend", "")), + name="Explode Style", + description="", + default='EXPLODE') + + amount = IntProperty(name="Amount of pieces", + default=100, min=2, max=10000, soft_min=2, soft_max=10000) + + frame_duration = IntProperty(name="Duration", + default=50, min=1, max=300000, soft_min=1, soft_max=10000) + + frame_start = IntProperty(name="Start Frame", + default=1, min=1, max=300000, soft_min=1, soft_max=10000) + + frame_end = IntProperty(name="End Frame", + default=10, min=1, max=300000, soft_min=1, soft_max=10000) + + velocity = FloatProperty(name="Outwards Velocity", + default=1, min=0, max=300000, soft_min=0, soft_max=10) + + fade = BoolProperty(name="Fade", + description="Fade the pieces over time.", + default=True) + + def execute(self, context): + fake_context = bpy.context.copy() + obj_act = context.active_object + + if obj_act.type != 'MESH': + self.report({'ERROR'}, "Active object is not a mesh") + return {'CANCELLED'} + + mesh_objects = [obj for obj in context.selected_objects + if obj.type == 'MESH' and obj != obj_act] + mesh_objects.insert(0, obj_act) + + if self.style == 'BLEND' and len(mesh_objects) != 2: + self.report({'ERROR'}, "Select two mesh objects") + return {'CANCELLED'} + elif not mesh_objects: + self.report({'ERROR'}, "Select at least one mesh object") + return {'CANCELLED'} + + for obj in mesh_objects: + if obj.particle_systems: + self.report({'ERROR'}, "Object %r already has a particle system" % obj.name) + return {'CANCELLED'} + + if self.fade: + tex = bpy.data.textures.new("Explode fade", 'BLEND') + tex.use_color_ramp = True + + if self.style == 'BLEND': + tex.color_ramp.elements[0].position = 0.333 + tex.color_ramp.elements[1].position = 0.666 + + tex.color_ramp.elements[0].color[3] = 1.0 + tex.color_ramp.elements[1].color[3] = 0.0 + + if self.style == 'BLEND': + from_obj = mesh_objects[1] + to_obj = mesh_objects[0] + + for obj in mesh_objects: + fake_context["object"] = obj + bpy.ops.object.particle_system_add(fake_context) + + settings = obj.particle_systems[-1].settings + settings.count = self.amount + settings.frame_start = self.frame_start + settings.frame_end = self.frame_end - self.frame_duration + settings.lifetime = self.frame_duration + settings.normal_factor = self.velocity + settings.render_type = 'NONE' + + explode = obj.modifiers.new(name='Explode', type='EXPLODE') + explode.use_edge_cut = True + + if self.fade: + explode.show_dead = False + bpy.ops.mesh.uv_texture_add(fake_context) + uv = obj.data.uv_textures[-1] + uv.name = "Explode fade" + explode.particle_uv = uv.name + + mat = object_ensure_material(obj, "Explode Fade") + + mat.use_transparency = True + mat.use_transparent_shadows = True + mat.alpha = 0.0 + mat.specular_alpha = 0.0 + + tex_slot = mat.texture_slots.add() + + tex_slot.texture = tex + tex_slot.texture_coords = 'UV' + tex_slot.uv_layer = uv.name + + tex_slot.use_map_alpha = True + + if self.style == 'BLEND': + if obj == to_obj: + tex_slot.alpha_factor = -1.0 + elem = tex.color_ramp.elements[1] + elem.color = mat.diffuse_color + else: + elem = tex.color_ramp.elements[0] + elem.color = mat.diffuse_color + else: + tex_slot.use_map_color_diffuse = False + + if self.style == 'BLEND': + settings.physics_type = 'KEYED' + settings.use_emit_random = False + settings.rotation_mode = 'NOR' + + psys = obj.particle_systems[-1] + + fake_context["particle_system"] = obj.particle_systems[-1] + bpy.ops.particle.new_target(fake_context) + bpy.ops.particle.new_target(fake_context) + + if obj == from_obj: + psys.targets[1].object = to_obj + else: + psys.targets[0].object = from_obj + settings.normal_factor = -self.velocity + explode.show_unborn = False + explode.show_dead = True + else: + settings.factor_random = self.velocity + settings.angular_velocity_factor = self.velocity / 10.0 + + return {'FINISHED'} + + def invoke(self, context, event): + self.frame_start = context.scene.frame_current + self.frame_end = self.frame_start + self.frame_duration + return self.execute(context) + + def obj_bb_minmax(obj, min_co, max_co): for i in range(0, 8): - bb_vec = Vector((obj.bound_box[i][0], obj.bound_box[i][1], obj.bound_box[i][2])) * obj.matrix_world + bb_vec = Vector(obj.bound_box[i]) * obj.matrix_world min_co[0] = min(bb_vec[0], min_co[0]) min_co[1] = min(bb_vec[1], min_co[1]) @@ -92,9 +257,9 @@ def obj_bb_minmax(obj, min_co, max_co): max_co[2] = max(bb_vec[2], max_co[2]) -class MakeSmoke(bpy.types.Operator): - bl_idname = "object.make_smoke" - bl_label = "Make Smoke" +class QuickSmoke(bpy.types.Operator): + bl_idname = "object.quick_smoke" + bl_label = "Quick Smoke" bl_options = {'REGISTER', 'UNDO'} style = EnumProperty(items=( @@ -112,8 +277,8 @@ class MakeSmoke(bpy.types.Operator): def execute(self, context): fake_context = bpy.context.copy() mesh_objects = [obj for obj in context.selected_objects if obj.type == 'MESH'] - min_co = Vector((100000, 100000, 100000)) - max_co = Vector((-100000, -100000, -100000)) + min_co = Vector((100000.0, 100000.0, 100000.0)) + max_co = -min_co if not mesh_objects: self.report({'ERROR'}, "Select at least one mesh object.") @@ -201,9 +366,9 @@ class MakeSmoke(bpy.types.Operator): return {'FINISHED'} -class MakeFluid(bpy.types.Operator): - bl_idname = "object.make_fluid" - bl_label = "Make Fluid" +class QuickFluid(bpy.types.Operator): + bl_idname = "object.quick_fluid" + bl_label = "Quick Fluid" bl_options = {'REGISTER', 'UNDO'} style = EnumProperty(items=( diff --git a/release/scripts/startup/bl_operators/object_randomize_transform.py b/release/scripts/startup/bl_operators/object_randomize_transform.py index 68f97f63c73..d95a21cca81 100644 --- a/release/scripts/startup/bl_operators/object_randomize_transform.py +++ b/release/scripts/startup/bl_operators/object_randomize_transform.py @@ -21,6 +21,7 @@ import bpy from blf import gettext as _ + def randomize_selected(seed, delta, loc, rot, scale, scale_even): import random diff --git a/release/scripts/startup/bl_operators/uvcalc_smart_project.py b/release/scripts/startup/bl_operators/uvcalc_smart_project.py index 4f5b1d8b233..c70b9071985 100644 --- a/release/scripts/startup/bl_operators/uvcalc_smart_project.py +++ b/release/scripts/startup/bl_operators/uvcalc_smart_project.py @@ -16,7 +16,7 @@ # # ##### END GPL LICENSE BLOCK ##### -# <pep8 compliant> +# TODO <pep8 compliant> from mathutils import Matrix, Vector, geometry import bpy diff --git a/release/scripts/startup/bl_ui/properties_data_curve.py b/release/scripts/startup/bl_ui/properties_data_curve.py index 11a129377e8..00d8d08852e 100644 --- a/release/scripts/startup/bl_ui/properties_data_curve.py +++ b/release/scripts/startup/bl_ui/properties_data_curve.py @@ -113,13 +113,25 @@ class DATA_PT_shape_curve(CurveButtonsPanel, bpy.types.Panel): sub.prop(curve, "use_fill_back") col.prop(curve, "use_fill_deform", text="Fill Deformed") - col.label(text="Textures:") - col.prop(curve, "use_uv_as_generated") - col.prop(curve, "use_auto_texspace") - + +class DATA_PT_curve_texture_space(CurveButtonsPanel, bpy.types.Panel): + bl_label = "Texture Space" + bl_options = {'DEFAULT_CLOSED'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + + def draw(self, context): + layout = self.layout + + ob = context.object + curve = context.curve + + row = layout.row() + row.prop(curve, "use_auto_texspace") + row.prop(curve, "use_uv_as_generated") + row = layout.row() - row.column().prop(curve, "texspace_location") - row.column().prop(curve, "texspace_size") + row.column().prop(curve, "texspace_location", text="Location") + row.column().prop(curve, "texspace_size", text="Size") class DATA_PT_geometry_curve(CurveButtonsPanel, bpy.types.Panel): diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py index e2c88413177..8c966825aee 100644 --- a/release/scripts/startup/bl_ui/properties_data_mesh.py +++ b/release/scripts/startup/bl_ui/properties_data_mesh.py @@ -118,6 +118,7 @@ class DATA_PT_texture_space(MeshButtonsPanel, bpy.types.Panel): row.column().prop(mesh, "texspace_location", text="Location") row.column().prop(mesh, "texspace_size", text="Size") + class DATA_PT_vertex_groups(MeshButtonsPanel, bpy.types.Panel): bl_label = "Vertex Groups" COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} diff --git a/release/scripts/startup/bl_ui/properties_data_metaball.py b/release/scripts/startup/bl_ui/properties_data_metaball.py index c568d10b3b0..6dda99bc37f 100644 --- a/release/scripts/startup/bl_ui/properties_data_metaball.py +++ b/release/scripts/startup/bl_ui/properties_data_metaball.py @@ -70,10 +70,23 @@ class DATA_PT_metaball(DataButtonsPanel, bpy.types.Panel): layout.label(text="Update:") layout.prop(mball, "update_method", expand=True) - + + +class DATA_PT_mball_texture_space(DataButtonsPanel, bpy.types.Panel): + bl_label = "Texture Space" + bl_options = {'DEFAULT_CLOSED'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} + + def draw(self, context): + layout = self.layout + + mball = context.meta_ball + + layout.prop(mball, "use_auto_texspace") + row = layout.row() - row.column().prop(mball, "texspace_location") - row.column().prop(mball, "texspace_size") + row.column().prop(mball, "texspace_location", text="Location") + row.column().prop(mball, "texspace_size", text="Size") class DATA_PT_metaball_element(DataButtonsPanel, bpy.types.Panel): diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index 586675f2ca0..ce6d0990f05 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -485,7 +485,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel): if md.wrap_method == 'PROJECT': split = layout.split(percentage=0.25) - + col = split.column() col.label(text="Axis:") col.prop(md, "use_project_x") diff --git a/release/scripts/startup/bl_ui/properties_object_constraint.py b/release/scripts/startup/bl_ui/properties_object_constraint.py index 03823ad7345..5f79dd3127a 100644 --- a/release/scripts/startup/bl_ui/properties_object_constraint.py +++ b/release/scripts/startup/bl_ui/properties_object_constraint.py @@ -655,8 +655,8 @@ class ConstraintButtonsPanel(): row = col.row() row.label(text="Source to Destination Mapping:") - # note: chr(187) is the ASCII arrow ( >> ). Blender Text Editor can't - # open it. Thus we are using the hardcoded value instead. + # note: chr(187) is the ASCII arrow ( >> ). Blender Text Editor can't + # open it. Thus we are using the hardcoded value instead. row = col.row() row.prop(con, "map_to_x_from", expand=False, text="") row.label(text=" %s X" % chr(187)) diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py b/release/scripts/startup/bl_ui/properties_physics_fluid.py index 5da89d0090a..c7e3a9e7220 100644 --- a/release/scripts/startup/bl_ui/properties_physics_fluid.py +++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py @@ -257,6 +257,7 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel, bpy.types.Panel): col.prop(fluid, "slip_type", text="") if fluid.slip_type == 'PARTIALSLIP': col.prop(fluid, "partial_slip_factor", slider=True, text="Amount") + col.prop(fluid, "surface_noobs") col = split.column() col.label(text="Surface:") diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index 858c619d3c1..c477a2ff62b 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -42,7 +42,7 @@ class SEQUENCER_HT_header(bpy.types.Header): sub = row.row(align=True) sub.menu("SEQUENCER_MT_view") - if (st.view_type == 'SEQUENCER') or (st.view_type == 'SEQUENCER_PREVIEW'): + if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}: sub.menu("SEQUENCER_MT_select") sub.menu("SEQUENCER_MT_marker") sub.menu("SEQUENCER_MT_add") @@ -50,17 +50,17 @@ class SEQUENCER_HT_header(bpy.types.Header): layout.prop(st, "view_type", expand=True, text="") - if (st.view_type == 'PREVIEW') or (st.view_type == 'SEQUENCER_PREVIEW'): + if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}: layout.prop(st, "display_mode", expand=True, text="") - if (st.view_type == 'SEQUENCER'): + if st.view_type == 'SEQUENCER': row = layout.row(align=True) row.operator("sequencer.copy", text="", icon='COPYDOWN') row.operator("sequencer.paste", text="", icon='PASTEDOWN') layout.separator() layout.operator("sequencer.refresh_all") - elif (st.view_type == 'SEQUENCER_PREVIEW'): + elif st.view_type == 'SEQUENCER_PREVIEW': layout.separator() layout.operator("sequencer.refresh_all") layout.prop(st, "display_channel", text="Channel") @@ -101,9 +101,9 @@ class SEQUENCER_MT_view(bpy.types.Menu): layout.separator() - if (st.view_type == 'SEQUENCER') or (st.view_type == 'SEQUENCER_PREVIEW'): + if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}: layout.operator("sequencer.view_all", text='View all Sequences') - if (st.view_type == 'PREVIEW') or (st.view_type == 'SEQUENCER_PREVIEW'): + if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}: layout.operator_context = 'INVOKE_REGION_PREVIEW' layout.operator("sequencer.view_all_preview", text='Fit preview in window') layout.operator("sequencer.view_zoom_ratio", text='Show preview 1:1').ratio = 1.0 @@ -300,7 +300,7 @@ class SequencerButtonsPanel(): @staticmethod def has_sequencer(context): - return (context.space_data.view_type == 'SEQUENCER') or (context.space_data.view_type == 'SEQUENCER_PREVIEW') + return (context.space_data.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}) @classmethod def poll(cls, context): @@ -313,7 +313,7 @@ class SequencerButtonsPanel_Output(): @staticmethod def has_preview(context): - return (context.space_data.view_type == 'PREVIEW') or (context.space_data.view_type == 'SEQUENCER_PREVIEW') + return (context.space_data.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}) @classmethod def poll(cls, context): @@ -657,11 +657,17 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel, bpy.types.Panel): layout.template_ID(strip, "scene") + scene = strip.scene + if scene: + layout.prop(scene.render, "use_sequencer") + layout.label(text="Camera Override") layout.template_ID(strip, "scene_camera") - sce = strip.scene - layout.label(text="Original frame range: %d-%d (%d)" % (sce.frame_start, sce.frame_end, sce.frame_end - sce.frame_start + 1)) + if scene: + sta = scene.frame_start + end = scene.frame_end + layout.label(text="Original frame range: %d-%d (%d)" % (sta, end, end - sta + 1)) class SEQUENCER_PT_filter(SequencerButtonsPanel, bpy.types.Panel): diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index ed4f47860a3..a78a5ceba80 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -24,6 +24,7 @@ import addon_utils from bpy.props import StringProperty, BoolProperty, EnumProperty from blf import gettext as _ + def ui_items_general(col, context): """ General UI Theme Settings (User Interface) """ @@ -94,7 +95,7 @@ class USERPREF_HT_header(bpy.types.Header): layout.operator("wm.keyconfig_import") elif userpref.active_section == 'ADDONS': layout.operator("wm.addon_install") - layout.menu("USERPREF_MT_addons_dev_guides", text=_(" Addons Developer Guides"), icon='INFO') + layout.menu("USERPREF_MT_addons_dev_guides") elif userpref.active_section == 'THEMES': layout.operator("ui.reset_default_theme") @@ -438,6 +439,8 @@ class USERPREF_PT_system(bpy.types.Panel): col.label(text=_("OpenGL:")) col.prop(system, "gl_clip_alpha", slider=True) col.prop(system, "use_mipmaps") + col.label(text=_("Anisotropic Filtering")) + col.prop(system, "anisotropic_filter", text="") col.prop(system, "use_vertex_buffer_objects") #Anti-aliasing is disabled as it breaks broder/lasso select #col.prop(system, "use_antialiasing") @@ -847,17 +850,14 @@ class USERPREF_PT_input(bpy.types.Panel, InputKeyMapPanel): class USERPREF_MT_addons_dev_guides(bpy.types.Menu): - bl_label = _("Addons develoment guides") + bl_label = _("Develoment Guides") # menu to open webpages with addons development guides def draw(self, context): layout = self.layout - layout.operator('wm.url_open', text=_('API Concepts') - ).url = 'http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro' - layout.operator('wm.url_open', text=_('Addons guidelines') - ).url = 'http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Addons' - layout.operator('wm.url_open', text=_('How to share your addon') - ).url = 'http://wiki.blender.org/index.php/Dev:Py/Sharing' + layout.operator('wm.url_open', text=_('API Concepts'), icon='URL').url = 'http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro' + layout.operator('wm.url_open', text=_('Addon Guidelines'), icon='URL').url = 'http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Addons' + layout.operator('wm.url_open', text=_('How to share your addon'), icon='URL').url = 'http://wiki.blender.org/index.php/Dev:Py/Sharing' class USERPREF_PT_addons(bpy.types.Panel): @@ -890,7 +890,7 @@ class USERPREF_PT_addons(bpy.types.Panel): col = split.column() col.prop(context.window_manager, "addon_search", text="", icon='VIEWZOOM') col.label(text=_("Categories")) - col.prop(context.window_manager, "addon_filter", text="") # , expand=True, too slow with dynamic enum. + col.prop(context.window_manager, "addon_filter", expand=True) col.label(text=_("Supported Level")) col.prop(context.window_manager, "addon_support", expand=True) diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 76748e61640..6a518e15f95 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -20,6 +20,7 @@ import bpy from blf import gettext as _ + class VIEW3D_HT_header(bpy.types.Header): bl_space_type = 'VIEW_3D' @@ -98,6 +99,8 @@ class VIEW3D_HT_header(bpy.types.Header): row.prop(toolsettings, "use_snap_peel_object", text="") elif toolsettings.snap_element == 'FACE': row.prop(toolsettings, "use_snap_project", text="") + if toolsettings.use_snap_project and obj.mode == 'EDIT': + row.prop(toolsettings, "use_snap_project_self", text="") # OpenGL render row = layout.row(align=True) diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 5bb41942e7c..b02f7dd75c1 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -20,6 +20,7 @@ import bpy from blf import gettext as _ + class View3DPanel(): bl_space_type = 'VIEW_3D' bl_region_type = 'TOOLS' |