Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-08-30 14:49:58 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-08-30 14:49:58 +0400
commitb20c9b0ba368d5685d3c996572780befe852b889 (patch)
tree3431d53b89ef0332fcdb1a76293278041740c22e
parent6c9ee34dd8acba35808847d3669798c6d3459b9c (diff)
minor edits, pep8 - also correct float -> double promotion for blf.
-rw-r--r--doc/python_api/sphinx_doc_gen.py1
-rw-r--r--release/scripts/modules/bpy_types.py2
-rw-r--r--release/scripts/startup/bl_operators/nla.py4
-rw-r--r--release/scripts/startup/bl_operators/object.py27
-rw-r--r--release/scripts/startup/bl_ui/properties_data_armature.py1
-rw-r--r--release/scripts/startup/bl_ui/properties_object_constraint.py1
-rw-r--r--release/scripts/startup/bl_ui/properties_texture.py8
-rw-r--r--release/scripts/startup/bl_ui/space_dopesheet.py2
-rw-r--r--release/scripts/startup/bl_ui/space_nla.py4
-rw-r--r--release/scripts/startup/bl_ui/space_sequencer.py1
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py5
-rw-r--r--release/scripts/startup/keyingsets_builtins.py33
-rw-r--r--source/blender/blenfont/intern/blf.c30
-rw-r--r--source/blender/editors/space_nla/nla_edit.c2
14 files changed, 62 insertions, 59 deletions
diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py
index 6d29c57c91f..e378dd19e73 100644
--- a/doc/python_api/sphinx_doc_gen.py
+++ b/doc/python_api/sphinx_doc_gen.py
@@ -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)
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py
index e4a0d30efcf..101416f4943 100644
--- a/release/scripts/modules/bpy_types.py
+++ b/release/scripts/modules/bpy_types.py
@@ -413,7 +413,7 @@ TypeMap = {}
class Sound(bpy_types.ID):
__slots__ = ()
-
+
@property
def factory(self):
"""The aud.Factory object of the sound."""
diff --git a/release/scripts/startup/bl_operators/nla.py b/release/scripts/startup/bl_operators/nla.py
index 085cd75f9f9..c764f7d62f1 100644
--- a/release/scripts/startup/bl_operators/nla.py
+++ b/release/scripts/startup/bl_operators/nla.py
@@ -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"
diff --git a/release/scripts/startup/bl_operators/object.py b/release/scripts/startup/bl_operators/object.py
index 88f863b8e55..6c9f27afaa5 100644
--- a/release/scripts/startup/bl_operators/object.py
+++ b/release/scripts/startup/bl_operators/object.py
@@ -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'}
diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py b/release/scripts/startup/bl_ui/properties_data_armature.py
index b2c09469067..3d1903f4cbc 100644
--- a/release/scripts/startup/bl_ui/properties_data_armature.py
+++ b/release/scripts/startup/bl_ui/properties_data_armature.py
@@ -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"
diff --git a/release/scripts/startup/bl_ui/properties_object_constraint.py b/release/scripts/startup/bl_ui/properties_object_constraint.py
index ba237e74fb7..05fac2026a0 100644
--- a/release/scripts/startup/bl_ui/properties_object_constraint.py
+++ b/release/scripts/startup/bl_ui/properties_object_constraint.py
@@ -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)
diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py
index 0172fbcbadd..34f5a948ee7 100644
--- a/release/scripts/startup/bl_ui/properties_texture.py
+++ b/release/scripts/startup/bl_ui/properties_texture.py
@@ -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")
diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py
index 5ed79f45fbc..90dcc99e6d7 100644
--- a/release/scripts/startup/bl_ui/space_dopesheet.py
+++ b/release/scripts/startup/bl_ui/space_dopesheet.py
@@ -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)
diff --git a/release/scripts/startup/bl_ui/space_nla.py b/release/scripts/startup/bl_ui/space_nla.py
index 1d4b7c6828f..ffead81c507 100644
--- a/release/scripts/startup/bl_ui/space_nla.py
+++ b/release/scripts/startup/bl_ui/space_nla.py
@@ -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")
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index 8592cc2fcc0..36f606da635 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -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'
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 64cbc4c3d98..9f96df1eb66 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -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"
diff --git a/release/scripts/startup/keyingsets_builtins.py b/release/scripts/startup/keyingsets_builtins.py
index dcc1afed74b..6b12c95e072 100644
--- a/release/scripts/startup/keyingsets_builtins.py
+++ b/release/scripts/startup/keyingsets_builtins.py
@@ -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)
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c
index c0e62b1c0c7..fc812d652b3 100644
--- a/source/blender/blenfont/intern/blf.c
+++ b/source/blender/blenfont/intern/blf.c
@@ -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;
diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c
index 1894a9fd651..08026e8a1d2 100644
--- a/source/blender/editors/space_nla/nla_edit.c
+++ b/source/blender/editors/space_nla/nla_edit.c
@@ -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;