diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-04 12:27:25 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-04 12:27:25 +0300 |
commit | 736a7b7a2280a843686b7699fc9d96915801a459 (patch) | |
tree | c3e584113a39628225d9b2cac16d414258a5921a /release | |
parent | f0eb3b56de1456b973098640b7eda47c7e1d58a0 (diff) |
pep8 cleanup
Diffstat (limited to 'release')
-rwxr-xr-x | release/bin/blender-thumbnailer.py | 2 | ||||
-rw-r--r-- | release/scripts/keyingsets/keyingsets_builtins.py | 134 | ||||
-rw-r--r-- | release/scripts/keyingsets/keyingsets_utils.py | 82 | ||||
-rw-r--r-- | release/scripts/op/fcurve_euler_filter.py | 42 | ||||
-rw-r--r-- | release/scripts/presets/ffmpeg/DVD.py | 2 | ||||
-rw-r--r-- | release/scripts/presets/ffmpeg/SVCD.py | 2 | ||||
-rw-r--r-- | release/scripts/presets/ffmpeg/VCD.py | 2 | ||||
-rw-r--r-- | release/scripts/presets/ffmpeg/h264.py | 2 | ||||
-rw-r--r-- | release/scripts/presets/ffmpeg/theora.py | 2 | ||||
-rw-r--r-- | release/scripts/presets/ffmpeg/xvid.py | 2 | ||||
-rw-r--r-- | release/scripts/presets/sss/apple.py | 2 | ||||
-rw-r--r-- | release/scripts/ui/properties_physics_common.py | 29 | ||||
-rw-r--r-- | release/scripts/ui/properties_physics_field.py | 2 | ||||
-rw-r--r-- | release/scripts/ui/properties_render.py | 12 | ||||
-rw-r--r-- | release/scripts/ui/space_dopesheet.py | 10 | ||||
-rw-r--r-- | release/scripts/ui/space_node.py | 6 | ||||
-rw-r--r-- | release/scripts/ui/space_view3d_toolbar.py | 8 |
17 files changed, 209 insertions, 132 deletions
diff --git a/release/bin/blender-thumbnailer.py b/release/bin/blender-thumbnailer.py index 16a89d29724..8c95a001c5d 100755 --- a/release/bin/blender-thumbnailer.py +++ b/release/bin/blender-thumbnailer.py @@ -18,6 +18,8 @@ # # ##### END GPL LICENSE BLOCK ##### +# <pep8 compliant> + """ Thumbnailer runs with python 2.6 and 3.x. To run automatically with nautilus: diff --git a/release/scripts/keyingsets/keyingsets_builtins.py b/release/scripts/keyingsets/keyingsets_builtins.py index 8a10342d6a5..2a6bd682bf7 100644 --- a/release/scripts/keyingsets/keyingsets_builtins.py +++ b/release/scripts/keyingsets/keyingsets_builtins.py @@ -1,7 +1,29 @@ -# Built-In Keying Sets -# None of these Keying Sets should be removed, as these -# are needed by various parts of Blender in order for them -# to work correctly. +# ##### 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> + +""" +Built-In Keying Sets +None of these Keying Sets should be removed, as these +are needed by various parts of Blender in order for them +to work correctly. +""" import bpy from keyingsets_utils import * @@ -9,6 +31,7 @@ from keyingsets_utils import * ############################### # Built-In KeyingSets + # Location class BUILTIN_KSI_Location(bpy.types.KeyingSetInfo): bl_label = "Location" @@ -19,9 +42,10 @@ class BUILTIN_KSI_Location(bpy.types.KeyingSetInfo): # iterator - use callback for selected bones/objects iterator = RKS_ITER_selected_item - # generator - use callback for location + # generator - use callback for location generate = RKS_GEN_location + # Rotation class BUILTIN_KSI_Rotation(bpy.types.KeyingSetInfo): bl_label = "Rotation" @@ -32,9 +56,10 @@ class BUILTIN_KSI_Rotation(bpy.types.KeyingSetInfo): # iterator - use callback for selected bones/objects iterator = RKS_ITER_selected_item - # generator - use callback for location + # generator - use callback for location generate = RKS_GEN_rotation + # Scale class BUILTIN_KSI_Scaling(bpy.types.KeyingSetInfo): bl_label = "Scaling" @@ -45,11 +70,12 @@ class BUILTIN_KSI_Scaling(bpy.types.KeyingSetInfo): # iterator - use callback for selected bones/objects iterator = RKS_ITER_selected_item - # generator - use callback for location + # generator - use callback for location generate = RKS_GEN_scaling # ------------ + # LocRot class BUILTIN_KSI_LocRot(bpy.types.KeyingSetInfo): bl_label = "LocRot" @@ -60,13 +86,14 @@ class BUILTIN_KSI_LocRot(bpy.types.KeyingSetInfo): # iterator - use callback for selected bones/objects iterator = RKS_ITER_selected_item - # generator + # generator def generate(self, context, ks, data): # location RKS_GEN_location(self, context, ks, data) # rotation RKS_GEN_rotation(self, context, ks, data) + # LocScale class BUILTIN_KSI_LocScale(bpy.types.KeyingSetInfo): bl_label = "LocScale" @@ -77,13 +104,14 @@ class BUILTIN_KSI_LocScale(bpy.types.KeyingSetInfo): # iterator - use callback for selected bones/objects iterator = RKS_ITER_selected_item - # generator + # generator def generate(self, context, ks, data): # location RKS_GEN_location(self, context, ks, data) # scale RKS_GEN_scaling(self, context, ks, data) + # LocRotScale class BUILTIN_KSI_LocRotScale(bpy.types.KeyingSetInfo): bl_label = "LocRotScale" @@ -94,7 +122,7 @@ class BUILTIN_KSI_LocRotScale(bpy.types.KeyingSetInfo): # iterator - use callback for selected bones/objects iterator = RKS_ITER_selected_item - # generator + # generator def generate(self, context, ks, data): # location RKS_GEN_location(self, context, ks, data) @@ -103,6 +131,7 @@ class BUILTIN_KSI_LocRotScale(bpy.types.KeyingSetInfo): # scale RKS_GEN_scaling(self, context, ks, data) + # RotScale class BUILTIN_KSI_RotScale(bpy.types.KeyingSetInfo): bl_label = "RotScale" @@ -113,15 +142,16 @@ class BUILTIN_KSI_RotScale(bpy.types.KeyingSetInfo): # iterator - use callback for selected bones/objects iterator = RKS_ITER_selected_item - # generator + # generator def generate(self, context, ks, data): # rotation RKS_GEN_rotation(self, context, ks, data) # scaling RKS_GEN_scaling(self, context, ks, data) - + # ------------ + # Location class BUILTIN_KSI_VisualLoc(bpy.types.KeyingSetInfo): bl_label = "Visual Location" @@ -134,9 +164,10 @@ class BUILTIN_KSI_VisualLoc(bpy.types.KeyingSetInfo): # iterator - use callback for selected bones/objects iterator = RKS_ITER_selected_item - # generator - use callback for location + # generator - use callback for location generate = RKS_GEN_location + # Rotation class BUILTIN_KSI_VisualRot(bpy.types.KeyingSetInfo): bl_label = "Visual Rotation" @@ -149,9 +180,10 @@ class BUILTIN_KSI_VisualRot(bpy.types.KeyingSetInfo): # iterator - use callback for selected bones/objects iterator = RKS_ITER_selected_item - # generator - use callback for rotation + # generator - use callback for rotation generate = RKS_GEN_rotation + # VisualLocRot class BUILTIN_KSI_VisualLocRot(bpy.types.KeyingSetInfo): bl_label = "Visual LocRot" @@ -164,7 +196,7 @@ class BUILTIN_KSI_VisualLocRot(bpy.types.KeyingSetInfo): # iterator - use callback for selected bones/objects iterator = RKS_ITER_selected_item - # generator + # generator def generate(self, context, ks, data): # location RKS_GEN_location(self, context, ks, data) @@ -173,39 +205,41 @@ class BUILTIN_KSI_VisualLocRot(bpy.types.KeyingSetInfo): # ------------ + # Available class BUILTIN_KSI_Available(bpy.types.KeyingSetInfo): bl_label = "Available" # poll - use predefined callback for selected objects - # TODO: this should really check whether the selected object (or datablock) + # TODO: this should really check whether the selected object (or datablock) # has any animation data defined yet poll = RKS_POLL_selected_objects # iterator - use callback for selected bones/objects iterator = RKS_ITER_selected_item - # generator - use callback for doing this + # generator - use callback for doing this generate = RKS_GEN_available -############################### +############################### + # All properties that are likely to get animated in a character rig class BUILTIN_KSI_WholeCharacter(bpy.types.KeyingSetInfo): bl_label = "Whole Character" - + # these prefixes should be avoided, as they are not really bones # that animators should be touching (or need to touch) badBonePrefixes = ( - 'DEF', - 'GEO', - 'MCH', + 'DEF', + 'GEO', + 'MCH', 'ORG', 'COR', 'VIS', # ... more can be added here as you need in your own rigs ... ) - + # poll - pose-mode on active object only def poll(ksi, context): return ((context.active_object) and (context.active_object.pose) and @@ -221,39 +255,39 @@ class BUILTIN_KSI_WholeCharacter(bpy.types.KeyingSetInfo): def generate(ksi, context, ks, bone): # loc, rot, scale - only include unlocked ones ksi.doLoc(ks, bone) - + if bone.rotation_mode in ('QUATERNION', 'AXIS_ANGLE'): ksi.doRot4d(ks, bone) else: ksi.doRot3d(ks, bone) ksi.doScale(ks, bone) - + # custom props? ksi.doCustomProps(ks, bone) - + # ---------------- - + # helper to add some bone's property to the Keying Set - def addProp(ksi, ks, bone, prop, index=-1, use_groups=True): + def addProp(ksi, ks, bone, prop, index=-1, use_groups=True): # add the property name to the base path id_path = bone.path_from_id() id_block = bone.id_data - - if prop.startswith('['): + + if prop.startswith('['): # custom properties path = id_path + prop - else: + else: # standard transforms/properties path = path_add_property(id_path, prop) - + # add Keying Set entry for this... if use_groups: ks.paths.add(id_block, path, index, group_method='NAMED', group_name=bone.name) else: ks.paths.add(id_block, path, index) - + # ---------------- - + # location properties def doLoc(ksi, ks, bone): if bone.lock_location == (False, False, False): @@ -262,7 +296,7 @@ class BUILTIN_KSI_WholeCharacter(bpy.types.KeyingSetInfo): for i in range(3): if not bone.lock_location[i]: ksi.addProp(ks, bone, "location", i) - + # rotation properties def doRot4d(ksi, ks, bone): # rotation mode affects the property used @@ -270,7 +304,7 @@ class BUILTIN_KSI_WholeCharacter(bpy.types.KeyingSetInfo): prop = "rotation_quaternion" elif bone.rotation_mode == 'AXIS_ANGLE': prop = "rotation_axis_angle" - + # add rotation properties if they will if bone.lock_rotations_4d: # can check individually @@ -278,16 +312,16 @@ class BUILTIN_KSI_WholeCharacter(bpy.types.KeyingSetInfo): ksi.addProp(ks, bone, prop) else: if bone.lock_rotation_w == False: - ksi.addProp(ks, bone, prop, 0) # w = 0 - + ksi.addProp(ks, bone, prop, 0) # w = 0 + for i in range(3): if not bone.lock_rotation[i]: - ksi.addProp(ks, bone, prop, i+1) # i+1, since here x,y,z = 1,2,3, and w=0 + ksi.addProp(ks, bone, prop, i + 1) # i + 1, since here x,y,z = 1,2,3, and w=0 elif True not in bone.lock_rotation: - # if axis-angle rotations get locked as eulers, then it's too messy to allow anything + # if axis-angle rotations get locked as eulers, then it's too messy to allow anything # other than all open unless we keyframe the whole lot ksi.addProp(ks, bone, prop) - + def doRot3d(ksi, ks, bone): if bone.lock_rotation == (False, False, False): ksi.addProp(ks, bone, "rotation_euler") @@ -295,30 +329,30 @@ class BUILTIN_KSI_WholeCharacter(bpy.types.KeyingSetInfo): for i in range(3): if not bone.lock_rotation[i]: ksi.addProp(ks, bone, "rotation_euler", i) - + # scale properties def doScale(ksi, ks, bone): - if bone.lock_scale == (0,0,0): + if bone.lock_scale == (0, 0, 0): ksi.addProp(ks, bone, "scale") else: for i in range(3): if not bone.lock_scale[i]: ksi.addProp(ks, bone, "scale", i) - + # ---------------- - + # custom properties def doCustomProps(ksi, ks, bone): # go over all custom properties for bone - for prop,val in bone.items(): + for prop, val in bone.items(): # ignore special "_RNA_UI" used for UI editing if prop == "_RNA_UI": continue - + # for now, just add all of 'em ksi.addProp(ks, bone, '["%s"]' % (prop)) -############################### +############################### classes = [ BUILTIN_KSI_Location, @@ -329,7 +363,7 @@ classes = [ BUILTIN_KSI_LocScale, BUILTIN_KSI_LocRotScale, BUILTIN_KSI_RotScale, - + BUILTIN_KSI_WholeCharacter, BUILTIN_KSI_VisualLoc, @@ -354,4 +388,4 @@ def unregister(): if __name__ == "__main__": register() -############################### +############################### diff --git a/release/scripts/keyingsets/keyingsets_utils.py b/release/scripts/keyingsets/keyingsets_utils.py index 953cff9e01e..630ac12dc7b 100644 --- a/release/scripts/keyingsets/keyingsets_utils.py +++ b/release/scripts/keyingsets/keyingsets_utils.py @@ -1,45 +1,51 @@ -# This file defines a set of methods that are useful for various +# This file defines a set of methods that are useful for various # Relative Keying Set (RKS) related operations, such as: callbacks -# for polling, iterator callbacks, and also generate callbacks. -# All of these can be used in conjunction with the others. +# for polling, iterator callbacks, and also generate callbacks. +# All of these can be used in conjunction with the others. + +# <pep8 compliant> import bpy ########################### # General Utilities + # Append the specified property name on the the existing path def path_add_property(path, prop): if len(path): - return path + "." + prop; + return path + "." + prop else: - return prop; + return prop ########################### # Poll Callbacks + # selected objects def RKS_POLL_selected_objects(ksi, context): - return context.active_object or len(context.selected_objects); - + return context.active_object or len(context.selected_objects) + + # selected bones def RKS_POLL_selected_bones(ksi, context): - # we must be in Pose Mode, and there must be some bones selected + # we must be in Pose Mode, and there must be some bones selected if (context.active_object) and (context.active_object.mode == 'POSE'): if context.active_pose_bone or len(context.selected_pose_bones): - return True; - - # nothing selected - return False; + return True + + # nothing selected + return False # selected bones or objects def RKS_POLL_selected_items(ksi, context): - return RKS_POLL_selected_bones(ksi, context) or RKS_POLL_selected_objects(ksi, context); + return RKS_POLL_selected_bones(ksi, context) or RKS_POLL_selected_objects(ksi, context) ########################### # Iterator Callbacks + # all selected objects or pose bones, depending on which we've got def RKS_ITER_selected_item(ksi, context, ks): if (context.active_object) and (context.active_object.mode == 'POSE'): @@ -52,25 +58,26 @@ def RKS_ITER_selected_item(ksi, context, ks): ########################### # Generate Callbacks + # 'Available' F-Curves def RKS_GEN_available(ksi, context, ks, data): - # try to get the animation data associated with the closest + # try to get the animation data associated with the closest # ID-block to the data (neither of which may exist/be easy to find) id_block = data.id_data adt = getattr(id_block, "animation_data", None) # there must also be an active action... if adt is None or adt.action is None: - return; - - # if we haven't got an ID-block as 'data', try to restrict + return + + # if we haven't got an ID-block as 'data', try to restrict # paths added to only those which branch off from here # i.e. for bones if id_block != data: basePath = data.path_from_id() else: - basePath = None; # this is not needed... - + basePath = None # this is not needed... + # for each F-Curve, include a path to key it # NOTE: we don't need to set the group settings here for fcu in adt.action.fcurves: @@ -79,19 +86,20 @@ def RKS_GEN_available(ksi, context, ks, data): ks.paths.add(id_block, fcu.data_path, index=fcu.array_index) else: ks.paths.add(id_block, fcu.data_path, index=fcu.array_index) - + # ------ + # get ID block and based ID path for transform generators def get_transform_generators_base_info(data): - # ID-block for the data + # ID-block for the data id_block = data.id_data - + # get base path and grouping method/name if isinstance(data, bpy.types.ID): # no path in this case path = "" - + # data on ID-blocks directly should get grouped by the KeyingSet grouping = None else: @@ -101,29 +109,31 @@ def get_transform_generators_base_info(data): # try to use the name of the data element to group the F-Curve # else fallback on the KeyingSet name grouping = getattr(data, "name", None) - + # return the ID-block and the path return id_block, path, grouping -# Location + +# Location def RKS_GEN_location(ksi, context, ks, data): # get id-block and path info id_block, base_path, grouping = get_transform_generators_base_info(data) - + # add the property name to the base path path = path_add_property(base_path, "location") - + # add Keying Set entry for this... if grouping: ks.paths.add(id_block, path, group_method='NAMED', group_name=grouping) else: ks.paths.add(id_block, path) -# Rotation + +# Rotation def RKS_GEN_rotation(ksi, context, ks, data): # get id-block and path info - id_block, base_path, grouping= get_transform_generators_base_info(data) - + id_block, base_path, grouping = get_transform_generators_base_info(data) + # add the property name to the base path # rotation mode affects the property used if data.rotation_mode == 'QUATERNION': @@ -132,21 +142,22 @@ def RKS_GEN_rotation(ksi, context, ks, data): path = path_add_property(base_path, "rotation_axis_angle") else: path = path_add_property(base_path, "rotation_euler") - + # add Keying Set entry for this... if grouping: ks.paths.add(id_block, path, group_method='NAMED', group_name=grouping) else: ks.paths.add(id_block, path) -# Scaling + +# Scaling def RKS_GEN_scaling(ksi, context, ks, data): # get id-block and path info - id_block, base_path, grouping= get_transform_generators_base_info(data) - + id_block, base_path, grouping = get_transform_generators_base_info(data) + # add the property name to the base path path = path_add_property(base_path, "scale") - + # add Keying Set entry for this... if grouping: ks.paths.add(id_block, path, group_method='NAMED', group_name=grouping) @@ -158,6 +169,7 @@ def RKS_GEN_scaling(ksi, context, ks, data): classes = [] + def register(): pass diff --git a/release/scripts/op/fcurve_euler_filter.py b/release/scripts/op/fcurve_euler_filter.py index b396fa0562f..0e7f0b69eca 100644 --- a/release/scripts/op/fcurve_euler_filter.py +++ b/release/scripts/op/fcurve_euler_filter.py @@ -1,7 +1,28 @@ +# ##### 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> + from math import * import bpy from mathutils import * + def main(context): def cleanupEulCurve(fcv): keys = [] @@ -12,37 +33,38 @@ def main(context): for i in range(len(keys)): cur = keys[i] - prev = keys[i-1] if i > 0 else None - next = keys[i+1] if i < len(keys)-1 else None + prev = keys[i - 1] if i > 0 else None + next = keys[i + 1] if i < len(keys) - 1 else None if prev is None: continue th = pi - if abs(prev[1][1] - cur[1][1]) >= th: # more than 180 degree jump - fac = pi*2 + if abs(prev[1][1] - cur[1][1]) >= th: # more than 180 degree jump + fac = pi * 2.0 if prev[1][1] > cur[1][1]: - while abs(cur[1][1]-prev[1][1]) >= th: # < prev[1][1]: + while abs(cur[1][1] - prev[1][1]) >= th: # < prev[1][1]: cur[0][1] += fac cur[1][1] += fac cur[2][1] += fac elif prev[1][1] < cur[1][1]: - while abs(cur[1][1]-prev[1][1]) >= th: + while abs(cur[1][1] - prev[1][1]) >= th: cur[0][1] -= fac cur[1][1] -= fac cur[2][1] -= fac for i in range(len(keys)): for x in range(2): - fcv.keyframe_points[i].handle_left[x] = keys[i][0][x] - fcv.keyframe_points[i].co[x] = keys[i][1][x] - fcv.keyframe_points[i].handle_right[x] = keys[i][2][x] + fcv.keyframe_points[i].handle_left[x] = keys[i][0][x] + fcv.keyframe_points[i].co[x] = keys[i][1][x] + fcv.keyframe_points[i].handle_right[x] = keys[i][2][x] flist = bpy.context.active_object.animation_data.action.fcurves for f in flist: if f.select and f.data_path.endswith("rotation_euler"): cleanupEulCurve(f) + class DiscontFilterOp(bpy.types.Operator): """Fixes the most common causes of gimbal lock in the fcurves of the active bone""" bl_idname = "graph.euler_filter" @@ -56,9 +78,11 @@ class DiscontFilterOp(bpy.types.Operator): main(context) return {'FINISHED'} + def register(): pass + def unregister(): pass diff --git a/release/scripts/presets/ffmpeg/DVD.py b/release/scripts/presets/ffmpeg/DVD.py index aef11672273..e18ec9f817b 100644 --- a/release/scripts/presets/ffmpeg/DVD.py +++ b/release/scripts/presets/ffmpeg/DVD.py @@ -14,7 +14,7 @@ else: bpy.context.scene.render.ffmpeg_video_bitrate = 6000 bpy.context.scene.render.ffmpeg_maxrate = 9000 bpy.context.scene.render.ffmpeg_minrate = 0 -bpy.context.scene.render.ffmpeg_buffersize = 224*8 +bpy.context.scene.render.ffmpeg_buffersize = 224 * 8 bpy.context.scene.render.ffmpeg_packetsize = 2048 bpy.context.scene.render.ffmpeg_muxrate = 10080000 diff --git a/release/scripts/presets/ffmpeg/SVCD.py b/release/scripts/presets/ffmpeg/SVCD.py index 3076c42bd51..c71a3851af0 100644 --- a/release/scripts/presets/ffmpeg/SVCD.py +++ b/release/scripts/presets/ffmpeg/SVCD.py @@ -14,7 +14,7 @@ else: bpy.context.scene.render.ffmpeg_video_bitrate = 2040 bpy.context.scene.render.ffmpeg_maxrate = 2516 bpy.context.scene.render.ffmpeg_minrate = 0 -bpy.context.scene.render.ffmpeg_buffersize = 224*8 +bpy.context.scene.render.ffmpeg_buffersize = 224 * 8 bpy.context.scene.render.ffmpeg_packetsize = 2324 bpy.context.scene.render.ffmpeg_muxrate = 0 diff --git a/release/scripts/presets/ffmpeg/VCD.py b/release/scripts/presets/ffmpeg/VCD.py index f559cb18fb0..faf27efe9e6 100644 --- a/release/scripts/presets/ffmpeg/VCD.py +++ b/release/scripts/presets/ffmpeg/VCD.py @@ -14,7 +14,7 @@ else: bpy.context.scene.render.ffmpeg_video_bitrate = 1150 bpy.context.scene.render.ffmpeg_maxrate = 1150 bpy.context.scene.render.ffmpeg_minrate = 1150 -bpy.context.scene.render.ffmpeg_buffersize = 40*8 +bpy.context.scene.render.ffmpeg_buffersize = 40 * 8 bpy.context.scene.render.ffmpeg_packetsize = 2324 bpy.context.scene.render.ffmpeg_muxrate = 2352 * 75 * 8 diff --git a/release/scripts/presets/ffmpeg/h264.py b/release/scripts/presets/ffmpeg/h264.py index 74e6890a5d4..1cd5d61a926 100644 --- a/release/scripts/presets/ffmpeg/h264.py +++ b/release/scripts/presets/ffmpeg/h264.py @@ -12,6 +12,6 @@ else: bpy.context.scene.render.ffmpeg_video_bitrate = 6000 bpy.context.scene.render.ffmpeg_maxrate = 9000 bpy.context.scene.render.ffmpeg_minrate = 0 -bpy.context.scene.render.ffmpeg_buffersize = 224*8 +bpy.context.scene.render.ffmpeg_buffersize = 224 * 8 bpy.context.scene.render.ffmpeg_packetsize = 2048 bpy.context.scene.render.ffmpeg_muxrate = 10080000 diff --git a/release/scripts/presets/ffmpeg/theora.py b/release/scripts/presets/ffmpeg/theora.py index 6ce9d4ea7ed..9a35227ad57 100644 --- a/release/scripts/presets/ffmpeg/theora.py +++ b/release/scripts/presets/ffmpeg/theora.py @@ -12,6 +12,6 @@ else: bpy.context.scene.render.ffmpeg_video_bitrate = 6000 bpy.context.scene.render.ffmpeg_maxrate = 9000 bpy.context.scene.render.ffmpeg_minrate = 0 -bpy.context.scene.render.ffmpeg_buffersize = 224*8 +bpy.context.scene.render.ffmpeg_buffersize = 224 * 8 bpy.context.scene.render.ffmpeg_packetsize = 2048 bpy.context.scene.render.ffmpeg_muxrate = 10080000 diff --git a/release/scripts/presets/ffmpeg/xvid.py b/release/scripts/presets/ffmpeg/xvid.py index 0c8e3989451..fa64562e566 100644 --- a/release/scripts/presets/ffmpeg/xvid.py +++ b/release/scripts/presets/ffmpeg/xvid.py @@ -12,6 +12,6 @@ else: bpy.context.scene.render.ffmpeg_video_bitrate = 6000 bpy.context.scene.render.ffmpeg_maxrate = 9000 bpy.context.scene.render.ffmpeg_minrate = 0 -bpy.context.scene.render.ffmpeg_buffersize = 224*8 +bpy.context.scene.render.ffmpeg_buffersize = 224 * 8 bpy.context.scene.render.ffmpeg_packetsize = 2048 bpy.context.scene.render.ffmpeg_muxrate = 10080000 diff --git a/release/scripts/presets/sss/apple.py b/release/scripts/presets/sss/apple.py index c5f60ee5095..b2ee19ca125 100644 --- a/release/scripts/presets/sss/apple.py +++ b/release/scripts/presets/sss/apple.py @@ -1,5 +1,5 @@ import bpy material = (bpy.context.material.active_node_material if bpy.context.material.active_node_material else bpy.context.material) - + material.subsurface_scattering.radius = 11.605, 3.884, 1.754 material.subsurface_scattering.color = 0.430, 0.210, 0.168 diff --git a/release/scripts/ui/properties_physics_common.py b/release/scripts/ui/properties_physics_common.py index 30b9061e982..ec6ec21fa26 100644 --- a/release/scripts/ui/properties_physics_common.py +++ b/release/scripts/ui/properties_physics_common.py @@ -20,6 +20,7 @@ import bpy + class PhysicButtonsPanel(): bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' @@ -29,7 +30,8 @@ class PhysicButtonsPanel(): def poll(cls, context): rd = context.scene.render return (context.object) and (not rd.use_game_engine) - + + def physics_add(self, layout, md, name, type, typeicon, toggles): sub = layout.row(align=True) if md: @@ -41,35 +43,36 @@ def physics_add(self, layout, md, name, type, typeicon, toggles): else: sub.operator("object.modifier_add", text=name, icon=typeicon).type = type + class PHYSICS_PT_add(PhysicButtonsPanel, bpy.types.Panel): bl_label = "" bl_options = {'HIDE_HEADER'} - + def draw(self, context): ob = context.object - + layout = self.layout layout.label("Enable physics for:") split = layout.split() col = split.column() - + if(context.object.field.type == 'NONE'): col.operator("object.forcefield_toggle", text="Force Field", icon='FORCE_FORCE') else: col.operator("object.forcefield_toggle", text="Force Field", icon='X') - + if(ob.type == 'MESH'): - physics_add(self, col, context.collision, "Collision", 'COLLISION', 'MOD_PHYSICS', False); - physics_add(self, col, context.cloth, "Cloth", 'CLOTH', 'MOD_CLOTH', True); - + physics_add(self, col, context.collision, "Collision", 'COLLISION', 'MOD_PHYSICS', False) + physics_add(self, col, context.cloth, "Cloth", 'CLOTH', 'MOD_CLOTH', True) + col = split.column() - + if(ob.type == 'MESH' or ob.type == 'LATTICE'or ob.type == 'CURVE'): - physics_add(self, col, context.soft_body, "Soft Body", 'SOFT_BODY', 'MOD_SOFT', True); - + physics_add(self, col, context.soft_body, "Soft Body", 'SOFT_BODY', 'MOD_SOFT', True) + if(ob.type == 'MESH'): - physics_add(self, col, context.fluid, "Fluid", 'FLUID_SIMULATION', 'MOD_FLUIDSIM', True); - physics_add(self, col, context.smoke, "Smoke", 'SMOKE', 'MOD_SMOKE', True); + physics_add(self, col, context.fluid, "Fluid", 'FLUID_SIMULATION', 'MOD_FLUIDSIM', True) + physics_add(self, col, context.smoke, "Smoke", 'SMOKE', 'MOD_SMOKE', True) #cachetype can be 'PSYS' 'HAIR' 'SMOKE' etc diff --git a/release/scripts/ui/properties_physics_field.py b/release/scripts/ui/properties_physics_field.py index 584cdaad108..f46f78ca017 100644 --- a/release/scripts/ui/properties_physics_field.py +++ b/release/scripts/ui/properties_physics_field.py @@ -37,7 +37,7 @@ class PhysicButtonsPanel(): class PHYSICS_PT_field(PhysicButtonsPanel, bpy.types.Panel): bl_label = "Force Fields" - + @classmethod def poll(cls, context): ob = context.object diff --git a/release/scripts/ui/properties_render.py b/release/scripts/ui/properties_render.py index 25cd30e45a1..99b75b59fdd 100644 --- a/release/scripts/ui/properties_render.py +++ b/release/scripts/ui/properties_render.py @@ -39,8 +39,8 @@ class RENDER_MT_framerate_presets(bpy.types.Menu): preset_subdir = "framerate" preset_operator = "script.execute_preset" draw = bpy.types.Menu.draw_preset - - + + class RenderButtonsPanel(): bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' @@ -566,20 +566,20 @@ class RENDER_PT_dimensions(RenderButtonsPanel, bpy.types.Panel): fps_rate = round(rd.fps / rd.fps_base) else: fps_rate = round(rd.fps / rd.fps_base, 2) - + # TODO: Change the following to iterate over existing presets if (fps_rate in (23.98, 24, 25, 29.97, 30, 50, 59.94, 60)): custom_framerate = False else: custom_framerate = True - + if custom_framerate == True: fps_label_text = "Custom (" + str(fps_rate) + " fps)" else: fps_label_text = str(fps_rate) + " fps" - + sub.menu("RENDER_MT_framerate_presets", text=fps_label_text) - + if (bpy.types.RENDER_MT_framerate_presets.bl_label == "Custom") or (custom_framerate == True): sub.prop(rd, "fps") sub.prop(rd, "fps_base", text="/") diff --git a/release/scripts/ui/space_dopesheet.py b/release/scripts/ui/space_dopesheet.py index 718ce0b66d9..eda4c80bb98 100644 --- a/release/scripts/ui/space_dopesheet.py +++ b/release/scripts/ui/space_dopesheet.py @@ -32,10 +32,10 @@ def dopesheet_filter(layout, context, genericFiltersOnly=False): row = layout.row(align=True) row.prop(dopesheet, "show_only_selected", text="") row.prop(dopesheet, "show_hidden", text="") - + if genericFiltersOnly: - return - + return + row = layout.row(align=True) row.prop(dopesheet, "show_transforms", text="") @@ -114,8 +114,8 @@ class DOPESHEET_HT_header(bpy.types.Header): if st.mode == 'DOPESHEET': dopesheet_filter(layout, context) elif st.mode == 'ACTION': - # 'genericFiltersOnly' limits the options to only the relevant 'generic' subset of - # filters which will work here and are useful (especially for character animation) + # 'genericFiltersOnly' limits the options to only the relevant 'generic' subset of + # filters which will work here and are useful (especially for character animation) dopesheet_filter(layout, context, genericFiltersOnly=True) if st.mode in ('ACTION', 'SHAPEKEY'): diff --git a/release/scripts/ui/space_node.py b/release/scripts/ui/space_node.py index abad98413b5..31ac25ff41a 100644 --- a/release/scripts/ui/space_node.py +++ b/release/scripts/ui/space_node.py @@ -163,8 +163,8 @@ class NODE_MT_node(bpy.types.Menu): layout.operator("node.show_cyclic_dependencies") layout.operator("node.read_renderlayers") layout.operator("node.read_fullsamplelayers") - - + + # Node Backdrop options class NODE_PT_properties(bpy.types.Panel): bl_space_type = 'NODE_EDITOR' @@ -175,7 +175,7 @@ class NODE_PT_properties(bpy.types.Panel): def poll(cls, context): snode = context.space_data return snode.tree_type == 'COMPOSITING' - + def draw_header(self, context): snode = context.space_data self.layout.prop(snode, "show_backdrop", text="") diff --git a/release/scripts/ui/space_view3d_toolbar.py b/release/scripts/ui/space_view3d_toolbar.py index 9261324366b..c3280a67b7e 100644 --- a/release/scripts/ui/space_view3d_toolbar.py +++ b/release/scripts/ui/space_view3d_toolbar.py @@ -34,6 +34,7 @@ def draw_repeat_tools(context, layout): col.operator("screen.repeat_last") col.operator("screen.repeat_history", text="History...") + # Keyframing tools def draw_keyframing_tools(context, layout): col = layout.column(align=True) @@ -42,6 +43,7 @@ def draw_keyframing_tools(context, layout): row.operator("anim.keyframe_insert_menu", text="Insert") row.operator("anim.keyframe_delete_v3d", text="Remove") + # Grease Pencil tools def draw_gpencil_tools(context, layout): col = layout.column(align=True) @@ -88,9 +90,9 @@ class VIEW3D_PT_tools_objectmode(View3DPanel, bpy.types.Panel): col.label(text="Shading:") col.operator("object.shade_smooth", text="Smooth") col.operator("object.shade_flat", text="Flat") - + draw_keyframing_tools(context, layout) - + col = layout.column(align=True) col.label(text="Motion Paths:") col.operator("object.paths_calculate", text="Calculate Paths") @@ -406,7 +408,7 @@ class VIEW3D_PT_tools_posemode(View3DPanel, bpy.types.Panel): col.operator("poselib.pose_add", text="Add To Library") draw_keyframing_tools(context, layout) - + col = layout.column(align=True) col.label(text="Motion Paths:") col.operator("pose.paths_calculate", text="Calculate Paths") |