minor edits, pep8 - also correct float -> double promotion for blf.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 30 Aug 2011 10:49:58 +0000 (10:49 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 30 Aug 2011 10:49:58 +0000 (10:49 +0000)
14 files changed:
doc/python_api/sphinx_doc_gen.py
release/scripts/modules/bpy_types.py
release/scripts/startup/bl_operators/nla.py
release/scripts/startup/bl_operators/object.py
release/scripts/startup/bl_ui/properties_data_armature.py
release/scripts/startup/bl_ui/properties_object_constraint.py
release/scripts/startup/bl_ui/properties_texture.py
release/scripts/startup/bl_ui/space_dopesheet.py
release/scripts/startup/bl_ui/space_nla.py
release/scripts/startup/bl_ui/space_sequencer.py
release/scripts/startup/bl_ui/space_view3d.py
release/scripts/startup/keyingsets_builtins.py
source/blender/blenfont/intern/blf.c
source/blender/editors/space_nla/nla_edit.c

index 6d29c57..e378dd1 100644 (file)
@@ -1222,7 +1222,6 @@ def rna2sphinx(BASEPATH):
 
     shutil.copy2(os.path.join(BASEPATH, "..", "rst", "change_log.rst"), BASEPATH)
 
-
     if not EXCLUDE_INFO_DOCS:
         for info, info_desc in INFO_DOCS:
             shutil.copy2(os.path.join(BASEPATH, "..", "rst", info), BASEPATH)
index e4a0d30..101416f 100644 (file)
@@ -413,7 +413,7 @@ TypeMap = {}
 
 class Sound(bpy_types.ID):
     __slots__ = ()
-    
+
     @property
     def factory(self):
         """The aud.Factory object of the sound."""
index 085cd75..c764f7d 100644 (file)
@@ -269,10 +269,8 @@ class BakeAction(Operator):
         wm = context.window_manager
         return wm.invoke_props_dialog(self)
 
-#################################
 
-
-class ClearUselessActions(bpy.types.Operator):
+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"
index 88f863b..6c9f27a 100644 (file)
@@ -686,26 +686,30 @@ class ClearAllRestrictRender(Operator):
             obj.hide_render = False
         return {'FINISHED'}
 
-class TransformsToDeltasAnim(bpy.types.Operator):
+
+class TransformsToDeltasAnim(Operator):
     '''Convert object animation for normal transforms to delta transforms'''
     bl_idname = "object.anim_transforms_to_deltas"
     bl_label = "Animated Transforms to Deltas"
     bl_options = {'REGISTER', 'UNDO'}
-    
+
     @classmethod
     def poll(cls, context):
         obs = context.selected_editable_objects
         return (obs is not None)
-    
+
     def execute(self, context):
         for obj in context.selected_editable_objects:
             # get animation data
             adt = obj.animation_data
             if (adt is None) or (adt.action is None):
-                self.report({'WARNING'}, "No animation data to convert on object: " + obj.name)
+                self.report({'WARNING'},
+                            "No animation data to convert on object: %r" %
+                            obj.name)
                 continue
-            
-            # if F-Curve uses standard transform path, just append "delta_" to this path
+
+            # if F-Curve uses standard transform path
+            # just append "delta_" to this path
             for fcu in adt.action.fcurves:
                 if fcu.data_path == "location":
                     fcu.data_path = "delta_location"
@@ -716,13 +720,14 @@ class TransformsToDeltasAnim(bpy.types.Operator):
                 elif fcu.data_path == "rotation_quaternion":
                     fcu.data_path = "delta_rotation_quaternion"
                     obj.rotation_quaternion.identity()
-                #elif fcu.data_path == "rotation_axis_angle":  # XXX: currently not implemented 
-                #   fcu.data_path = "delta_rotation_axis_angle"
+                # XXX: currently not implemented
+                # elif fcu.data_path == "rotation_axis_angle":
+                #    fcu.data_path = "delta_rotation_axis_angle"
                 elif fcu.data_path == "scale":
                     fcu.data_path = "delta_scale"
-                    obj.scale = (1, 1, 1)
-        
+                    obj.scale = 1.0, 1.0, 1.0
+
         # hack: force animsys flush by changing frame, so that deltas get run
         context.scene.frame_set(context.scene.frame_current)
-        
+
         return {'FINISHED'}
index b2c0946..3d1903f 100644 (file)
@@ -74,6 +74,7 @@ class DATA_PT_skeleton(ArmatureButtonsPanel, Panel):
         if context.scene.render.engine == "BLENDER_GAME":
             layout.row().prop(arm, "vert_deformer", expand=True, text="")
 
+
 class DATA_PT_display(ArmatureButtonsPanel, Panel):
     bl_label = "Display"
 
index ba237e7..05fac20 100644 (file)
@@ -478,7 +478,6 @@ class ConstraintButtonsPanel():
         row.prop(con, "use_transform_limit")
         row.label()
 
-
     def STRETCH_TO(self, context, layout, con):
         self.target_template(layout, con)
 
index 0172fbc..34f5a94 100644 (file)
@@ -414,7 +414,7 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, Panel):
             row = col.row()
             row.active = tex.use_normal_map
             row.prop(slot, "normal_map_space", text="")
-            
+
             row = col.row()
             row.active = not tex.use_normal_map
             row.prop(tex, "use_derivative_map")
@@ -1029,14 +1029,14 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel):
 
             # only show bump settings if activated but not for normalmap images
             row = layout.row()
-            
+
             sub = row.row()
             sub.active = (tex.use_map_normal or tex.use_map_warp) and not (tex.texture.type == 'IMAGE' and (tex.texture.use_normal_map or tex.texture.use_derivative_map))
             sub.prop(tex, "bump_method", text="Method")
 
-                       # the space setting is supported for: derivmaps + bumpmaps (DEFAULT,BEST_QUALITY), not for normalmaps
+            # the space setting is supported for: derivmaps + bumpmaps (DEFAULT,BEST_QUALITY), not for normalmaps
             sub = row.row()
-            sub.active = (tex.use_map_normal or tex.use_map_warp) and not (tex.texture.type == 'IMAGE' and tex.texture.use_normal_map) and ((tex.bump_method in {'BUMP_DEFAULT', 'BUMP_BEST_QUALITY'}) or (tex.texture.type == 'IMAGE' and tex.texture.use_derivative_map)) 
+            sub.active = (tex.use_map_normal or tex.use_map_warp) and not (tex.texture.type == 'IMAGE' and tex.texture.use_normal_map) and ((tex.bump_method in {'BUMP_DEFAULT', 'BUMP_BEST_QUALITY'}) or (tex.texture.type == 'IMAGE' and tex.texture.use_derivative_map))
             sub.prop(tex, "bump_objectspace", text="Space")
 
 
index 5ed79f4..90dcc99 100644 (file)
@@ -36,7 +36,7 @@ def dopesheet_filter(layout, context, genericFiltersOnly=False):
 
     if is_nla:
         row.prop(dopesheet, "show_missing_nla", text="")
-    
+
     if not genericFiltersOnly:
         if bpy.data.groups:
             row = layout.row(align=True)
index 1d4b7c6..ffead81 100644 (file)
@@ -69,11 +69,11 @@ class NLA_MT_view(Menu):
         layout.separator()
         layout.operator("anim.previewrange_set")
         layout.operator("anim.previewrange_clear")
-        
+
         layout.separator()
         layout.operator("nla.view_all")
         layout.operator("nla.view_selected")
-        
+
         layout.separator()
         layout.operator("screen.area_dupli")
         layout.operator("screen.screen_full_area")
index 8592cc2..36f606d 100644 (file)
@@ -804,7 +804,6 @@ class SEQUENCER_PT_proxy(SequencerButtonsPanel, Panel):
                 col.prop(strip.proxy, "timecode")
 
 
-
 class SEQUENCER_PT_preview(SequencerButtonsPanel_Output, Panel):
     bl_label = "Scene Preview/Render"
     bl_space_type = 'SEQUENCE_EDITOR'
index 64cbc4c..9f96df1 100644 (file)
@@ -179,9 +179,9 @@ class VIEW3D_MT_transform(Menu):
 
         layout.operator("object.randomize_transform")
         layout.operator("object.align")
-        
+
         layout.separator()
-        
+
         layout.operator("object.anim_transforms_to_deltas")
 
 
@@ -1273,6 +1273,7 @@ class VIEW3D_MT_pose_transform(Menu):
 
         layout.operator("pose.user_transforms_clear", text="Reset unkeyed")
 
+
 class VIEW3D_MT_pose_slide(Menu):
     bl_label = "In-Betweens"
 
index dcc1afe..6b12c95 100644 (file)
@@ -32,13 +32,14 @@ in lost (i.e. unkeyed) animation.
 
 import bpy
 import keyingsets_utils
+from bpy.types import KeyingSetInfo
 
 ###############################
 # Built-In KeyingSets
 
 
 # Location
-class BUILTIN_KSI_Location(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_Location(KeyingSetInfo):
     bl_label = "Location"
 
     # poll - use predefined callback for selected bones/objects
@@ -52,7 +53,7 @@ class BUILTIN_KSI_Location(bpy.types.KeyingSetInfo):
 
 
 # Rotation
-class BUILTIN_KSI_Rotation(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_Rotation(KeyingSetInfo):
     bl_label = "Rotation"
 
     # poll - use predefined callback for selected bones/objects
@@ -66,7 +67,7 @@ class BUILTIN_KSI_Rotation(bpy.types.KeyingSetInfo):
 
 
 # Scale
-class BUILTIN_KSI_Scaling(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_Scaling(KeyingSetInfo):
     bl_label = "Scaling"
 
     # poll - use predefined callback for selected bones/objects
@@ -82,7 +83,7 @@ class BUILTIN_KSI_Scaling(bpy.types.KeyingSetInfo):
 
 
 # LocRot
-class BUILTIN_KSI_LocRot(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_LocRot(KeyingSetInfo):
     bl_label = "LocRot"
 
     # poll - use predefined callback for selected bones/objects
@@ -100,7 +101,7 @@ class BUILTIN_KSI_LocRot(bpy.types.KeyingSetInfo):
 
 
 # LocScale
-class BUILTIN_KSI_LocScale(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_LocScale(KeyingSetInfo):
     bl_label = "LocScale"
 
     # poll - use predefined callback for selected bones/objects
@@ -118,7 +119,7 @@ class BUILTIN_KSI_LocScale(bpy.types.KeyingSetInfo):
 
 
 # LocRotScale
-class BUILTIN_KSI_LocRotScale(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_LocRotScale(KeyingSetInfo):
     bl_label = "LocRotScale"
 
     # poll - use predefined callback for selected bones/objects
@@ -138,7 +139,7 @@ class BUILTIN_KSI_LocRotScale(bpy.types.KeyingSetInfo):
 
 
 # RotScale
-class BUILTIN_KSI_RotScale(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_RotScale(KeyingSetInfo):
     bl_label = "RotScale"
 
     # poll - use predefined callback for selected bones/objects
@@ -158,7 +159,7 @@ class BUILTIN_KSI_RotScale(bpy.types.KeyingSetInfo):
 
 
 # Location
-class BUILTIN_KSI_VisualLoc(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_VisualLoc(KeyingSetInfo):
     bl_label = "Visual Location"
 
     bl_options = {'INSERTKEY_VISUAL'}
@@ -174,7 +175,7 @@ class BUILTIN_KSI_VisualLoc(bpy.types.KeyingSetInfo):
 
 
 # Rotation
-class BUILTIN_KSI_VisualRot(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_VisualRot(KeyingSetInfo):
     bl_label = "Visual Rotation"
 
     bl_options = {'INSERTKEY_VISUAL'}
@@ -190,7 +191,7 @@ class BUILTIN_KSI_VisualRot(bpy.types.KeyingSetInfo):
 
 
 # VisualLocRot
-class BUILTIN_KSI_VisualLocRot(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_VisualLocRot(KeyingSetInfo):
     bl_label = "Visual LocRot"
 
     bl_options = {'INSERTKEY_VISUAL'}
@@ -212,7 +213,7 @@ class BUILTIN_KSI_VisualLocRot(bpy.types.KeyingSetInfo):
 
 
 # Available
-class BUILTIN_KSI_Available(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_Available(KeyingSetInfo):
     bl_label = "Available"
 
     # poll - selected objects or selected object with animation data
@@ -234,7 +235,7 @@ class BUILTIN_KSI_Available(bpy.types.KeyingSetInfo):
 
 
 # All properties that are likely to get animated in a character rig
-class BUILTIN_KSI_WholeCharacter(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_WholeCharacter(KeyingSetInfo):
     bl_label = "Whole Character"
 
     # these prefixes should be avoided, as they are not really bones
@@ -265,7 +266,7 @@ class BUILTIN_KSI_WholeCharacter(bpy.types.KeyingSetInfo):
         # loc, rot, scale - only include unlocked ones
         ksi.doLoc(ks, bone)
 
-        if bone.rotation_mode in ('QUATERNION', 'AXIS_ANGLE'):
+        if bone.rotation_mode in {'QUATERNION', 'AXIS_ANGLE'}:
             ksi.doRot4d(ks, bone)
         else:
             ksi.doRot3d(ks, bone)
@@ -365,7 +366,7 @@ class BUILTIN_KSI_WholeCharacter(bpy.types.KeyingSetInfo):
 
 
 # Delta Location
-class BUILTIN_KSI_DeltaLocation(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_DeltaLocation(KeyingSetInfo):
     bl_label = "Delta Location"
 
     # poll - selected objects only (and only if active object in object mode)
@@ -390,7 +391,7 @@ class BUILTIN_KSI_DeltaLocation(bpy.types.KeyingSetInfo):
 
 
 # Delta Rotation
-class BUILTIN_KSI_DeltaRotation(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_DeltaRotation(KeyingSetInfo):
     bl_label = "Delta Rotation"
 
     # poll - selected objects only (and only if active object in object mode)
@@ -423,7 +424,7 @@ class BUILTIN_KSI_DeltaRotation(bpy.types.KeyingSetInfo):
 
 
 # Delta Scale
-class BUILTIN_KSI_DeltaScale(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_DeltaScale(KeyingSetInfo):
     bl_label = "Delta Scale"
 
     # poll - selected objects only (and only if active object in object mode)
index c0e62b1..fc812d6 100644 (file)
@@ -369,28 +369,28 @@ void BLF_position(int fontid, float x, float y, float z)
                        za= 1.0f;
                }
 
-               remainder= x - floor(x);
-               if (remainder > 0.4 && remainder < 0.6) {
-                       if (remainder < 0.5)
-                               x -= 0.1 * xa;
+               remainder= x - floorf(x);
+               if (remainder > 0.4f && remainder < 0.6f) {
+                       if (remainder < 0.5f)
+                               x -= 0.1f * xa;
                        else
-                               x += 0.1 * xa;
+                               x += 0.1f * xa;
                }
 
-               remainder= y - floor(y);
-               if (remainder > 0.4 && remainder < 0.6) {
-                       if (remainder < 0.5)
-                               y -= 0.1 * ya;
+               remainder= y - floorf(y);
+               if (remainder > 0.4f && remainder < 0.6f) {
+                       if (remainder < 0.5f)
+                               y -= 0.1f * ya;
                        else
-                               y += 0.1 * ya;
+                               y += 0.1f * ya;
                }
 
-               remainder= z - floor(z);
-               if (remainder > 0.4 && remainder < 0.6) {
-                       if (remainder < 0.5)
-                               z -= 0.1 * za;
+               remainder= z - floorf(z);
+               if (remainder > 0.4f && remainder < 0.6f) {
+                       if (remainder < 0.5f)
+                               z -= 0.1f * za;
                        else
-                               z += 0.1 * za;
+                               z += 0.1f * za;
                }
 
                font->pos[0]= x;
index 1894a9f..08026e8 100644 (file)
@@ -1858,7 +1858,7 @@ static int nlaedit_snap_exec (bContext *C, wmOperator *op)
                                                strip->start= (float)CFRA;
                                                break;
                                        case NLAEDIT_SNAP_NEAREST_FRAME: /* to nearest frame */
-                                               strip->start= floorf(start+0.5);
+                                               strip->start= floorf(start+0.5f);
                                                break;
                                        case NLAEDIT_SNAP_NEAREST_SECOND: /* to nearest second */
                                                strip->start= floorf(start/secf + 0.5f) * secf;