diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-10-18 05:09:00 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-10-18 05:09:00 +0400 |
commit | 638a93b23550d9794230aabd52a9e6de7aa98979 (patch) | |
tree | 1771b971a3e694d190c4ebc222f23c077e7cae94 /release/scripts/modules | |
parent | ef1a1e14511db251793e9f92572817986c048696 (diff) | |
parent | dc907ef876b128c9767394d00dfc719d55ba077e (diff) |
svn merge ^/trunk/blender -r41075:41099
Diffstat (limited to 'release/scripts/modules')
-rw-r--r-- | release/scripts/modules/addon_utils.py | 10 | ||||
-rw-r--r-- | release/scripts/modules/animsys_refactor.py | 2 | ||||
-rwxr-xr-x | release/scripts/modules/blend_render_info.py | 2 | ||||
-rw-r--r-- | release/scripts/modules/bpy/__init__.py | 2 | ||||
-rw-r--r-- | release/scripts/modules/bpy/ops.py | 2 | ||||
-rw-r--r-- | release/scripts/modules/bpy/utils.py | 8 | ||||
-rw-r--r-- | release/scripts/modules/bpy_extras/anim_utils.py | 2 | ||||
-rw-r--r-- | release/scripts/modules/bpy_extras/image_utils.py | 6 | ||||
-rw-r--r-- | release/scripts/modules/bpy_extras/io_utils.py | 10 | ||||
-rw-r--r-- | release/scripts/modules/bpy_extras/keyconfig_utils.py | 2 | ||||
-rw-r--r-- | release/scripts/modules/bpy_extras/mesh_utils.py | 2 | ||||
-rw-r--r-- | release/scripts/modules/bpy_extras/object_utils.py | 2 | ||||
-rw-r--r-- | release/scripts/modules/bpy_extras/view3d_utils.py | 2 | ||||
-rw-r--r-- | release/scripts/modules/bpy_types.py | 18 | ||||
-rw-r--r-- | release/scripts/modules/console_python.py | 26 | ||||
-rw-r--r-- | release/scripts/modules/console_shell.py | 2 | ||||
-rw-r--r-- | release/scripts/modules/rna_info.py | 6 |
17 files changed, 52 insertions, 52 deletions
diff --git a/release/scripts/modules/addon_utils.py b/release/scripts/modules/addon_utils.py index ef9a4615ff2..26611fb93ad 100644 --- a/release/scripts/modules/addon_utils.py +++ b/release/scripts/modules/addon_utils.py @@ -165,7 +165,7 @@ def modules(module_cache): if mod: module_cache[mod_name] = mod - # just incase we get stale modules, not likely + # just in case we get stale modules, not likely for mod_stale in modules_stale: del module_cache[mod_stale] del modules_stale @@ -209,7 +209,7 @@ def enable(module_name, default_set=True): :arg module_name: The name of the addon and module. :type module_name: string - :return: the loaded module or None on failier. + :return: the loaded module or None on failure. :rtype: module """ @@ -262,7 +262,7 @@ def enable(module_name, default_set=True): # * OK loaded successfully! * if default_set: - # just incase its enabled alredy + # just in case its enabled already ext = _bpy.context.user_preferences.addons.get(module_name) if not ext: ext = _bpy.context.user_preferences.addons.new() @@ -286,7 +286,7 @@ def disable(module_name, default_set=True): import sys mod = sys.modules.get(module_name) - # possible this addon is from a previous session and didnt load a + # possible this addon is from a previous session and didn't load a # module this time. So even if the module is not found, still disable # the addon in the user prefs. if mod: @@ -300,7 +300,7 @@ def disable(module_name, default_set=True): else: print("addon_utils.disable", module_name, "not loaded") - # could be in more then once, unlikely but better do this just incase. + # could be in more then once, unlikely but better do this just in case. addons = _bpy.context.user_preferences.addons if default_set: diff --git a/release/scripts/modules/animsys_refactor.py b/release/scripts/modules/animsys_refactor.py index 88097ed3d28..64110b0f620 100644 --- a/release/scripts/modules/animsys_refactor.py +++ b/release/scripts/modules/animsys_refactor.py @@ -73,7 +73,7 @@ class DataPathBuilder(object): try: print("base." + item_new) base_new = eval("base." + item_new) - break # found, dont keep looking + break # found, don't keep looking except: pass diff --git a/release/scripts/modules/blend_render_info.py b/release/scripts/modules/blend_render_info.py index 43820e82340..7c30b480d6b 100755 --- a/release/scripts/modules/blend_render_info.py +++ b/release/scripts/modules/blend_render_info.py @@ -69,7 +69,7 @@ def read_blend_rend_chunk(path): struct.unpack('>i' if is_big_endian else '<i', blendfile.read(4))[0] sizeof_bhead_left -= 4 - # We dont care about the rest of the bhead struct + # We don't care about the rest of the bhead struct blendfile.read(sizeof_bhead_left) # Now we want the scene name, start and end frame. this is 32bites long diff --git a/release/scripts/modules/bpy/__init__.py b/release/scripts/modules/bpy/__init__.py index 5c371fd750a..5fe5cfd7cf4 100644 --- a/release/scripts/modules/bpy/__init__.py +++ b/release/scripts/modules/bpy/__init__.py @@ -56,7 +56,7 @@ def main(): # from bpy.types import Panel sys.modules["bpy.types"] = types - # if "-d" in sys.argv: # Enable this to measure startup speed + #~ if "-d" in sys.argv: # Enable this to measure start up speed if 0: import cProfile cProfile.run('import bpy; bpy.utils.load_scripts()', 'blender.prof') diff --git a/release/scripts/modules/bpy/ops.py b/release/scripts/modules/bpy/ops.py index ba9f6dafd19..382a47cb4e6 100644 --- a/release/scripts/modules/bpy/ops.py +++ b/release/scripts/modules/bpy/ops.py @@ -138,7 +138,7 @@ class BPyOpsSubModOp(object): @staticmethod def _scene_update(context): scene = context.scene - if scene: # None in backgroud mode + if scene: # None in background mode scene.update() else: import bpy diff --git a/release/scripts/modules/bpy/utils.py b/release/scripts/modules/bpy/utils.py index fdd22f403a4..6eb16bd7e7a 100644 --- a/release/scripts/modules/bpy/utils.py +++ b/release/scripts/modules/bpy/utils.py @@ -142,9 +142,9 @@ def load_scripts(reload_scripts=False, refresh_scripts=False): if reload_scripts: _bpy_types.TypeMap.clear() - # just unload, dont change user defaults, this means we can sync + # just unload, don't change user defaults, this means we can sync # to reload. note that they will only actually reload of the - # modification time changes. This `wont` work for packages so... + # modification time changes. This `won't` work for packages so... # its not perfect. for module_name in [ext.module for ext in prefs.addons]: _addon_utils.disable(module_name, default_set=False) @@ -220,7 +220,7 @@ def load_scripts(reload_scripts=False, refresh_scripts=False): if _os.path.isdir(path): _sys_path_ensure(path) - # only add this to sys.modules, dont run + # only add this to sys.modules, don't run if path_subdir == "modules": continue @@ -374,7 +374,7 @@ def smpte_from_seconds(time, fps=None): if time >= 3600.0: # hours hours = int(time / 3600.0) time = time % 3600.0 - if time >= 60.0: # mins + if time >= 60.0: # minutes minutes = int(time / 60.0) time = time % 60.0 diff --git a/release/scripts/modules/bpy_extras/anim_utils.py b/release/scripts/modules/bpy_extras/anim_utils.py index 9848586a144..6b0ab1c3adc 100644 --- a/release/scripts/modules/bpy_extras/anim_utils.py +++ b/release/scripts/modules/bpy_extras/anim_utils.py @@ -158,7 +158,7 @@ def bake_action(frame_start, # ------------------------------------------------------------------------- # Create action - # incase animation data hassnt been created + # in case animation data hassnt been created atd = obj.animation_data_create() if action is None: action = bpy.data.actions.new("Action") diff --git a/release/scripts/modules/bpy_extras/image_utils.py b/release/scripts/modules/bpy_extras/image_utils.py index 02959fae534..52050b08bc7 100644 --- a/release/scripts/modules/bpy_extras/image_utils.py +++ b/release/scripts/modules/bpy_extras/image_utils.py @@ -43,10 +43,10 @@ def load_image(imagepath, the end will be ignored. :type dirname: string :arg place_holder: if True a new place holder image will be created. - this is usefull so later you can relink the image to its original data. + this is useful so later you can relink the image to its original data. :type place_holder: bool - :arg recursive: If True, directories will be recursivly searched. - Be carefull with this if you have files in your root directory because + :arg recursive: If True, directories will be recursively searched. + Be careful with this if you have files in your root directory because it may take a long time. :type recursive: bool :arg ncase_cmp: on non windows systems, find the correct case for the file. diff --git a/release/scripts/modules/bpy_extras/io_utils.py b/release/scripts/modules/bpy_extras/io_utils.py index 5d28ceaa34c..3d71feaf79e 100644 --- a/release/scripts/modules/bpy_extras/io_utils.py +++ b/release/scripts/modules/bpy_extras/io_utils.py @@ -114,7 +114,7 @@ class ImportHelper: # Axis conversion function, not pretty LUT -# use lookup tabes to convert between any axis +# use lookup table to convert between any axis _axis_convert_matrix = ( ((-1.0, 0.0, 0.0), (0.0, -1.0, 0.0), (0.0, 0.0, 1.0)), ((-1.0, 0.0, 0.0), (0.0, 0.0, -1.0), (0.0, -1.0, 0.0)), @@ -302,7 +302,7 @@ def free_derived_objects(ob): def unpack_list(list_of_tuples): flat_list = [] - flat_list_extend = flat_list.extend # a tich faster + flat_list_extend = flat_list.extend # a tiny bit faster for t in list_of_tuples: flat_list_extend(t) return flat_list @@ -318,7 +318,7 @@ def unpack_face_list(list_of_tuples): if len(t) == 3: if t[2] == 0: t = t[1], t[2], t[0] - else: # assuem quad + else: # assume quad if t[3] == 0 or t[2] == 0: t = t[2], t[3], t[0], t[1] @@ -371,7 +371,7 @@ def path_reference(filepath, :arg copy_subdir: the subdirectory of *base_dst* to use when mode='COPY'. :type copy_subdir: string :arg copy_set: collect from/to pairs when mode='COPY', - pass to *path_reference_copy* when exportign is done. + pass to *path_reference_copy* when exporting is done. :type copy_set: set :arg library: The library this path is relative to. :type library: :class:`bpy.types.Library` or None @@ -450,7 +450,7 @@ def unique_name(key, name, name_dict, name_max=-1, clean_func=None, sep="."): :arg key: unique item this name belongs to, name_dict[key] will be reused when available. This can be the object, mesh, material, etc instance its self. - :type key: any hashable object assosiated with the *name*. + :type key: any hashable object associated with the *name*. :arg name: The name used to create a unique value in *name_dict*. :type name: string :arg name_dict: This is used to cache namespace to ensure no collisions diff --git a/release/scripts/modules/bpy_extras/keyconfig_utils.py b/release/scripts/modules/bpy_extras/keyconfig_utils.py index 78f010245a0..6eb19c0ff05 100644 --- a/release/scripts/modules/bpy_extras/keyconfig_utils.py +++ b/release/scripts/modules/bpy_extras/keyconfig_utils.py @@ -21,7 +21,7 @@ KM_HIERARCHY = [ ('Window', 'EMPTY', 'WINDOW', []), # file save, window change, exit ('Screen', 'EMPTY', 'WINDOW', [ # full screen, undo, screenshot - ('Screen Editing', 'EMPTY', 'WINDOW', []), # resizing, action corners + ('Screen Editing', 'EMPTY', 'WINDOW', []), # re-sizing, action corners ]), ('View2D', 'EMPTY', 'WINDOW', []), # view 2d navigation (per region) diff --git a/release/scripts/modules/bpy_extras/mesh_utils.py b/release/scripts/modules/bpy_extras/mesh_utils.py index 7bc6dae3cc6..8149675000f 100644 --- a/release/scripts/modules/bpy_extras/mesh_utils.py +++ b/release/scripts/modules/bpy_extras/mesh_utils.py @@ -50,7 +50,7 @@ def mesh_linked_faces(mesh): face_groups = [[f] for f in mesh.faces] face_mapping = list(range(len(mesh.faces))) # map old, new face location - # Now clump faces iterativly + # Now clump faces iteratively ok = True while ok: ok = False diff --git a/release/scripts/modules/bpy_extras/object_utils.py b/release/scripts/modules/bpy_extras/object_utils.py index 3081e6f172e..c9c1dc05476 100644 --- a/release/scripts/modules/bpy_extras/object_utils.py +++ b/release/scripts/modules/bpy_extras/object_utils.py @@ -119,7 +119,7 @@ def object_data_add(context, obdata, operator=None): obj_act = scene.objects.active # XXX - # caused because entering editmodedoes not add a empty undo slot! + # caused because entering edit-mode does not add a empty undo slot! if context.user_preferences.edit.use_enter_edit_mode: if not (obj_act and obj_act.mode == 'EDIT' and diff --git a/release/scripts/modules/bpy_extras/view3d_utils.py b/release/scripts/modules/bpy_extras/view3d_utils.py index c18a74bbb09..32f7b654690 100644 --- a/release/scripts/modules/bpy_extras/view3d_utils.py +++ b/release/scripts/modules/bpy_extras/view3d_utils.py @@ -27,7 +27,7 @@ __all__ = ( def region_2d_to_vector_3d(region, rv3d, coord): """ - Return a direction vector from the viewport at the spesific 2d region + Return a direction vector from the viewport at the specific 2d region coordinate. :arg region: region of the 3D viewport, typically bpy.context.region. diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index ae533186dbf..98e3bc25d80 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -49,7 +49,7 @@ class Library(bpy_types.ID): @property def users_id(self): - """ID datablocks which use this library""" + """ID data blocks which use this library""" import bpy # See: readblenentry.c, IDTYPE_FLAGS_ISLINKABLE, we could make this an attribute in rna. @@ -220,9 +220,9 @@ class _GenericBone: @property def children_recursive_basename(self): """ - Returns a chain of children with the same base name as this bone - Only direct chains are supported, forks caused by multiple children with matching basenames will - terminate the function and not be returned. + Returns a chain of children with the same base name as this bone. + Only direct chains are supported, forks caused by multiple children + with matching base names will terminate the function and not be returned. """ basename = self.basename chain = [] @@ -256,7 +256,7 @@ class _GenericBone: bones = id_data.pose.bones elif id_data_type == bpy_types.Armature: bones = id_data.edit_bones - if not bones: # not in editmode + if not bones: # not in edit mode bones = id_data.bones return bones @@ -284,11 +284,11 @@ class EditBone(StructRNA, _GenericBone, metaclass=StructMetaPropGroup): def transform(self, matrix, scale=True, roll=True): """ - Transform the the bones head, tail, roll and envalope (when the matrix has a scale component). + Transform the the bones head, tail, roll and envelope (when the matrix has a scale component). :arg matrix: 3x3 or 4x4 transformation matrix. :type matrix: :class:`mathutils.Matrix` - :arg scale: Scale the bone envalope by the matrix. + :arg scale: Scale the bone envelope by the matrix. :type scale: bool :arg roll: Correct the roll to point in the same relative direction to the head and tail. :type roll: bool @@ -318,7 +318,7 @@ class Mesh(bpy_types.ID): def from_pydata(self, vertices, edges, faces): """ - Make a mesh from a list of verts/edges/faces + Make a mesh from a list of vertices/edges/faces Until we have a nicer way to make geometry, use this. :arg vertices: float triplets each representing (X, Y, Z) eg: [(0.0, 1.0, 0.5), ...]. @@ -550,7 +550,7 @@ class _GenericUI: operator_context_default = self.layout.operator_context for func in draw_ls._draw_funcs: - # so bad menu functions dont stop the entire menu from drawing. + # so bad menu functions don't stop the entire menu from drawing try: func(self, context) except: diff --git a/release/scripts/modules/console_python.py b/release/scripts/modules/console_python.py index 94d0c8c8614..f11ccf84f0b 100644 --- a/release/scripts/modules/console_python.py +++ b/release/scripts/modules/console_python.py @@ -50,7 +50,7 @@ def replace_help(namespace): def get_console(console_id): ''' helper function for console operators - currently each text datablock gets its own + currently each text data block gets its own console - code.InteractiveConsole() ...which is stored in this function. @@ -65,7 +65,7 @@ def get_console(console_id): consoles = get_console.consoles = {} get_console.consoles_namespace_hash = hash_next else: - # check if clearning the namespace is needed to avoid a memory leak. + # check if clearing the namespace is needed to avoid a memory leak. # the window manager is normally loaded with new blend files # so this is a reasonable way to deal with namespace clearing. # bpy.data hashing is reset by undo so cant be used. @@ -135,7 +135,7 @@ def execute(context): sys.stdout = stdout sys.stderr = stderr - # dont allow the stdin to be used, can lock blender. + # don't allow the stdin to be used, can lock blender. stdin_backup = sys.stdin sys.stdin = None @@ -143,14 +143,14 @@ def execute(context): main_mod_back = sys.modules["__main__"] sys.modules["__main__"] = console._bpy_main_mod - # incase exception happens - line = "" # incase of encodingf error + # in case exception happens + line = "" # in case of encoding error is_multiline = False try: line = line_object.body - # run the console, "\n" executes a multiline statement + # run the console, "\n" executes a multi line statement line_exec = line if line.strip() else "\n" is_multiline = console.push(line_exec) @@ -222,8 +222,8 @@ def autocomplete(context): if not console: return {'CANCELLED'} - # dont allow the stdin to be used, can lock blender. - # note: unlikely stdin would be used for autocomp. but its possible. + # don't allow the stdin to be used, can lock blender. + # note: unlikely stdin would be used for autocomplete. but its possible. stdin_backup = sys.stdin sys.stdin = None @@ -238,8 +238,8 @@ def autocomplete(context): current_line = sc.history[-1] line = current_line.body - # This function isnt aware of the text editor or being an operator - # just does the autocomp then copy its results back + # This function isn't aware of the text editor or being an operator + # just does the autocomplete then copy its results back result = intellisense.expand( line=line, cursor=current_line.current_character, @@ -250,7 +250,7 @@ def autocomplete(context): current_line.body, current_line.current_character, scrollback = result del result - # update sel. setting body should really do this! + # update selection. setting body should really do this! ofs = len(line_new) - len(line) sc.select_start += ofs sc.select_end += ofs @@ -263,12 +263,12 @@ def autocomplete(context): if _BPY_MAIN_OWN: sys.modules["__main__"] = main_mod_back - # Separate automplete output by command prompts + # Separate autocomplete output by command prompts if scrollback != '': bpy.ops.console.scrollback_append(text=sc.prompt + current_line.body, type='INPUT') # Now we need to copy back the line from blender back into the - # text editor. This will change when we dont use the text editor + # text editor. This will change when we don't use the text editor # anymore if scrollback: add_scrollback(scrollback, 'INFO') diff --git a/release/scripts/modules/console_shell.py b/release/scripts/modules/console_shell.py index 7a6f45c426f..772d46c8bf3 100644 --- a/release/scripts/modules/console_shell.py +++ b/release/scripts/modules/console_shell.py @@ -64,7 +64,7 @@ def execute(context): def autocomplete(context): - # sc = context.space_data + #~ sc = context.space_data # TODO return {'CANCELLED'} diff --git a/release/scripts/modules/rna_info.py b/release/scripts/modules/rna_info.py index d95c3920cf9..4116bfda0c7 100644 --- a/release/scripts/modules/rna_info.py +++ b/release/scripts/modules/rna_info.py @@ -292,7 +292,7 @@ class InfoPropertyRNA: elif as_arg: if not self.is_required: type_info.append("optional") - else: # readonly is only useful for selfs, not args + else: # readonly is only useful for self's, not args if self.is_readonly: type_info.append("readonly") @@ -519,7 +519,7 @@ def BuildRNAInfo(): # Done ordering structs - # precalc vars to avoid a lot of looping + # precalculate vars to avoid a lot of looping for (rna_base, identifier, rna_struct) in structs: # rna_struct_path = full_rna_struct_path(rna_struct) @@ -634,7 +634,7 @@ if __name__ == "__main__": struct = rna_info.BuildRNAInfo()[0] data = [] for struct_id, v in sorted(struct.items()): - struct_id_str = v.identifier # "".join(sid for sid in struct_id if struct_id) + struct_id_str = v.identifier #~ "".join(sid for sid in struct_id if struct_id) for base in v.get_bases(): struct_id_str = base.identifier + "|" + struct_id_str |