minor edits, pep8 - also correct float -> double promotion for blf.
This commit is contained in:
@@ -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)
|
||||
|
@@ -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"
|
||||
|
@@ -686,7 +686,8 @@ 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"
|
||||
@@ -702,10 +703,13 @@ class TransformsToDeltasAnim(bpy.types.Operator):
|
||||
# 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,11 +720,12 @@ 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
|
||||
# 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)
|
||||
|
@@ -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"
|
||||
|
||||
|
@@ -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)
|
||||
|
||||
|
@@ -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'
|
||||
|
@@ -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"
|
||||
|
||||
|
@@ -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)
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user