diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2011-09-25 01:39:11 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2011-09-25 01:39:11 +0400 |
commit | c0c488d0b2cf1365c88241d98fcef19b54d2f4fe (patch) | |
tree | 38f3c8c272da55e63d27e947a3349e6797e66cc8 /release/scripts/startup/bl_operators | |
parent | 9c42afb1c02cafa21632bd2e19b47c012a230368 (diff) | |
parent | 1ddb64817dadf02d006a6db5ea4ad230484b5aca (diff) |
Merged changes in the trunk up to revision 40520.
Diffstat (limited to 'release/scripts/startup/bl_operators')
-rw-r--r-- | release/scripts/startup/bl_operators/__init__.py | 5 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/anim.py | 274 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/animsys_update.py | 699 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/console.py | 106 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/mesh.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/nla.py | 306 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/screen_play_rendered_anim.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/sequencer.py | 6 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/uvcalc_smart_project.py | 3 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/view3d.py | 77 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/wm.py | 741 |
11 files changed, 1195 insertions, 1026 deletions
diff --git a/release/scripts/startup/bl_operators/__init__.py b/release/scripts/startup/bl_operators/__init__.py index 53991526844..c1af1e8ab5e 100644 --- a/release/scripts/startup/bl_operators/__init__.py +++ b/release/scripts/startup/bl_operators/__init__.py @@ -24,11 +24,11 @@ if "bpy" in locals(): _reload(val) _modules = ( "add_mesh_torus", - "animsys_update", + "anim", + "console", "freestyle", "image", "mesh", - "nla", "object_align", "object", "object_randomize_transform", @@ -40,6 +40,7 @@ _modules = ( "uvcalc_lightmap", "uvcalc_smart_project", "vertexpaint_dirt", + "view3d", "wm", ) __import__(name=__name__, fromlist=_modules) diff --git a/release/scripts/startup/bl_operators/anim.py b/release/scripts/startup/bl_operators/anim.py new file mode 100644 index 00000000000..7d1f3b8f5f0 --- /dev/null +++ b/release/scripts/startup/bl_operators/anim.py @@ -0,0 +1,274 @@ +# ##### BEGIN GPL LICENSE BLOCK ##### +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ##### END GPL LICENSE BLOCK ##### + +# <pep8-80 compliant> + +if "bpy" in locals(): + import imp + if "anim_utils" in locals(): + imp.reload(anim_utils) + +import bpy +from bpy.types import Operator +from bpy.props import (IntProperty, + BoolProperty, + EnumProperty, + StringProperty, + ) + + +class ANIM_OT_keying_set_export(Operator): + "Export Keying Set to a python script" + bl_idname = "anim.keying_set_export" + bl_label = "Export Keying Set..." + + filepath = StringProperty( + name="File Path", + ) + filter_folder = BoolProperty( + name="Filter folders", + default=True, + options={'HIDDEN'}, + ) + filter_text = BoolProperty( + name="Filter text", + default=True, + options={'HIDDEN'}, + ) + filter_python = BoolProperty( + name="Filter python", + default=True, + options={'HIDDEN'}, + ) + + def execute(self, context): + if not self.filepath: + raise Exception("Filepath not set") + + f = open(self.filepath, "w") + if not f: + raise Exception("Could not open file") + + scene = context.scene + ks = scene.keying_sets.active + + f.write("# Keying Set: %s\n" % ks.name) + + f.write("import bpy\n\n") + # XXX, why not current scene? + f.write("scene= bpy.data.scenes[0]\n\n") + + # Add KeyingSet and set general settings + f.write("# Keying Set Level declarations\n") + f.write("ks= scene.keying_sets.new(name=\"%s\")\n" % ks.name) + + if not ks.is_path_absolute: + f.write("ks.is_path_absolute = False\n") + f.write("\n") + + f.write("ks.bl_options = %r\n" % ks.bl_options) + f.write("\n") + + # -------------------------------------------------------- + # generate and write set of lookups for id's used in paths + + # cache for syncing ID-blocks to bpy paths + shorthands + id_to_paths_cache = {} + + for ksp in ks.paths: + if ksp.id is None: + continue + if ksp.id in id_to_paths_cache: + continue + + """ + - idtype_list is used to get the list of id-datablocks from + bpy.data.* since this info isn't available elsewhere + - id.bl_rna.name gives a name suitable for UI, + with a capitalised first letter, but we need + the plural form that's all lower case + """ + + idtype_list = ksp.id.bl_rna.name.lower() + "s" + id_bpy_path = "bpy.data.%s[\"%s\"]" % (idtype_list, ksp.id.name) + + # shorthand ID for the ID-block (as used in the script) + short_id = "id_%d" % len(id_to_paths_cache) + + # store this in the cache now + id_to_paths_cache[ksp.id] = [short_id, id_bpy_path] + + f.write("# ID's that are commonly used\n") + for id_pair in id_to_paths_cache.values(): + f.write("%s = %s\n" % (id_pair[0], id_pair[1])) + f.write("\n") + + # write paths + f.write("# Path Definitions\n") + for ksp in ks.paths: + f.write("ksp = ks.paths.add(") + + # id-block + data_path + if ksp.id: + # find the relevant shorthand from the cache + id_bpy_path = id_to_paths_cache[ksp.id][0] + else: + id_bpy_path = "None" # XXX... + f.write("%s, '%s'" % (id_bpy_path, ksp.data_path)) + + # array index settings (if applicable) + if ksp.use_entire_array: + f.write(", index=-1") + else: + f.write(", index=%d" % ksp.array_index) + + # grouping settings (if applicable) + # NOTE: the current default is KEYINGSET, but if this changes, + # change this code too + if ksp.group_method == 'NAMED': + f.write(", group_method='%s', group_name=\"%s\"" % + (ksp.group_method, ksp.group)) + elif ksp.group_method != 'KEYINGSET': + f.write(", group_method='%s'" % ksp.group_method) + + # finish off + f.write(")\n") + + f.write("\n") + f.close() + + return {'FINISHED'} + + def invoke(self, context, event): + wm = context.window_manager + wm.fileselect_add(self) + return {'RUNNING_MODAL'} + + +class BakeAction(Operator): + """Bake animation to an Action""" + bl_idname = "nla.bake" + bl_label = "Bake Action" + bl_options = {'REGISTER', 'UNDO'} + + frame_start = IntProperty( + name="Start Frame", + description="Start frame for baking", + min=0, max=300000, + default=1, + ) + frame_end = IntProperty( + name="End Frame", + description="End frame for baking", + min=1, max=300000, + default=250, + ) + step = IntProperty( + name="Frame Step", + description="Frame Step", + min=1, max=120, + default=1, + ) + 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): + + from bpy_extras import anim_utils + + action = anim_utils.bake_action(self.frame_start, + self.frame_end, + self.step, + self.only_selected, + 'POSE' in self.bake_types, + 'OBJECT' in self.bake_types, + self.clear_consraints, + True, + ) + + if action is None: + self.report({'INFO'}, "Nothing to bake") + return {'CANCELLED'} + + return {'FINISHED'} + + def invoke(self, context, event): + wm = context.window_manager + return wm.invoke_props_dialog(self) + + +class ClearUselessActions(Operator): + """Mark actions with no F-Curves for deletion after save+reload of """ \ + """file preserving "action libraries""" + bl_idname = "anim.clear_useless_actions" + bl_label = "Clear Useless Actions" + bl_options = {'REGISTER', 'UNDO'} + + only_unused = BoolProperty(name="Only Unused", + description="Only unused (Fake User only) actions get considered", + default=True) + + @classmethod + def poll(cls, context): + return len(bpy.data.actions) != 0 + + def execute(self, context): + removed = 0 + + for action in bpy.data.actions: + # if only user is "fake" user... + if ((self.only_unused is False) or + (action.use_fake_user and action.users == 1)): + + # if it has F-Curves, then it's a "action library" + # (i.e. walk, wave, jump, etc.) + # and should be left alone as that's what fake users are for! + if not action.fcurves: + # mark action for deletion + action.user_clear() + removed += 1 + + self.report({'INFO'}, "Removed %d empty and/or fake-user only Actions" + % removed) + return {'FINISHED'} + + +class UpdateAnimData(Operator): + """Update data paths from 2.56 and previous versions, """ \ + """modifying data paths of drivers and fcurves""" + bl_idname = "anim.update_data_paths" + bl_label = "Update Animation Data" + + def execute(self, context): + import animsys_refactor + animsys_refactor.update_data_paths(animsys_refactor.data_2_56_to_2_59) + return {'FINISHED'} diff --git a/release/scripts/startup/bl_operators/animsys_update.py b/release/scripts/startup/bl_operators/animsys_update.py deleted file mode 100644 index 23b9cf13f07..00000000000 --- a/release/scripts/startup/bl_operators/animsys_update.py +++ /dev/null @@ -1,699 +0,0 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ##### END GPL LICENSE BLOCK ##### - -# <pep8 compliant> - -data_path_update = [ - ("ClothCollisionSettings", "min_distance", "distance_min"), - ("ClothCollisionSettings", "self_min_distance", "self_distance_min"), - ("ClothCollisionSettings", "enable_collision", "use_collision"), - ("ClothCollisionSettings", "enable_self_collision", "use_self_collision"), - ("ClothSettings", "pin_cloth", "use_pin_cloth"), - ("ClothSettings", "stiffness_scaling", "use_stiffness_scale"), - ("CollisionSettings", "random_damping", "damping_random"), - ("CollisionSettings", "random_friction", "friction_random"), - ("CollisionSettings", "inner_thickness", "thickness_inner"), - ("CollisionSettings", "outer_thickness", "thickness_outer"), - ("CollisionSettings", "kill_particles", "use_particle_kill"), - ("Constraint", "proxy_local", "is_proxy_local"), - ("ActionConstraint", "maximum", "max"), - ("ActionConstraint", "minimum", "min"), - ("FollowPathConstraint", "use_fixed_position", "use_fixed_location"), - ("KinematicConstraint", "chain_length", "chain_count"), - ("KinematicConstraint", "pos_lock_x", "lock_location_x"), - ("KinematicConstraint", "pos_lock_y", "lock_location_y"), - ("KinematicConstraint", "pos_lock_z", "lock_location_z"), - ("KinematicConstraint", "rot_lock_x", "lock_rotation_x"), - ("KinematicConstraint", "rot_lock_y", "lock_rotation_y"), - ("KinematicConstraint", "rot_lock_z", "lock_rotation_z"), - ("KinematicConstraint", "axis_reference", "reference_axis"), - ("KinematicConstraint", "use_position", "use_location"), - ("LimitLocationConstraint", "maximum_x", "max_x"), - ("LimitLocationConstraint", "maximum_y", "max_y"), - ("LimitLocationConstraint", "maximum_z", "max_z"), - ("LimitLocationConstraint", "minimum_x", "min_x"), - ("LimitLocationConstraint", "minimum_y", "min_y"), - ("LimitLocationConstraint", "minimum_z", "min_z"), - ("LimitLocationConstraint", "use_maximum_x", "use_max_x"), - ("LimitLocationConstraint", "use_maximum_y", "use_max_y"), - ("LimitLocationConstraint", "use_maximum_z", "use_max_z"), - ("LimitLocationConstraint", "use_minimum_x", "use_min_x"), - ("LimitLocationConstraint", "use_minimum_y", "use_min_y"), - ("LimitLocationConstraint", "use_minimum_z", "use_min_z"), - ("LimitLocationConstraint", "limit_transform", "use_transform_limit"), - ("LimitRotationConstraint", "maximum_x", "max_x"), - ("LimitRotationConstraint", "maximum_y", "max_y"), - ("LimitRotationConstraint", "maximum_z", "max_z"), - ("LimitRotationConstraint", "minimum_x", "min_x"), - ("LimitRotationConstraint", "minimum_y", "min_y"), - ("LimitRotationConstraint", "minimum_z", "min_z"), - ("LimitRotationConstraint", "limit_transform", "use_transform_limit"), - ("LimitScaleConstraint", "maximum_x", "max_x"), - ("LimitScaleConstraint", "maximum_y", "max_y"), - ("LimitScaleConstraint", "maximum_z", "max_z"), - ("LimitScaleConstraint", "minimum_x", "min_x"), - ("LimitScaleConstraint", "minimum_y", "min_y"), - ("LimitScaleConstraint", "minimum_z", "min_z"), - ("LimitScaleConstraint", "use_maximum_x", "use_max_x"), - ("LimitScaleConstraint", "use_maximum_y", "use_max_y"), - ("LimitScaleConstraint", "use_maximum_z", "use_max_z"), - ("LimitScaleConstraint", "use_minimum_x", "use_min_x"), - ("LimitScaleConstraint", "use_minimum_y", "use_min_y"), - ("LimitScaleConstraint", "use_minimum_z", "use_min_z"), - ("LimitScaleConstraint", "limit_transform", "use_transform_limit"), - ("PivotConstraint", "enabled_rotation_range", "rotation_range"), - ("PivotConstraint", "use_relative_position", "use_relative_location"), - ("PythonConstraint", "number_of_targets", "target_count"), - ("SplineIKConstraint", "chain_length", "chain_count"), - ("SplineIKConstraint", "chain_offset", "use_chain_offset"), - ("SplineIKConstraint", "even_divisions", "use_even_divisions"), - ("SplineIKConstraint", "y_stretch", "use_y_stretch"), - ("SplineIKConstraint", "xz_scaling_mode", "xz_scale_mode"), - ("StretchToConstraint", "original_length", "rest_length"), - ("TrackToConstraint", "target_z", "use_target_z"), - ("TransformConstraint", "extrapolate_motion", "use_motion_extrapolate"), - ("FieldSettings", "do_location", "apply_to_location"), - ("FieldSettings", "do_rotation", "apply_to_rotation"), - ("FieldSettings", "maximum_distance", "distance_max"), - ("FieldSettings", "minimum_distance", "distance_min"), - ("FieldSettings", "radial_maximum", "radial_max"), - ("FieldSettings", "radial_minimum", "radial_min"), - ("FieldSettings", "force_2d", "use_2d_force"), - ("FieldSettings", "do_absorption", "use_absorption"), - ("FieldSettings", "global_coordinates", "use_global_coords"), - ("FieldSettings", "guide_path_add", "use_guide_path_add"), - ("FieldSettings", "multiple_springs", "use_multiple_springs"), - ("FieldSettings", "use_coordinates", "use_object_coords"), - ("FieldSettings", "root_coordinates", "use_root_coords"), - ("ControlFluidSettings", "reverse_frames", "use_reverse_frames"), - ("DomainFluidSettings", "real_world_size", "simulation_scale"), - ("DomainFluidSettings", "surface_smoothing", "surface_smooth"), - ("DomainFluidSettings", "reverse_frames", "use_reverse_frames"), - ("DomainFluidSettings", "generate_speed_vectors", "use_speed_vectors"), - ("DomainFluidSettings", "override_time", "use_time_override"), - ("FluidFluidSettings", "export_animated_mesh", "use_animated_mesh"), - ("InflowFluidSettings", "export_animated_mesh", "use_animated_mesh"), - ("InflowFluidSettings", "local_coordinates", "use_local_coords"), - ("ObstacleFluidSettings", "export_animated_mesh", "use_animated_mesh"), - ("OutflowFluidSettings", "export_animated_mesh", "use_animated_mesh"), - ("ParticleFluidSettings", "drops", "use_drops"), - ("ParticleFluidSettings", "floats", "use_floats"), - ("Armature", "drawtype", "draw_type"), - ("Armature", "layer_protection", "layers_protected"), - ("Armature", "auto_ik", "use_auto_ik"), - ("Armature", "delay_deform", "use_deform_delay"), - ("Armature", "deform_envelope", "use_deform_envelopes"), - ("Armature", "deform_quaternion", "use_deform_preserve_volume"), - ("Armature", "deform_vertexgroups", "use_deform_vertex_groups"), - ("Armature", "x_axis_mirror", "use_mirror_x"), - ("Curve", "width", "offset"), - ("Image", "animation_speed", "fps"), - ("Image", "animation_end", "frame_end"), - ("Image", "animation_start", "frame_start"), - ("Image", "animated", "use_animation"), - ("Image", "clamp_x", "use_clamp_x"), - ("Image", "clamp_y", "use_clamp_y"), - ("Image", "premultiply", "use_premultiply"), - ("AreaLamp", "shadow_ray_sampling_method", "shadow_ray_sample_method"), - ("AreaLamp", "only_shadow", "use_only_shadow"), - ("AreaLamp", "shadow_layer", "use_shadow_layer"), - ("AreaLamp", "umbra", "use_umbra"), - ("PointLamp", "shadow_ray_sampling_method", "shadow_ray_sample_method"), - ("PointLamp", "only_shadow", "use_only_shadow"), - ("PointLamp", "shadow_layer", "use_shadow_layer"), - ("PointLamp", "sphere", "use_sphere"), - ("SpotLamp", "shadow_ray_sampling_method", "shadow_ray_sample_method"), - ("SpotLamp", "auto_clip_end", "use_auto_clip_end"), - ("SpotLamp", "auto_clip_start", "use_auto_clip_start"), - ("SpotLamp", "only_shadow", "use_only_shadow"), - ("SpotLamp", "shadow_layer", "use_shadow_layer"), - ("SpotLamp", "sphere", "use_sphere"), - ("SunLamp", "only_shadow", "use_only_shadow"), - ("SunLamp", "shadow_layer", "use_shadow_layer"), - ("Material", "z_offset", "offset_z"), - ("Material", "shadow_casting_alpha", "shadow_cast_alpha"), - ("Material", "cast_approximate", "use_cast_approximate"), - ("Material", "cast_buffer_shadows", "use_cast_buffer_shadows"), - ("Material", "cast_shadows_only", "use_cast_shadows_only"), - ("Material", "face_texture", "use_face_texture"), - ("Material", "face_texture_alpha", "use_face_texture_alpha"), - ("Material", "full_oversampling", "use_full_oversampling"), - ("Material", "light_group_exclusive", "use_light_group_exclusive"), - ("Material", "object_color", "use_object_color"), - ("Material", "only_shadow", "use_only_shadow"), - ("Material", "ray_shadow_bias", "use_ray_shadow_bias"), - ("Material", "traceable", "use_raytrace"), - ("Material", "shadeless", "use_shadeless"), - ("Material", "tangent_shading", "use_tangent_shading"), - ("Material", "transparency", "use_transparency"), - ("Material", "receive_transparent_shadows", "use_transparent_shadows"), - ("Material", "vertex_color_light", "use_vertex_color_light"), - ("Material", "vertex_color_paint", "use_vertex_color_paint"), - ("Mesh", "autosmooth_angle", "auto_smooth_angle"), - ("Mesh", "autosmooth", "use_auto_smooth"), - ("Object", "max_draw_type", "draw_type"), - ("Object", "use_dupli_verts_rotation", "use_dupli_vertices_rotation"), - ("Object", "shape_key_edit_mode", "use_shape_key_edit_mode"), - ("Object", "slow_parent", "use_slow_parent"), - ("Object", "time_offset_add_parent", "use_time_offset_add_parent"), - ("Object", "time_offset_edit", "use_time_offset_edit"), - ("Object", "time_offset_parent", "use_time_offset_parent"), - ("Object", "time_offset_particle", "use_time_offset_particle"), - ("ParticleSettings", "adaptive_pix", "adaptive_pixel"), - ("ParticleSettings", "child_effector", "apply_effector_to_children"), - ("ParticleSettings", "child_guide", "apply_guide_to_children"), - ("ParticleSettings", "billboard_split_offset", "billboard_offset_split"), - ("ParticleSettings", "billboard_random_tilt", "billboard_tilt_random"), - ("ParticleSettings", "child_length_thres", "child_length_threshold"), - ("ParticleSettings", "child_random_size", "child_size_random"), - ("ParticleSettings", "clumppow", "clump_shape"), - ("ParticleSettings", "damp_factor", "damping"), - ("ParticleSettings", "draw_as", "draw_method"), - ("ParticleSettings", "random_factor", "factor_random"), - ("ParticleSettings", "grid_invert", "invert_grid"), - ("ParticleSettings", "random_length", "length_random"), - ("ParticleSettings", "random_lifetime", "lifetime_random"), - ("ParticleSettings", "billboard_lock", "lock_billboard"), - ("ParticleSettings", "boids_2d", "lock_boids_to_surface"), - ("ParticleSettings", "object_aligned_factor", "object_align_factor"), - ("ParticleSettings", "random_phase_factor", "phase_factor_random"), - ("ParticleSettings", "ren_as", "render_type"), - ("ParticleSettings", "rendered_child_nbr", "rendered_child_count"), - ("ParticleSettings", "random_rotation_factor", "rotation_factor_random"), - ("ParticleSettings", "rough1", "roughness_1"), - ("ParticleSettings", "rough1_size", "roughness_1_size"), - ("ParticleSettings", "rough2", "roughness_2"), - ("ParticleSettings", "rough2_size", "roughness_2_size"), - ("ParticleSettings", "rough2_thres", "roughness_2_threshold"), - ("ParticleSettings", "rough_end_shape", "roughness_end_shape"), - ("ParticleSettings", "rough_endpoint", "roughness_endpoint"), - ("ParticleSettings", "random_size", "size_random"), - ("ParticleSettings", "abs_path_time", "use_absolute_path_time"), - ("ParticleSettings", "animate_branching", "use_animate_branching"), - ("ParticleSettings", "branching", "use_branching"), - ("ParticleSettings", "died", "use_dead"), - ("ParticleSettings", "die_on_collision", "use_die_on_collision"), - ("ParticleSettings", "rotation_dynamic", "use_dynamic_rotation"), - ("ParticleSettings", "even_distribution", "use_even_distribution"), - ("ParticleSettings", "rand_group", "use_group_pick_random"), - ("ParticleSettings", "hair_bspline", "use_hair_bspline"), - ("ParticleSettings", "sizemass", "use_multiply_size_mass"), - ("ParticleSettings", "react_multiple", "use_react_multiple"), - ("ParticleSettings", "react_start_end", "use_react_start_end"), - ("ParticleSettings", "render_adaptive", "use_render_adaptive"), - ("ParticleSettings", "self_effect", "use_self_effect"), - ("ParticleSettings", "enable_simplify", "use_simplify"), - ("ParticleSettings", "size_deflect", "use_size_deflect"), - ("ParticleSettings", "render_strand", "use_strand_primitive"), - ("ParticleSettings", "symmetric_branching", "use_symmetric_branching"), - ("ParticleSettings", "velocity_length", "use_velocity_length"), - ("ParticleSettings", "whole_group", "use_whole_group"), - ("CloudsTexture", "noise_size", "noise_scale"), - ("DistortedNoiseTexture", "noise_size", "noise_scale"), - ("EnvironmentMapTexture", "filter_size_minimum", "use_filter_size_min"), - ("EnvironmentMapTexture", "mipmap_gauss", "use_mipmap_gauss"), - ("ImageTexture", "calculate_alpha", "use_calculate_alpha"), - ("ImageTexture", "checker_even", "use_checker_even"), - ("ImageTexture", "checker_odd", "use_checker_odd"), - ("ImageTexture", "filter_size_minimum", "use_filter_size_min"), - ("ImageTexture", "flip_axis", "use_flip_axis"), - ("ImageTexture", "mipmap_gauss", "use_mipmap_gauss"), - ("ImageTexture", "mirror_x", "use_mirror_x"), - ("ImageTexture", "mirror_y", "use_mirror_y"), - ("ImageTexture", "normal_map", "use_normal_map"), - ("MarbleTexture", "noise_size", "noise_scale"), - ("MarbleTexture", "noisebasis2", "noise_basis_2"), - ("MarbleTexture", "noisebasis_2", "noise_basis_2"), - ("MusgraveTexture", "highest_dimension", "dimension_max"), - ("MusgraveTexture", "noise_size", "noise_scale"), - ("StucciTexture", "noise_size", "noise_scale"), - ("VoronoiTexture", "coloring", "color_mode"), - ("VoronoiTexture", "noise_size", "noise_scale"), - ("WoodTexture", "noise_size", "noise_scale"), - ("WoodTexture", "noisebasis2", "noise_basis_2"), - ("WoodTexture", "noisebasis_2", "noise_basis_2"), - ("World", "blend_sky", "use_sky_blend"), - ("World", "paper_sky", "use_sky_paper"), - ("World", "real_sky", "use_sky_real"), - ("ImageUser", "auto_refresh", "use_auto_refresh"), - ("MaterialHalo", "flares_sub", "flare_subflare_count"), - ("MaterialHalo", "flare_subsize", "flare_subflare_size"), - ("MaterialHalo", "line_number", "line_count"), - ("MaterialHalo", "rings", "ring_count"), - ("MaterialHalo", "star_tips", "star_tip_count"), - ("MaterialHalo", "xalpha", "use_extreme_alpha"), - ("MaterialHalo", "flare_mode", "use_flare_mode"), - ("MaterialHalo", "vertex_normal", "use_vertex_normal"), - ("MaterialPhysics", "align_to_normal", "use_normal_align"), - ("MaterialStrand", "min_size", "size_min"), - ("MaterialStrand", "blender_units", "use_blender_units"), - ("MaterialStrand", "surface_diffuse", "use_surface_diffuse"), - ("MaterialStrand", "tangent_shading", "use_tangent_shading"), - ("MaterialSubsurfaceScattering", "error_tolerance", "error_threshold"), - ("MaterialVolume", "depth_cutoff", "depth_threshold"), - ("MaterialVolume", "lighting_mode", "light_method"), - ("MaterialVolume", "step_calculation", "step_method"), - ("MaterialVolume", "external_shadows", "use_external_shadows"), - ("MaterialVolume", "light_cache", "use_light_cache"), - ("ArmatureModifier", "multi_modifier", "use_multi_modifier"), - ("ArrayModifier", "constant_offset_displacement", "constant_offset_displace"), - ("ArrayModifier", "merge_distance", "merge_threshold"), - ("ArrayModifier", "relative_offset_displacement", "relative_offset_displace"), - ("ArrayModifier", "constant_offset", "use_constant_offset"), - ("ArrayModifier", "merge_adjacent_vertices", "use_merge_vertices"), - ("ArrayModifier", "merge_end_vertices", "use_merge_vertices_cap"), - ("ArrayModifier", "add_offset_object", "use_object_offset"), - ("ArrayModifier", "relative_offset", "use_relative_offset"), - ("BevelModifier", "only_vertices", "use_only_vertices"), - ("CastModifier", "from_radius", "use_radius_as_size"), - ("DisplaceModifier", "midlevel", "mid_level"), - ("DisplaceModifier", "texture_coordinates", "texture_coords"), - ("EdgeSplitModifier", "use_sharp", "use_edge_sharp"), - ("ExplodeModifier", "split_edges", "use_edge_split"), - ("MirrorModifier", "merge_limit", "merge_threshold"), - ("MirrorModifier", "mirror_u", "use_mirror_u"), - ("MirrorModifier", "mirror_v", "use_mirror_v"), - ("MirrorModifier", "mirror_vertex_groups", "use_mirror_vertex_groups"), - ("ParticleInstanceModifier", "particle_system_number", "particle_system_index"), - ("ParticleInstanceModifier", "keep_shape", "use_preserve_shape"), - ("ShrinkwrapModifier", "cull_back_faces", "use_cull_back_faces"), - ("ShrinkwrapModifier", "cull_front_faces", "use_cull_front_faces"), - ("ShrinkwrapModifier", "keep_above_surface", "use_keep_above_surface"), - ("SimpleDeformModifier", "lock_x_axis", "lock_x"), - ("SimpleDeformModifier", "lock_y_axis", "lock_y"), - ("SmokeModifier", "smoke_type", "type"), - ("SubsurfModifier", "subsurf_uv", "use_subsurf_uv"), - ("UVProjectModifier", "num_projectors", "projector_count"), - ("UVProjectModifier", "override_image", "use_image_override"), - ("WaveModifier", "texture_coordinates", "texture_coords"), - ("WaveModifier", "x_normal", "use_normal_x"), - ("WaveModifier", "y_normal", "use_normal_y"), - ("WaveModifier", "z_normal", "use_normal_z"), - ("NlaStrip", "blending", "blend_type"), - ("NlaStrip", "animated_influence", "use_animated_influence"), - ("NlaStrip", "animated_time", "use_animated_time"), - ("NlaStrip", "animated_time_cyclic", "use_animated_time_cyclic"), - ("NlaStrip", "auto_blending", "use_auto_blend"), - ("CompositorNodeAlphaOver", "convert_premul", "use_premultiply"), - ("CompositorNodeBlur", "sizex", "size_x"), - ("CompositorNodeBlur", "sizey", "size_y"), - ("CompositorNodeChannelMatte", "algorithm", "limit_method"), - ("CompositorNodeChromaMatte", "acceptance", "tolerance"), - ("CompositorNodeColorBalance", "correction_formula", "correction_method"), - ("CompositorNodeColorSpill", "algorithm", "limit_method"), - ("CompositorNodeColorSpill", "unspill", "use_unspill"), - ("CompositorNodeCrop", "x2", "max_x"), - ("CompositorNodeCrop", "y2", "max_y"), - ("CompositorNodeCrop", "x1", "min_x"), - ("CompositorNodeCrop", "y1", "min_y"), - ("CompositorNodeCrop", "crop_size", "use_crop_size"), - ("CompositorNodeDefocus", "max_blur", "blur_max"), - ("CompositorNodeDefocus", "gamma_correction", "use_gamma_correction"), - ("CompositorNodeGlare", "rotate_45", "use_rotate_45"), - ("CompositorNodeImage", "auto_refresh", "use_auto_refresh"), - ("CompositorNodeLensdist", "projector", "use_projector"), - ("CompositorNodeVecBlur", "max_speed", "speed_max"), - ("CompositorNodeVecBlur", "min_speed", "speed_min"), - ("ShaderNodeMapping", "maximum", "max"), - ("ShaderNodeMapping", "minimum", "min"), - ("ShaderNodeMapping", "clamp_maximum", "use_max"), - ("ShaderNodeMapping", "clamp_minimum", "use_min"), - ("VertexPaint", "all_faces", "use_all_faces"), - ("VertexPaint", "spray", "use_spray"), - ("ParticleEdit", "add_keys", "default_key_count"), - ("ParticleEdit", "selection_mode", "select_mode"), - ("ParticleEdit", "auto_velocity", "use_auto_velocity"), - ("ParticleEdit", "add_interpolate", "use_default_interpolate"), - ("ParticleEdit", "emitter_deflect", "use_emitter_deflect"), - ("ParticleEdit", "fade_time", "use_fade_time"), - ("ParticleEdit", "keep_lengths", "use_preserve_length"), - ("ParticleEdit", "keep_root", "use_preserve_root"), - ("ParticleSystem", "vertex_group_clump_negate", "invert_vertex_group_clump"), - ("ParticleSystem", "vertex_group_density_negate", "invert_vertex_group_density"), - ("ParticleSystem", "vertex_group_field_negate", "invert_vertex_group_field"), - ("ParticleSystem", "vertex_group_kink_negate", "invert_vertex_group_kink"), - ("ParticleSystem", "vertex_group_length_negate", "invert_vertex_group_length"), - ("ParticleSystem", "vertex_group_rotation_negate", "invert_vertex_group_rotation"), - ("ParticleSystem", "vertex_group_roughness1_negate", "invert_vertex_group_roughness_1"), - ("ParticleSystem", "vertex_group_roughness2_negate", "invert_vertex_group_roughness_2"), - ("ParticleSystem", "vertex_group_roughness_end_negate", "invert_vertex_group_roughness_end"), - ("ParticleSystem", "vertex_group_size_negate", "invert_vertex_group_size"), - ("ParticleSystem", "vertex_group_tangent_negate", "invert_vertex_group_tangent"), - ("ParticleSystem", "vertex_group_velocity_negate", "invert_vertex_group_velocity"), - ("ParticleSystem", "hair_dynamics", "use_hair_dynamics"), - ("ParticleSystem", "keyed_timing", "use_keyed_timing"), - ("PointDensity", "falloff_softness", "falloff_soft"), - ("PointDensity", "particle_cache", "particle_cache_space"), - ("PointDensity", "turbulence_size", "turbulence_scale"), - ("PointDensity", "turbulence", "use_turbulence"), - ("PointDensity", "vertices_cache", "vertex_cache_space"), - ("PoseBone", "ik_lin_weight", "ik_linear_weight"), - ("PoseBone", "ik_rot_weight", "ik_rotation_weight"), - ("PoseBone", "ik_limit_x", "use_ik_limit_x"), - ("PoseBone", "ik_limit_y", "use_ik_limit_y"), - ("PoseBone", "ik_limit_z", "use_ik_limit_z"), - ("PoseBone", "ik_lin_control", "use_ik_linear_control"), - ("PoseBone", "ik_rot_control", "use_ik_rotation_control"), - ("Bone", "use_hinge", "use_inherit_rotation"), - ("SPHFluidSettings", "spring_k", "spring_force"), - ("SPHFluidSettings", "stiffness_k", "stiffness"), - ("SPHFluidSettings", "stiffness_knear", "stiffness_near"), - ("SceneGameData", "framing_color", "frame_color"), - ("SceneGameData", "framing_type", "frame_type"), - ("SceneGameData", "eye_separation", "stereo_eye_separation"), - ("SceneGameData", "activity_culling", "use_activity_culling"), - ("SceneGameData", "auto_start", "use_auto_start"), - ("SceneGameData", "glsl_extra_textures", "use_glsl_extra_textures"), - ("SceneGameData", "glsl_lights", "use_glsl_lights"), - ("SceneGameData", "glsl_nodes", "use_glsl_nodes"), - ("SceneGameData", "glsl_ramps", "use_glsl_ramps"), - ("SceneGameData", "glsl_shaders", "use_glsl_shaders"), - ("SceneGameData", "glsl_shadows", "use_glsl_shadows"), - ("Sequence", "blend_opacity", "blend_alpha"), - ("Sequence", "blend_mode", "blend_type"), - ("Sequence", "frame_final_length", "frame_final_duration"), - ("Sequence", "use_effect_default_fade", "use_default_fade"), - ("SequenceColorBalance", "inverse_gain", "invert_gain"), - ("SequenceColorBalance", "inverse_gamma", "invert_gamma"), - ("SequenceColorBalance", "inverse_lift", "invert_lift"), - ("EffectSequence", "multiply_colors", "color_multiply"), - ("EffectSequence", "de_interlace", "use_deinterlace"), - ("EffectSequence", "flip_x", "use_flip_x"), - ("EffectSequence", "flip_y", "use_flip_y"), - ("EffectSequence", "convert_float", "use_float"), - ("EffectSequence", "premultiply", "use_premultiply"), - ("EffectSequence", "proxy_custom_directory", "use_proxy_custom_directory"), - ("EffectSequence", "proxy_custom_file", "use_proxy_custom_file"), - ("EffectSequence", "reverse_frames", "use_reverse_frames"), - ("GlowSequence", "blur_distance", "blur_radius"), - ("GlowSequence", "only_boost", "use_only_boost"), - ("SpeedControlSequence", "curve_compress_y", "use_curve_compress_y"), - ("SpeedControlSequence", "curve_velocity", "use_curve_velocity"), - ("SpeedControlSequence", "frame_blending", "use_frame_blend"), - ("TransformSequence", "uniform_scale", "use_uniform_scale"), - ("ImageSequence", "animation_end_offset", "animation_offset_end"), - ("ImageSequence", "animation_start_offset", "animation_offset_start"), - ("ImageSequence", "multiply_colors", "color_multiply"), - ("ImageSequence", "de_interlace", "use_deinterlace"), - ("ImageSequence", "flip_x", "use_flip_x"), - ("ImageSequence", "flip_y", "use_flip_y"), - ("ImageSequence", "convert_float", "use_float"), - ("ImageSequence", "premultiply", "use_premultiply"), - ("ImageSequence", "proxy_custom_directory", "use_proxy_custom_directory"), - ("ImageSequence", "proxy_custom_file", "use_proxy_custom_file"), - ("ImageSequence", "reverse_frames", "use_reverse_frames"), - ("MetaSequence", "animation_end_offset", "animation_offset_end"), - ("MetaSequence", "animation_start_offset", "animation_offset_start"), - ("MetaSequence", "multiply_colors", "color_multiply"), - ("MetaSequence", "de_interlace", "use_deinterlace"), - ("MetaSequence", "flip_x", "use_flip_x"), - ("MetaSequence", "flip_y", "use_flip_y"), - ("MetaSequence", "convert_float", "use_float"), - ("MetaSequence", "premultiply", "use_premultiply"), - ("MetaSequence", "proxy_custom_directory", "use_proxy_custom_directory"), - ("MetaSequence", "proxy_custom_file", "use_proxy_custom_file"), - ("MetaSequence", "reverse_frames", "use_reverse_frames"), - ("MovieSequence", "animation_end_offset", "animation_offset_end"), - ("MovieSequence", "animation_start_offset", "animation_offset_start"), - ("MovieSequence", "multiply_colors", "color_multiply"), - ("MovieSequence", "de_interlace", "use_deinterlace"), - ("MovieSequence", "flip_x", "use_flip_x"), - ("MovieSequence", "flip_y", "use_flip_y"), - ("MovieSequence", "convert_float", "use_float"), - ("MovieSequence", "premultiply", "use_premultiply"), - ("MovieSequence", "proxy_custom_directory", "use_proxy_custom_directory"), - ("MovieSequence", "proxy_custom_file", "use_proxy_custom_file"), - ("MovieSequence", "reverse_frames", "use_reverse_frames"), - ("MulticamSequence", "animation_end_offset", "animation_offset_end"), - ("MulticamSequence", "animation_start_offset", "animation_offset_start"), - ("MulticamSequence", "multiply_colors", "color_multiply"), - ("MulticamSequence", "de_interlace", "use_deinterlace"), - ("MulticamSequence", "flip_x", "use_flip_x"), - ("MulticamSequence", "flip_y", "use_flip_y"), - ("MulticamSequence", "convert_float", "use_float"), - ("MulticamSequence", "premultiply", "use_premultiply"), - ("MulticamSequence", "proxy_custom_directory", "use_proxy_custom_directory"), - ("MulticamSequence", "proxy_custom_file", "use_proxy_custom_file"), - ("MulticamSequence", "reverse_frames", "use_reverse_frames"), - ("SceneSequence", "animation_end_offset", "animation_offset_end"), - ("SceneSequence", "animation_start_offset", "animation_offset_start"), - ("SceneSequence", "multiply_colors", "color_multiply"), - ("SceneSequence", "de_interlace", "use_deinterlace"), - ("SceneSequence", "flip_x", "use_flip_x"), - ("SceneSequence", "flip_y", "use_flip_y"), - ("SceneSequence", "convert_float", "use_float"), - ("SceneSequence", "premultiply", "use_premultiply"), - ("SceneSequence", "proxy_custom_directory", "use_proxy_custom_directory"), - ("SceneSequence", "proxy_custom_file", "use_proxy_custom_file"), - ("SceneSequence", "reverse_frames", "use_reverse_frames"), - ("SoundSequence", "animation_end_offset", "animation_offset_end"), - ("SoundSequence", "animation_start_offset", "animation_offset_start"), - ("SmokeDomainSettings", "smoke_domain_colli", "collision_extents"), - ("SmokeDomainSettings", "smoke_cache_high_comp", "point_cache_compress_high_type"), - ("SmokeDomainSettings", "smoke_cache_comp", "point_cache_compress_type"), - ("SmokeDomainSettings", "maxres", "resolution_max"), - ("SmokeDomainSettings", "smoothemitter", "smooth_emitter"), - ("SmokeDomainSettings", "dissolve_smoke", "use_dissolve_smoke"), - ("SmokeDomainSettings", "dissolve_smoke_log", "use_dissolve_smoke_log"), - ("SmokeDomainSettings", "highres", "use_high_resolution"), - ("SoftBodySettings", "bending", "bend"), - ("SoftBodySettings", "error_limit", "error_threshold"), - ("SoftBodySettings", "lcom", "location_mass_center"), - ("SoftBodySettings", "lrot", "rotation_estimate"), - ("SoftBodySettings", "lscale", "scale_estimate"), - ("SoftBodySettings", "maxstep", "step_max"), - ("SoftBodySettings", "minstep", "step_min"), - ("SoftBodySettings", "diagnose", "use_diagnose"), - ("SoftBodySettings", "edge_collision", "use_edge_collision"), - ("SoftBodySettings", "estimate_matrix", "use_estimate_matrix"), - ("SoftBodySettings", "face_collision", "use_face_collision"), - ("SoftBodySettings", "self_collision", "use_self_collision"), - ("SoftBodySettings", "stiff_quads", "use_stiff_quads"), - ("TexMapping", "maximum", "max"), - ("TexMapping", "minimum", "min"), - ("TexMapping", "has_maximum", "use_max"), - ("TexMapping", "has_minimum", "use_min"), - ("TextCharacterFormat", "bold", "use_bold"), - ("TextCharacterFormat", "italic", "use_italic"), - ("TextCharacterFormat", "underline", "use_underline"), - ("TextureSlot", "rgb_to_intensity", "use_rgb_to_intensity"), - ("TextureSlot", "stencil", "use_stencil"), - ("LampTextureSlot", "texture_coordinates", "texture_coords"), - ("LampTextureSlot", "map_color", "use_map_color"), - ("LampTextureSlot", "map_shadow", "use_map_shadow"), - ("MaterialTextureSlot", "coloremission_factor", "color_emission_factor"), - ("MaterialTextureSlot", "colordiff_factor", "diffuse_color_factor"), - ("MaterialTextureSlot", "x_mapping", "mapping_x"), - ("MaterialTextureSlot", "y_mapping", "mapping_y"), - ("MaterialTextureSlot", "z_mapping", "mapping_z"), - ("MaterialTextureSlot", "colorreflection_factor", "reflection_color_factor"), - ("MaterialTextureSlot", "colorspec_factor", "specular_color_factor"), - ("MaterialTextureSlot", "texture_coordinates", "texture_coords"), - ("MaterialTextureSlot", "colortransmission_factor", "transmission_color_factor"), - ("MaterialTextureSlot", "from_dupli", "use_from_dupli"), - ("MaterialTextureSlot", "from_original", "use_from_original"), - ("MaterialTextureSlot", "map_alpha", "use_map_alpha"), - ("MaterialTextureSlot", "map_ambient", "use_map_ambient"), - ("MaterialTextureSlot", "map_colordiff", "use_map_color_diff"), - ("MaterialTextureSlot", "map_coloremission", "use_map_color_emission"), - ("MaterialTextureSlot", "map_colorreflection", "use_map_color_reflection"), - ("MaterialTextureSlot", "map_colorspec", "use_map_color_spec"), - ("MaterialTextureSlot", "map_colortransmission", "use_map_color_transmission"), - ("MaterialTextureSlot", "map_density", "use_map_density"), - ("MaterialTextureSlot", "map_diffuse", "use_map_diffuse"), - ("MaterialTextureSlot", "map_displacement", "use_map_displacement"), - ("MaterialTextureSlot", "map_emission", "use_map_emission"), - ("MaterialTextureSlot", "map_emit", "use_map_emit"), - ("MaterialTextureSlot", "map_hardness", "use_map_hardness"), - ("MaterialTextureSlot", "map_mirror", "use_map_mirror"), - ("MaterialTextureSlot", "map_normal", "use_map_normal"), - ("MaterialTextureSlot", "map_raymir", "use_map_raymir"), - ("MaterialTextureSlot", "map_reflection", "use_map_reflect"), - ("MaterialTextureSlot", "map_scattering", "use_map_scatter"), - ("MaterialTextureSlot", "map_specular", "use_map_specular"), - ("MaterialTextureSlot", "map_translucency", "use_map_translucency"), - ("MaterialTextureSlot", "map_warp", "use_map_warp"), - ("WorldTextureSlot", "texture_coordinates", "texture_coords"), - ("WorldTextureSlot", "map_blend", "use_map_blend"), - ("WorldTextureSlot", "map_horizon", "use_map_horizon"), - ("WorldTextureSlot", "map_zenith_down", "use_map_zenith_down"), - ("WorldTextureSlot", "map_zenith_up", "use_map_zenith_up"), - ("VoxelData", "still_frame_number", "still_frame"), - ("WorldLighting", "ao_blend_mode", "ao_blend_type"), - ("WorldLighting", "error_tolerance", "error_threshold"), - ("WorldLighting", "use_ambient_occlusion", "use_ambient_occlusian"), - ("WorldLighting", "pixel_cache", "use_cache"), - ("WorldLighting", "use_environment_lighting", "use_environment_light"), - ("WorldLighting", "use_indirect_lighting", "use_indirect_light"), - ("WorldStarsSettings", "color_randomization", "color_random"), - ("WorldStarsSettings", "min_distance", "distance_min"), - ("WorldLighting", "falloff", "use_falloff"), - ("Constraint", "disabled", "is_valid"), - ("ClampToConstraint", "cyclic", "use_cyclic"), - ("ImageTexture", "filter", "filter_type"), - ("ImageTexture", "interpolation", "use_interpolation"), - ("ImageTexture", "mipmap", "use_mipmap"), - ("ImageUser", "frames", "frame_duration"), - ("ImageUser", "offset", "frame_offset"), - ("ImageUser", "cyclic", "use_cyclic"), - ("ArmatureModifier", "invert", "invert_vertex_group"), - ("ArmatureModifier", "quaternion", "use_deform_preserve_volume"), - ("ArrayModifier", "length", "fit_length"), - ("BevelModifier", "angle", "angle_limit"), - ("BuildModifier", "length", "frame_duration"), - ("BuildModifier", "randomize", "use_random_order"), - ("CastModifier", "x", "use_x"), - ("CastModifier", "y", "use_y"), - ("CastModifier", "z", "use_z"), - ("ExplodeModifier", "size", "use_size"), - ("MaskModifier", "invert", "invert_vertex_group"), - ("MeshDeformModifier", "invert", "invert_vertex_group"), - ("MeshDeformModifier", "dynamic", "use_dynamic_bind"), - ("MirrorModifier", "clip", "use_clip"), - ("MirrorModifier", "x", "use_x"), - ("MirrorModifier", "y", "use_y"), - ("MirrorModifier", "z", "use_z"), - ("ParticleInstanceModifier", "children", "use_children"), - ("ParticleInstanceModifier", "normal", "use_normal"), - ("ParticleInstanceModifier", "size", "use_size"), - ("ShrinkwrapModifier", "negative", "use_negative_direction"), - ("ShrinkwrapModifier", "positive", "use_positive_direction"), - ("ShrinkwrapModifier", "x", "use_project_x"), - ("ShrinkwrapModifier", "y", "use_project_y"), - ("ShrinkwrapModifier", "z", "use_project_z"), - ("ShrinkwrapModifier", "mode", "wrap_method"), - ("SimpleDeformModifier", "mode", "deform_method"), - ("SimpleDeformModifier", "relative", "use_relative"), - ("SmoothModifier", "repeat", "iterations"), - ("SmoothModifier", "x", "use_x"), - ("SmoothModifier", "y", "use_y"), - ("SmoothModifier", "z", "use_z"), - ("SolidifyModifier", "invert", "invert_vertex_group"), - ("WaveModifier", "cyclic", "use_cyclic"), - ("WaveModifier", "normals", "use_normal"), - ("WaveModifier", "x", "use_x"), - ("WaveModifier", "y", "use_y"), - ("DampedTrackConstraint", "track", "track_axis"), - ("FloorConstraint", "sticky", "use_sticky"), - ("FollowPathConstraint", "forward", "forward_axis"), - ("FollowPathConstraint", "up", "up_axis"), - ("LockedTrackConstraint", "lock", "lock_axis"), - ("LockedTrackConstraint", "track", "track_axis"), - ("MaintainVolumeConstraint", "axis", "free_axis"), - ("TrackToConstraint", "track", "track_axis"), - ("TrackToConstraint", "up", "up_axis"), - ("GameProperty", "debug", "show_debug"), - ("Image", "tiles", "use_tiles"), - ("Lamp", "diffuse", "use_diffuse"), - ("Lamp", "negative", "use_negative"), - ("Lamp", "layer", "use_own_layer"), - ("Lamp", "specular", "use_specular"), - ("AreaLamp", "dither", "use_dither"), - ("AreaLamp", "jitter", "use_jitter"), - ("SpotLamp", "square", "use_square"), - ("Material", "cubic", "use_cubic"), - ("Material", "shadows", "use_shadows"), - ("ParticleSettings", "amount", "count"), - ("ParticleSettings", "display", "draw_percentage"), - ("ParticleSettings", "velocity", "show_velocity"), - ("ParticleSettings", "trand", "use_emit_random"), - ("ParticleSettings", "parent", "use_parent_particles"), - ("ParticleSettings", "emitter", "use_render_emitter"), - ("ParticleSettings", "viewport", "use_simplify_viewport"), - ("Texture", "brightness", "intensity"), - ("CloudsTexture", "stype", "cloud_type"), - ("EnvironmentMapTexture", "filter", "filter_type"), - ("EnvironmentMapTexture", "mipmap", "use_mipmap"), - ("MarbleTexture", "stype", "marble_type"), - ("StucciTexture", "stype", "stucci_type"), - ("WoodTexture", "stype", "wood_type"), - ("World", "range", "color_range"), - ("World", "lighting", "light_settings"), - ("World", "mist", "mist_settings"), - ("World", "stars", "star_settings"), - ("MaterialHalo", "lines", "use_lines"), - ("MaterialHalo", "ring", "use_ring"), - ("MaterialHalo", "soft", "use_soft"), - ("MaterialHalo", "star", "use_star"), - ("MaterialHalo", "texture", "use_texture"), - ("MaterialPhysics", "damp", "damping"), - ("MaterialRaytraceTransparency", "limit", "depth_max"), - ("NlaStrip", "reversed", "use_reverse"), - ("CompositorNodeBlur", "bokeh", "use_bokeh"), - ("CompositorNodeBlur", "gamma", "use_gamma_correction"), - ("CompositorNodeBlur", "relative", "use_relative"), - ("CompositorNodeChannelMatte", "high", "limit_max"), - ("CompositorNodeChannelMatte", "low", "limit_min"), - ("CompositorNodeChannelMatte", "channel", "matte_channel"), - ("CompositorNodeChromaMatte", "cutoff", "threshold"), - ("CompositorNodeColorMatte", "h", "color_hue"), - ("CompositorNodeColorMatte", "s", "color_saturation"), - ("CompositorNodeColorMatte", "v", "color_value"), - ("CompositorNodeDBlur", "wrap", "use_wrap"), - ("CompositorNodeDefocus", "preview", "use_preview"), - ("CompositorNodeHueSat", "hue", "color_hue"), - ("CompositorNodeHueSat", "sat", "color_saturation"), - ("CompositorNodeHueSat", "val", "color_value"), - ("CompositorNodeImage", "frames", "frame_duration"), - ("CompositorNodeImage", "offset", "frame_offset"), - ("CompositorNodeImage", "start", "frame_start"), - ("CompositorNodeImage", "cyclic", "use_cyclic"), - ("CompositorNodeInvert", "alpha", "invert_alpha"), - ("CompositorNodeInvert", "rgb", "invert_rgb"), - ("CompositorNodeLensdist", "fit", "use_fit"), - ("CompositorNodeLensdist", "jitter", "use_jitter"), - ("CompositorNodeMixRGB", "alpha", "use_alpha"), - ("CompositorNodeRotate", "filter", "filter_type"), - ("CompositorNodeTime", "end", "frame_end"), - ("CompositorNodeTime", "start", "frame_start"), - ("CompositorNodeVecBlur", "curved", "use_curved"), - ("ShaderNodeExtendedMaterial", "diffuse", "use_diffuse"), - ("ShaderNodeExtendedMaterial", "specular", "use_specular"), - ("ShaderNodeMaterial", "diffuse", "use_diffuse"), - ("ShaderNodeMaterial", "specular", "use_specular"), - ("ShaderNodeMixRGB", "alpha", "use_alpha"), - ("TextureNodeCurveTime", "end", "frame_end"), - ("TextureNodeCurveTime", "start", "frame_start"), - ("TextureNodeMixRGB", "alpha", "use_alpha"), - ("TextureSlot", "negate", "invert"), - ("TextureSlot", "size", "scale"), - ("SoftBodySettings", "damp", "damping"), - ("SequenceCrop", "right", "max_x"), - ("SequenceCrop", "top", "max_y"), - ("SequenceCrop", "bottom", "min_x"), - ("SequenceCrop", "left", "min_y"), - ("Sequence", "speed_fader", "speed_factor"), - ("SpeedControlSequence", "global_speed", "multiply_speed"), - ("SpeedControlSequence", "use_curve_velocity", "use_as_speed"), - ("SpeedControlSequence", "use_curve_compress_y", "scale_to_length"), - ("Key", "keys", "key_blocks"), - ] - - -from bpy.types import Operator - - -class UpdateAnimData(Operator): - """Update data paths from 2.56 and previous versions, modifying data paths of drivers and fcurves""" - bl_idname = "anim.update_data_paths" - bl_label = "Update Animation Data" - - def execute(self, context): - import animsys_refactor - animsys_refactor.update_data_paths(data_path_update) - return {'FINISHED'} diff --git a/release/scripts/startup/bl_operators/console.py b/release/scripts/startup/bl_operators/console.py new file mode 100644 index 00000000000..de953630f00 --- /dev/null +++ b/release/scripts/startup/bl_operators/console.py @@ -0,0 +1,106 @@ +# ##### BEGIN GPL LICENSE BLOCK ##### +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ##### END GPL LICENSE BLOCK ##### + +# <pep8-80 compliant> + +import bpy +from bpy.types import Operator +from bpy.props import StringProperty + + +class ConsoleExec(Operator): + '''Execute the current console line as a python expression''' + bl_idname = "console.execute" + bl_label = "Console Execute" + + def execute(self, context): + sc = context.space_data + + module = __import__("console_" + sc.language) + execute = getattr(module, "execute", None) + + if execute: + return execute(context) + else: + print("Error: bpy.ops.console.execute_" + sc.language + " - not found") + return {'FINISHED'} + + +class ConsoleAutocomplete(Operator): + '''Evaluate the namespace up until the cursor and give a list of options or complete the name if there is only one''' + bl_idname = "console.autocomplete" + bl_label = "Console Autocomplete" + + def execute(self, context): + sc = context.space_data + module = __import__("console_" + sc.language) + autocomplete = getattr(module, "autocomplete", None) + + if autocomplete: + return autocomplete(context) + else: + print("Error: bpy.ops.console.autocomplete_" + sc.language + " - not found") + return {'FINISHED'} + + +class ConsoleBanner(Operator): + '''Print a message whem the terminal initializes''' + bl_idname = "console.banner" + bl_label = "Console Banner" + + def execute(self, context): + sc = context.space_data + + # default to python + if not sc.language: + sc.language = 'python' + + module = __import__("console_" + sc.language) + banner = getattr(module, "banner", None) + + if banner: + return banner(context) + else: + print("Error: bpy.ops.console.banner_" + sc.language + " - not found") + return {'FINISHED'} + + +class ConsoleLanguage(Operator): + '''Set the current language for this console''' + bl_idname = "console.language" + bl_label = "Console Language" + + language = StringProperty( + name="Language", + maxlen=32, + ) + + def execute(self, context): + sc = context.space_data + + # defailt to python + sc.language = self.language + + bpy.ops.console.banner() + + # insert a new blank line + bpy.ops.console.history_append(text="", current_character=0, + remove_duplicates=True) + + return {'FINISHED'} + diff --git a/release/scripts/startup/bl_operators/mesh.py b/release/scripts/startup/bl_operators/mesh.py index 5f6583754e9..bf9fa562ee1 100644 --- a/release/scripts/startup/bl_operators/mesh.py +++ b/release/scripts/startup/bl_operators/mesh.py @@ -25,7 +25,7 @@ from bpy.props import EnumProperty class MeshSelectInteriorFaces(Operator): - '''Select faces where all edges have more then 2 face users.''' + '''Select faces where all edges have more then 2 face users''' bl_idname = "mesh.faces_select_interior" bl_label = "Select Interior Faces" diff --git a/release/scripts/startup/bl_operators/nla.py b/release/scripts/startup/bl_operators/nla.py deleted file mode 100644 index feb0016b1c7..00000000000 --- a/release/scripts/startup/bl_operators/nla.py +++ /dev/null @@ -1,306 +0,0 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ##### END GPL LICENSE BLOCK ##### - -# <pep8-80 compliant> - -import bpy -from bpy.types import Operator - - -def pose_frame_info(obj): - from mathutils import Matrix - - info = {} - - pose = obj.pose - - pose_items = pose.bones.items() - - for name, pbone in pose_items: - binfo = {} - bone = pbone.bone - - binfo["parent"] = getattr(bone.parent, "name", None) - binfo["bone"] = bone - binfo["pbone"] = pbone - binfo["matrix_local"] = bone.matrix_local.copy() - try: - binfo["matrix_local_inv"] = binfo["matrix_local"].inverted() - except: - binfo["matrix_local_inv"] = Matrix() - - binfo["matrix"] = bone.matrix.copy() - binfo["matrix_pose"] = pbone.matrix.copy() - try: - binfo["matrix_pose_inv"] = binfo["matrix_pose"].inverted() - except: - binfo["matrix_pose_inv"] = Matrix() - - info[name] = binfo - - for name, pbone in pose_items: - binfo = info[name] - binfo_parent = binfo.get("parent", None) - if binfo_parent: - binfo_parent = info[binfo_parent] - - matrix = binfo["matrix_pose"] - rest_matrix = binfo["matrix_local"] - - if binfo_parent: - matrix = binfo_parent["matrix_pose_inv"] * matrix - rest_matrix = binfo_parent["matrix_local_inv"] * rest_matrix - - binfo["matrix_key"] = rest_matrix.inverted() * matrix - - return info - - -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, - do_pose=True, - do_object=True, - do_constraint_clear=False, - action=None): - - scene = bpy.context.scene - obj = bpy.context.object - pose = obj.pose - frame_back = scene.frame_current - - if pose is None: - do_pose = False - - 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) - - # ------------------------------------------------------------------------- - # Collect transformations - - # could speed this up by applying steps here too... - for f in frame_range: - scene.frame_set(f) - - 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() - if action is None: - action = bpy.data.actions.new("Action") - atd.action = action - - if do_pose: - pose_items = pose.bones.items() - else: - pose_items = [] # skip - - # ------------------------------------------------------------------------- - # Apply transformations to action - - # 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 = pose_info[(f - frame_start) // step][name]["matrix_key"] - - # pbone.location = matrix.to_translation() - # pbone.rotation_quaternion = matrix.to_quaternion() - pbone.matrix_basis = matrix - - pbone.keyframe_insert("location", -1, f, name) - - rotation_mode = pbone.rotation_mode - - if rotation_mode == 'QUATERNION': - pbone.keyframe_insert("rotation_quaternion", -1, f, name) - elif rotation_mode == 'AXIS_ANGLE': - pbone.keyframe_insert("rotation_axis_angle", -1, f, name) - else: # euler, XYZ, ZXY etc - pbone.keyframe_insert("rotation_euler", -1, f, name) - - 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, EnumProperty - - -class BakeAction(Operator): - '''Bake animation to an Action''' - bl_idname = "nla.bake" - bl_label = "Bake Action" - bl_options = {'REGISTER', 'UNDO'} - - frame_start = IntProperty( - name="Start Frame", - description="Start frame for baking", - min=0, max=300000, - default=1, - ) - frame_end = IntProperty( - name="End Frame", - description="End frame for baking", - min=1, max=300000, - default=250, - ) - step = IntProperty( - name="Frame Step", - description="Frame Step", - min=1, max=120, - default=1, - ) - 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, - '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: - keyframe_points = fcu.keyframe_points - i = 1 - while i < len(fcu.keyframe_points) - 1: - val_prev = keyframe_points[i - 1].co[1] - val_next = keyframe_points[i + 1].co[1] - val = keyframe_points[i].co[1] - - if abs(val - val_prev) + abs(val - val_next) < 0.0001: - keyframe_points.remove(keyframe_points[i]) - else: - i += 1 - - return {'FINISHED'} - - def invoke(self, context, event): - wm = context.window_manager - return wm.invoke_props_dialog(self) - - -class ClearUselessActions(Operator): - '''Mark actions with no F-Curves for deletion after save+reload of ''' \ - '''file preserving "action libraries"''' - bl_idname = "anim.clear_useless_actions" - bl_label = "Clear Useless Actions" - bl_options = {'REGISTER', 'UNDO'} - - only_unused = BoolProperty(name="Only Unused", - description="Only unused (Fake User only) actions get considered", - default=True) - - @classmethod - def poll(cls, context): - return len(bpy.data.actions) != 0 - - def execute(self, context): - removed = 0 - - for action in bpy.data.actions: - # if only user is "fake" user... - if ((self.only_unused is False) or - (action.use_fake_user and action.users == 1)): - - # if it has F-Curves, then it's a "action library" - # (i.e. walk, wave, jump, etc.) - # and should be left alone as that's what fake users are for! - if not action.fcurves: - # mark action for deletion - action.user_clear() - removed += 1 - - self.report({'INFO'}, "Removed %d empty and/or fake-user only Actions" - % removed) - return {'FINISHED'} diff --git a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py index c2a09d6a4ae..015a2cd0c36 100644 --- a/release/scripts/startup/bl_operators/screen_play_rendered_anim.py +++ b/release/scripts/startup/bl_operators/screen_play_rendered_anim.py @@ -66,7 +66,7 @@ def guess_player_path(preset): class PlayRenderedAnim(Operator): - '''Plays back rendered frames/movies using an external player.''' + '''Plays back rendered frames/movies using an external player''' bl_idname = "render.play_rendered_anim" bl_label = "Play Rendered Animation" bl_options = {'REGISTER'} diff --git a/release/scripts/startup/bl_operators/sequencer.py b/release/scripts/startup/bl_operators/sequencer.py index 53654ffbc6f..67b9be59f2a 100644 --- a/release/scripts/startup/bl_operators/sequencer.py +++ b/release/scripts/startup/bl_operators/sequencer.py @@ -25,7 +25,7 @@ from bpy.props import IntProperty class SequencerCrossfadeSounds(Operator): - '''Do crossfading volume animation of two selected sound strips.''' + '''Do crossfading volume animation of two selected sound strips''' bl_idname = "sequencer.crossfade_sounds" bl_label = "Crossfade sounds" @@ -76,7 +76,7 @@ class SequencerCrossfadeSounds(Operator): class SequencerCutMulticam(Operator): - '''Cut multicam strip and select camera.''' + '''Cut multicam strip and select camera''' bl_idname = "sequencer.cut_multicam" bl_label = "Cut multicam" @@ -118,7 +118,7 @@ class SequencerCutMulticam(Operator): class SequencerDeinterlaceSelectedMovies(Operator): - '''Deinterlace all selected movie sources.''' + '''Deinterlace all selected movie sources''' bl_idname = "sequencer.deinterlace_selected_movies" bl_label = "Deinterlace Movies" diff --git a/release/scripts/startup/bl_operators/uvcalc_smart_project.py b/release/scripts/startup/bl_operators/uvcalc_smart_project.py index c4466e6453f..5985a37a0c9 100644 --- a/release/scripts/startup/bl_operators/uvcalc_smart_project.py +++ b/release/scripts/startup/bl_operators/uvcalc_smart_project.py @@ -1105,7 +1105,8 @@ from bpy.props import FloatProperty class SmartProject(Operator): - '''This script projection unwraps the selected faces of a mesh. it operates on all selected mesh objects, and can be used unwrap selected faces, or all faces.''' + '''This script projection unwraps the selected faces of a mesh. ''' \ + '''it operates on all selected mesh objects, and can be used unwrap selected faces, or all faces''' bl_idname = "uv.smart_project" bl_label = "Smart UV Project" bl_options = {'REGISTER', 'UNDO'} diff --git a/release/scripts/startup/bl_operators/view3d.py b/release/scripts/startup/bl_operators/view3d.py new file mode 100644 index 00000000000..805f2b5105b --- /dev/null +++ b/release/scripts/startup/bl_operators/view3d.py @@ -0,0 +1,77 @@ +# ##### BEGIN GPL LICENSE BLOCK ##### +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ##### END GPL LICENSE BLOCK ##### + +# <pep8-80 compliant> + +import bpy +from bpy.types import Operator + + +class VIEW3D_OT_edit_mesh_extrude_individual_move(Operator): + "Extrude individual elements and move" + bl_label = "Extrude Individual and Move" + bl_idname = "view3d.edit_mesh_extrude_individual_move" + + def execute(self, context): + mesh = context.object.data + select_mode = context.tool_settings.mesh_select_mode + + totface = mesh.total_face_sel + totedge = mesh.total_edge_sel + # totvert = mesh.total_vert_sel + + if select_mode[2] and totface == 1: + bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": 'NORMAL', "constraint_axis": (False, False, True)}) + elif select_mode[2] and totface > 1: + bpy.ops.mesh.extrude_faces_move('INVOKE_REGION_WIN') + elif select_mode[1] and totedge >= 1: + bpy.ops.mesh.extrude_edges_move('INVOKE_REGION_WIN') + else: + bpy.ops.mesh.extrude_vertices_move('INVOKE_REGION_WIN') + + # ignore return from operators above because they are 'RUNNING_MODAL', and cause this one not to be freed. [#24671] + return {'FINISHED'} + + def invoke(self, context, event): + return self.execute(context) + + +class VIEW3D_OT_edit_mesh_extrude_move(Operator): + "Extrude and move along normals" + bl_label = "Extrude and Move on Normals" + bl_idname = "view3d.edit_mesh_extrude_move_normal" + + def execute(self, context): + mesh = context.object.data + + totface = mesh.total_face_sel + totedge = mesh.total_edge_sel + # totvert = mesh.total_vert_sel + + if totface >= 1: + bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": 'NORMAL', "constraint_axis": (False, False, True)}) + elif totedge == 1: + bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": 'NORMAL', "constraint_axis": (True, True, False)}) + else: + bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN') + + # ignore return from operators above because they are 'RUNNING_MODAL', and cause this one not to be freed. [#24671] + return {'FINISHED'} + + def invoke(self, context, event): + return self.execute(context) diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 861255f167f..fd2b14658ad 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -172,7 +172,7 @@ class BRUSH_OT_active_index_set(Operator): class WM_OT_context_set_boolean(Operator): - '''Set a context value.''' + '''Set a context value''' bl_idname = "wm.context_set_boolean" bl_label = "Context Set Boolean" bl_options = {'UNDO', 'INTERNAL'} @@ -188,7 +188,7 @@ class WM_OT_context_set_boolean(Operator): class WM_OT_context_set_int(Operator): # same as enum - '''Set a context value.''' + '''Set a context value''' bl_idname = "wm.context_set_int" bl_label = "Context Set" bl_options = {'UNDO', 'INTERNAL'} @@ -205,7 +205,7 @@ class WM_OT_context_set_int(Operator): # same as enum class WM_OT_context_scale_int(Operator): - '''Scale an int context value.''' + '''Scale an int context value''' bl_idname = "wm.context_scale_int" bl_label = "Context Set" bl_options = {'UNDO', 'INTERNAL'} @@ -248,7 +248,7 @@ class WM_OT_context_scale_int(Operator): class WM_OT_context_set_float(Operator): # same as enum - '''Set a context value.''' + '''Set a context value''' bl_idname = "wm.context_set_float" bl_label = "Context Set Float" bl_options = {'UNDO', 'INTERNAL'} @@ -265,7 +265,7 @@ class WM_OT_context_set_float(Operator): # same as enum class WM_OT_context_set_string(Operator): # same as enum - '''Set a context value.''' + '''Set a context value''' bl_idname = "wm.context_set_string" bl_label = "Context Set String" bl_options = {'UNDO', 'INTERNAL'} @@ -281,7 +281,7 @@ class WM_OT_context_set_string(Operator): # same as enum class WM_OT_context_set_enum(Operator): - '''Set a context value.''' + '''Set a context value''' bl_idname = "wm.context_set_enum" bl_label = "Context Set Enum" bl_options = {'UNDO', 'INTERNAL'} @@ -297,7 +297,7 @@ class WM_OT_context_set_enum(Operator): class WM_OT_context_set_value(Operator): - '''Set a context value.''' + '''Set a context value''' bl_idname = "wm.context_set_value" bl_label = "Context Set Value" bl_options = {'UNDO', 'INTERNAL'} @@ -318,7 +318,7 @@ class WM_OT_context_set_value(Operator): class WM_OT_context_toggle(Operator): - '''Toggle a context value.''' + '''Toggle a context value''' bl_idname = "wm.context_toggle" bl_label = "Context Toggle" bl_options = {'UNDO', 'INTERNAL'} @@ -337,7 +337,7 @@ class WM_OT_context_toggle(Operator): class WM_OT_context_toggle_enum(Operator): - '''Toggle a context value.''' + '''Toggle a context value''' bl_idname = "wm.context_toggle_enum" bl_label = "Context Toggle Values" bl_options = {'UNDO', 'INTERNAL'} @@ -371,7 +371,7 @@ class WM_OT_context_toggle_enum(Operator): class WM_OT_context_cycle_int(Operator): '''Set a context value. Useful for cycling active material, ''' - '''vertex keys, groups' etc.''' + '''vertex keys, groups' etc''' bl_idname = "wm.context_cycle_int" bl_label = "Context Int Cycle" bl_options = {'UNDO', 'INTERNAL'} @@ -405,7 +405,7 @@ class WM_OT_context_cycle_int(Operator): class WM_OT_context_cycle_enum(Operator): - '''Toggle a context value.''' + '''Toggle a context value''' bl_idname = "wm.context_cycle_enum" bl_label = "Context Enum Cycle" bl_options = {'UNDO', 'INTERNAL'} @@ -458,7 +458,7 @@ class WM_OT_context_cycle_enum(Operator): class WM_OT_context_cycle_array(Operator): '''Set a context array value. - Useful for cycling the active mesh edit mode.''' + Useful for cycling the active mesh edit mode''' bl_idname = "wm.context_cycle_array" bl_label = "Context Array Cycle" bl_options = {'UNDO', 'INTERNAL'} @@ -518,7 +518,7 @@ class WM_OT_context_menu_enum(Operator): class WM_OT_context_set_id(Operator): - '''Toggle a context value.''' + '''Toggle a context value''' bl_idname = "wm.context_set_id" bl_label = "Set Library ID" bl_options = {'UNDO', 'INTERNAL'} @@ -1179,3 +1179,718 @@ class WM_OT_copy_prev_settings(Operator): return {'FINISHED'} return {'CANCELLED'} + + +class WM_OT_keyconfig_test(Operator): + "Test keyconfig for conflicts" + bl_idname = "wm.keyconfig_test" + bl_label = "Test Key Configuration for Conflicts" + + def testEntry(self, kc, entry, src=None, parent=None): + result = False + + def kmistr(kmi): + if km.is_modal: + s = ["kmi = km.keymap_items.new_modal(\'%s\', \'%s\', \'%s\'" % (kmi.propvalue, kmi.type, kmi.value)] + else: + s = ["kmi = km.keymap_items.new(\'%s\', \'%s\', \'%s\'" % (kmi.idname, kmi.type, kmi.value)] + + if kmi.any: + s.append(", any=True") + else: + if kmi.shift: + s.append(", shift=True") + if kmi.ctrl: + s.append(", ctrl=True") + if kmi.alt: + s.append(", alt=True") + if kmi.oskey: + s.append(", oskey=True") + if kmi.key_modifier and kmi.key_modifier != 'NONE': + s.append(", key_modifier=\'%s\'" % kmi.key_modifier) + + s.append(")\n") + + props = kmi.properties + + if props is not None: + export_properties("kmi.properties", props, s) + + return "".join(s).strip() + + idname, spaceid, regionid, children = entry + + km = kc.keymaps.find(idname, space_type=spaceid, region_type=regionid) + + if km: + km = km.active() + + if src: + for item in km.keymap_items: + if src.compare(item): + print("===========") + print(parent.name) + print(kmistr(src)) + print(km.name) + print(kmistr(item)) + result = True + + for child in children: + if self.testEntry(kc, child, src, parent): + result = True + else: + for i in range(len(km.keymap_items)): + src = km.keymap_items[i] + + for child in children: + if self.testEntry(kc, child, src, km): + result = True + + for j in range(len(km.keymap_items) - i - 1): + item = km.keymap_items[j + i + 1] + if src.compare(item): + print("===========") + print(km.name) + print(kmistr(src)) + print(kmistr(item)) + result = True + + for child in children: + if self.testEntry(kc, child): + result = True + + return result + + def testConfig(self, kc): + result = False + for entry in KM_HIERARCHY: + if self.testEntry(kc, entry): + result = True + return result + + def execute(self, context): + wm = context.window_manager + kc = wm.keyconfigs.default + + if self.testConfig(kc): + print("CONFLICT") + + return {'FINISHED'} + + +def _string_value(value): + if isinstance(value, str) or isinstance(value, bool) or isinstance(value, float) or isinstance(value, int): + result = repr(value) + elif getattr(value, '__len__', False): + return repr(list(value)) + else: + print("Export key configuration: can't write ", value) + + return result + + +class WM_OT_keyconfig_import(Operator): + "Import key configuration from a python script" + bl_idname = "wm.keyconfig_import" + bl_label = "Import Key Configuration..." + + filepath = StringProperty( + name="File Path", + description="Filepath to write file to", + default="keymap.py", + ) + filter_folder = BoolProperty( + name="Filter folders", + default=True, + options={'HIDDEN'}, + ) + filter_text = BoolProperty( + name="Filter text", + default=True, + options={'HIDDEN'}, + ) + filter_python = BoolProperty( + name="Filter python", + default=True, + options={'HIDDEN'}, + ) + keep_original = BoolProperty( + name="Keep original", + description="Keep original file after copying to configuration folder", + default=True, + ) + + def execute(self, context): + from os.path import basename + import shutil + + if not self.filepath: + self.report({'ERROR'}, "Filepath not set") + return {'CANCELLED'} + + config_name = basename(self.filepath) + + path = bpy.utils.user_resource('SCRIPTS', os.path.join("presets", "keyconfig"), create=True) + path = os.path.join(path, config_name) + + try: + if self.keep_original: + shutil.copy(self.filepath, path) + else: + shutil.move(self.filepath, path) + except Exception as e: + self.report({'ERROR'}, "Installing keymap failed: %s" % e) + return {'CANCELLED'} + + # sneaky way to check we're actually running the code. + bpy.utils.keyconfig_set(path) + + return {'FINISHED'} + + def invoke(self, context, event): + wm = context.window_manager + wm.fileselect_add(self) + return {'RUNNING_MODAL'} + +# This operator is also used by interaction presets saving - AddPresetBase + + +class WM_OT_keyconfig_export(Operator): + "Export key configuration to a python script" + bl_idname = "wm.keyconfig_export" + bl_label = "Export Key Configuration..." + + filepath = StringProperty( + name="File Path", + description="Filepath to write file to", + default="keymap.py", + ) + filter_folder = BoolProperty( + name="Filter folders", + default=True, + options={'HIDDEN'}, + ) + filter_text = BoolProperty( + name="Filter text", + default=True, + options={'HIDDEN'}, + ) + filter_python = BoolProperty( + name="Filter python", + default=True, + options={'HIDDEN'}, + ) + + def execute(self, context): + if not self.filepath: + raise Exception("Filepath not set") + + if not self.filepath.endswith('.py'): + self.filepath += '.py' + + f = open(self.filepath, "w") + if not f: + raise Exception("Could not open file") + + wm = context.window_manager + kc = wm.keyconfigs.active + + f.write("import bpy\n") + f.write("import os\n\n") + f.write("wm = bpy.context.window_manager\n") + f.write("kc = wm.keyconfigs.new(os.path.splitext(os.path.basename(__file__))[0])\n\n") # keymap must be created by caller + + # Generate a list of keymaps to export: + # + # First add all user_modified keymaps (found in keyconfigs.user.keymaps list), + # then add all remaining keymaps from the currently active custom keyconfig. + # + # This will create a final list of keymaps that can be used as a 'diff' against + # the default blender keyconfig, recreating the current setup from a fresh blender + # without needing to export keymaps which haven't been edited. + + class FakeKeyConfig(): + keymaps = [] + edited_kc = FakeKeyConfig() + for km in wm.keyconfigs.user.keymaps: + if km.is_user_modified: + edited_kc.keymaps.append(km) + # merge edited keymaps with non-default keyconfig, if it exists + if kc != wm.keyconfigs.default: + export_keymaps = _merge_keymaps(edited_kc, kc) + else: + export_keymaps = _merge_keymaps(edited_kc, edited_kc) + + for km, kc_x in export_keymaps: + + km = km.active() + + f.write("# Map %s\n" % km.name) + f.write("km = kc.keymaps.new('%s', space_type='%s', region_type='%s', modal=%s)\n\n" % (km.name, km.space_type, km.region_type, km.is_modal)) + for kmi in km.keymap_items: + if km.is_modal: + f.write("kmi = km.keymap_items.new_modal('%s', '%s', '%s'" % (kmi.propvalue, kmi.type, kmi.value)) + else: + f.write("kmi = km.keymap_items.new('%s', '%s', '%s'" % (kmi.idname, kmi.type, kmi.value)) + if kmi.any: + f.write(", any=True") + else: + if kmi.shift: + f.write(", shift=True") + if kmi.ctrl: + f.write(", ctrl=True") + if kmi.alt: + f.write(", alt=True") + if kmi.oskey: + f.write(", oskey=True") + if kmi.key_modifier and kmi.key_modifier != 'NONE': + f.write(", key_modifier='%s'" % kmi.key_modifier) + f.write(")\n") + + props = kmi.properties + + if props is not None: + f.write("".join(export_properties("kmi.properties", props))) + + f.write("\n") + + f.close() + + return {'FINISHED'} + + def invoke(self, context, event): + wm = context.window_manager + wm.fileselect_add(self) + return {'RUNNING_MODAL'} + + +class WM_OT_keymap_restore(Operator): + "Restore key map(s)" + bl_idname = "wm.keymap_restore" + bl_label = "Restore Key Map(s)" + + all = BoolProperty( + name="All Keymaps", + description="Restore all keymaps to default", + ) + + def execute(self, context): + wm = context.window_manager + + if self.all: + for km in wm.keyconfigs.user.keymaps: + km.restore_to_default() + else: + km = context.keymap + km.restore_to_default() + + return {'FINISHED'} + + +class WM_OT_keyitem_restore(Operator): + "Restore key map item" + bl_idname = "wm.keyitem_restore" + bl_label = "Restore Key Map Item" + + item_id = IntProperty( + name="Item Identifier", + description="Identifier of the item to remove", + ) + + @classmethod + def poll(cls, context): + keymap = getattr(context, "keymap", None) + return keymap + + def execute(self, context): + km = context.keymap + kmi = km.keymap_items.from_id(self.item_id) + + if (not kmi.is_user_defined) and kmi.is_user_modified: + km.restore_item_to_default(kmi) + + return {'FINISHED'} + + +class WM_OT_keyitem_add(Operator): + "Add key map item" + bl_idname = "wm.keyitem_add" + bl_label = "Add Key Map Item" + + def execute(self, context): + km = context.keymap + + if km.is_modal: + km.keymap_items.new_modal("", 'A', 'PRESS') # kmi + else: + km.keymap_items.new("none", 'A', 'PRESS') # kmi + + # clear filter and expand keymap so we can see the newly added item + if context.space_data.filter_text != "": + context.space_data.filter_text = "" + km.show_expanded_items = True + km.show_expanded_children = True + + return {'FINISHED'} + + +class WM_OT_keyitem_remove(Operator): + "Remove key map item" + bl_idname = "wm.keyitem_remove" + bl_label = "Remove Key Map Item" + + item_id = IntProperty( + name="Item Identifier", + description="Identifier of the item to remove", + ) + + @classmethod + def poll(cls, context): + return hasattr(context, "keymap") + + def execute(self, context): + km = context.keymap + kmi = km.keymap_items.from_id(self.item_id) + km.keymap_items.remove(kmi) + return {'FINISHED'} + + +class WM_OT_keyconfig_remove(Operator): + "Remove key config" + bl_idname = "wm.keyconfig_remove" + bl_label = "Remove Key Config" + + @classmethod + def poll(cls, context): + wm = context.window_manager + keyconf = wm.keyconfigs.active + return keyconf and keyconf.is_user_defined + + def execute(self, context): + wm = context.window_manager + keyconfig = wm.keyconfigs.active + wm.keyconfigs.remove(keyconfig) + return {'FINISHED'} + + +class WM_OT_operator_cheat_sheet(Operator): + bl_idname = "wm.operator_cheat_sheet" + bl_label = "Operator Cheat Sheet" + + def execute(self, context): + op_strings = [] + tot = 0 + for op_module_name in dir(bpy.ops): + op_module = getattr(bpy.ops, op_module_name) + for op_submodule_name in dir(op_module): + op = getattr(op_module, op_submodule_name) + text = repr(op) + if text.split("\n")[-1].startswith('bpy.ops.'): + op_strings.append(text) + tot += 1 + + op_strings.append('') + + textblock = bpy.data.texts.new("OperatorList.txt") + textblock.write('# %d Operators\n\n' % tot) + textblock.write('\n'.join(op_strings)) + self.report({'INFO'}, "See OperatorList.txt textblock") + return {'FINISHED'} + + +class WM_OT_addon_enable(Operator): + "Enable an addon" + bl_idname = "wm.addon_enable" + bl_label = "Enable Add-On" + + module = StringProperty( + name="Module", + description="Module name of the addon to enable", + ) + + def execute(self, context): + import addon_utils + + mod = addon_utils.enable(self.module) + + if mod: + info = addon_utils.module_bl_info(mod) + + info_ver = info.get("blender", (0, 0, 0)) + + if info_ver > bpy.app.version: + self.report({'WARNING'}, ("This script was written Blender " + "version %d.%d.%d and might not " + "function (correctly), " + "though it is enabled") % + info_ver) + return {'FINISHED'} + else: + return {'CANCELLED'} + + +class WM_OT_addon_disable(Operator): + "Disable an addon" + bl_idname = "wm.addon_disable" + bl_label = "Disable Add-On" + + module = StringProperty( + name="Module", + description="Module name of the addon to disable", + ) + + def execute(self, context): + import addon_utils + + addon_utils.disable(self.module) + return {'FINISHED'} + + +class WM_OT_addon_install(Operator): + "Install an addon" + bl_idname = "wm.addon_install" + bl_label = "Install Add-On..." + + overwrite = BoolProperty( + name="Overwrite", + description="Remove existing addons with the same ID", + default=True, + ) + target = EnumProperty( + name="Target Path", + items=(('DEFAULT', "Default", ""), + ('PREFS', "User Prefs", "")), + ) + + filepath = StringProperty( + name="File Path", + description="File path to write file to", + ) + filter_folder = BoolProperty( + name="Filter folders", + default=True, + options={'HIDDEN'}, + ) + filter_python = BoolProperty( + name="Filter python", + default=True, + options={'HIDDEN'}, + ) + filter_glob = StringProperty( + default="*.py;*.zip", + options={'HIDDEN'}, + ) + + @staticmethod + def _module_remove(path_addons, module): + module = os.path.splitext(module)[0] + for f in os.listdir(path_addons): + f_base = os.path.splitext(f)[0] + if f_base == module: + f_full = os.path.join(path_addons, f) + + if os.path.isdir(f_full): + os.rmdir(f_full) + else: + os.remove(f_full) + + def execute(self, context): + import addon_utils + import traceback + import zipfile + import shutil + + pyfile = self.filepath + + if self.target == 'DEFAULT': + # dont use bpy.utils.script_paths("addons") because we may not be able to write to it. + path_addons = bpy.utils.user_resource('SCRIPTS', "addons", create=True) + else: + path_addons = bpy.context.user_preferences.filepaths.script_directory + if path_addons: + path_addons = os.path.join(path_addons, "addons") + + if not path_addons: + self.report({'ERROR'}, "Failed to get addons path") + return {'CANCELLED'} + + # create dir is if missing. + if not os.path.exists(path_addons): + os.makedirs(path_addons) + + # Check if we are installing from a target path, + # doing so causes 2+ addons of same name or when the same from/to + # location is used, removal of the file! + addon_path = "" + pyfile_dir = os.path.dirname(pyfile) + for addon_path in addon_utils.paths(): + if os.path.samefile(pyfile_dir, addon_path): + self.report({'ERROR'}, "Source file is in the addon search path: %r" % addon_path) + return {'CANCELLED'} + del addon_path + del pyfile_dir + # done checking for exceptional case + + addons_old = {mod.__name__ for mod in addon_utils.modules(addon_utils.addons_fake_modules)} + + #check to see if the file is in compressed format (.zip) + if zipfile.is_zipfile(pyfile): + try: + file_to_extract = zipfile.ZipFile(pyfile, 'r') + except: + traceback.print_exc() + return {'CANCELLED'} + + if self.overwrite: + for f in file_to_extract.namelist(): + WM_OT_addon_install._module_remove(path_addons, f) + else: + for f in file_to_extract.namelist(): + path_dest = os.path.join(path_addons, os.path.basename(f)) + if os.path.exists(path_dest): + self.report({'WARNING'}, "File already installed to %r\n" % path_dest) + return {'CANCELLED'} + + try: # extract the file to "addons" + file_to_extract.extractall(path_addons) + + # zip files can create this dir with metadata, don't need it + macosx_dir = os.path.join(path_addons, '__MACOSX') + if os.path.isdir(macosx_dir): + shutil.rmtree(macosx_dir) + + except: + traceback.print_exc() + return {'CANCELLED'} + + else: + path_dest = os.path.join(path_addons, os.path.basename(pyfile)) + + if self.overwrite: + WM_OT_addon_install._module_remove(path_addons, os.path.basename(pyfile)) + elif os.path.exists(path_dest): + self.report({'WARNING'}, "File already installed to %r\n" % path_dest) + return {'CANCELLED'} + + #if not compressed file just copy into the addon path + try: + shutil.copyfile(pyfile, path_dest) + + except: + traceback.print_exc() + return {'CANCELLED'} + + addons_new = {mod.__name__ for mod in addon_utils.modules(addon_utils.addons_fake_modules)} - addons_old + addons_new.discard("modules") + + # disable any addons we may have enabled previously and removed. + # this is unlikely but do just incase. bug [#23978] + for new_addon in addons_new: + addon_utils.disable(new_addon) + + # possible the zip contains multiple addons, we could disallow this + # but for now just use the first + for mod in addon_utils.modules(addon_utils.addons_fake_modules): + if mod.__name__ in addons_new: + info = addon_utils.module_bl_info(mod) + + # show the newly installed addon. + context.window_manager.addon_filter = 'All' + context.window_manager.addon_search = info["name"] + break + + # incase a new module path was created to install this addon. + bpy.utils.refresh_script_paths() + + # TODO, should not be a warning. + # self.report({'WARNING'}, "File installed to '%s'\n" % path_dest) + return {'FINISHED'} + + def invoke(self, context, event): + wm = context.window_manager + wm.fileselect_add(self) + return {'RUNNING_MODAL'} + + +class WM_OT_addon_remove(Operator): + "Disable an addon" + bl_idname = "wm.addon_remove" + bl_label = "Remove Add-On" + + module = StringProperty( + name="Module", + description="Module name of the addon to remove", + ) + + @staticmethod + def path_from_addon(module): + import addon_utils + + for mod in addon_utils.modules(addon_utils.addons_fake_modules): + if mod.__name__ == module: + filepath = mod.__file__ + if os.path.exists(filepath): + if os.path.splitext(os.path.basename(filepath))[0] == "__init__": + return os.path.dirname(filepath), True + else: + return filepath, False + return None, False + + def execute(self, context): + import addon_utils + + path, isdir = WM_OT_addon_remove.path_from_addon(self.module) + if path is None: + self.report('WARNING', "Addon path %r could not be found" % path) + return {'CANCELLED'} + + # incase its enabled + addon_utils.disable(self.module) + + import shutil + if isdir: + shutil.rmtree(path) + else: + os.remove(path) + + context.area.tag_redraw() + return {'FINISHED'} + + # lame confirmation check + def draw(self, context): + self.layout.label(text="Remove Addon: %r?" % self.module) + path, isdir = WM_OT_addon_remove.path_from_addon(self.module) + self.layout.label(text="Path: %r" % path) + + def invoke(self, context, event): + wm = context.window_manager + return wm.invoke_props_dialog(self, width=600) + + +class WM_OT_addon_expand(Operator): + "Display more information on this add-on" + bl_idname = "wm.addon_expand" + bl_label = "" + + module = StringProperty( + name="Module", + description="Module name of the addon to expand", + ) + + def execute(self, context): + import addon_utils + + module_name = self.module + + # unlikely to fail, module should have already been imported + try: + # mod = __import__(module_name) + mod = addon_utils.addons_fake_modules.get(module_name) + except: + import traceback + traceback.print_exc() + return {'CANCELLED'} + + info = addon_utils.module_bl_info(mod) + info["show_expanded"] = not info["show_expanded"] + return {'FINISHED'} |