[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2909] contrib/py/scripts/addons/ animation_motion_trail.py: Updated for change in api (new handle type: auto clamped)
Bart Crouch
bartius.crouch at gmail.com
Tue Jan 17 21:20:08 CET 2012
Revision: 2909
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2909
Author: crouch
Date: 2012-01-17 20:19:55 +0000 (Tue, 17 Jan 2012)
Log Message:
-----------
Updated for change in api (new handle type: auto clamped)
Thanks go to Thomas Beck.
Modified Paths:
--------------
contrib/py/scripts/addons/animation_motion_trail.py
Modified: contrib/py/scripts/addons/animation_motion_trail.py
===================================================================
--- contrib/py/scripts/addons/animation_motion_trail.py 2012-01-17 14:14:30 UTC (rev 2908)
+++ contrib/py/scripts/addons/animation_motion_trail.py 2012-01-17 20:19:55 UTC (rev 2909)
@@ -22,8 +22,8 @@
bl_info = {
'name': "Motion Trail",
'author': "Bart Crouch",
- 'version': (3, 1, 0),
- 'blender': (2, 6, 0),
+ 'version': (3, 1, 1),
+ 'blender': (2, 6, 1),
'location': "View3D > Toolbar > Motion Trail tab",
'warning': "",
'description': "Display and edit motion trails in the 3d-view",
@@ -848,7 +848,8 @@
if kf.co[0] == frame:
if side == "left":
# change handle type, if necessary
- if kf.handle_left_type in ['AUTO', 'ANIM_CLAMPED']:
+ if kf.handle_left_type in ['AUTO', 'AUTO_CLAMPED',
+ 'ANIM_CLAMPED']:
kf.handle_left_type = 'ALIGNED'
elif kf.handle_left_type == 'VECTOR':
kf.handle_left_type = 'FREE'
@@ -856,7 +857,7 @@
kf.handle_left[1] = handles_ori[objectname][frame]\
["left"][i][1] + d[i]
if kf.handle_left_type in ['ALIGNED', 'ANIM_CLAMPED',
- 'AUTO']:
+ 'AUTO', 'AUTO_CLAMPED']:
dif = (abs(handles_ori[objectname][frame]["right"]\
[i][0] - kf.co[0]) / abs(kf.handle_left[0] - \
kf.co[0])) * d[i]
@@ -864,7 +865,8 @@
[frame]["right"][i][1] - dif
elif side == "right":
# change handle type, if necessary
- if kf.handle_right_type in ['AUTO', 'ANIM_CLAMPED']:
+ if kf.handle_right_type in ['AUTO', 'AUTO_CLAMPED',
+ 'ANIM_CLAMPED']:
kf.handle_left_type = 'ALIGNED'
kf.handle_right_type = 'ALIGNED'
elif kf.handle_right_type == 'VECTOR':
@@ -874,7 +876,7 @@
kf.handle_right[1] = handles_ori[objectname][frame]\
["right"][i][1] + d[i]
if kf.handle_right_type in ['ALIGNED', 'ANIM_CLAMPED',
- 'AUTO']:
+ 'AUTO', 'AUTO_CLAMPED']:
dif = (abs(handles_ori[objectname][frame]["left"]\
[i][0] - kf.co[0]) / abs(kf.handle_right[0] - \
kf.co[0])) * d[i]
@@ -1266,13 +1268,14 @@
if kf.co[0] == frame:
# align if necessary
if side in ["right", "both"] and new_type in \
- ["AUTO", "ALIGNED"]:
+ ["AUTO", "AUTO_CLAMPED", "ALIGNED"]:
# change right handle
normal = (kf.co - kf.handle_left).normalized()
size = (kf.handle_right[0] - kf.co[0]) / normal[0]
normal = normal*size + kf.co
kf.handle_right[1] = normal[1]
- elif side == "left" and new_type in ["AUTO", "ALIGNED"]:
+ elif side == "left" and new_type in ["AUTO", "AUTO_CLAMPED",
+ "ALIGNED"]:
# change left handle
normal = (kf.co - kf.handle_right).normalized()
size = (kf.handle_left[0] - kf.co[0]) / normal[0]
@@ -1623,8 +1626,8 @@
handle_type_action_ob = bpy.props.StringProperty()
handle_type_child = bpy.props.StringProperty()
handle_type_old = bpy.props.EnumProperty(items=(("AUTO", "", ""),
- ("VECTOR", "", ""), ("ALIGNED", "", ""), ("FREE", "", "")),
- default='AUTO',)
+ ("AUTO_CLAMPED", "", ""), ("VECTOR", "", ""), ("ALIGNED", "", ""),
+ ("FREE", "", "")), default='AUTO',)
# visible in user interface
calculate = bpy.props.EnumProperty(name="Calculate",
@@ -1645,6 +1648,7 @@
update=internal_update)
handle_type = bpy.props.EnumProperty(name="Type",
items=(("AUTO", "Automatic", ""),
+ ("AUTO_CLAMPED", "Auto Clamped", ""),
("VECTOR", "Vector", ""),
("ALIGNED", "Aligned", ""),
("FREE", "Free", "")),
More information about the Bf-extensions-cvs
mailing list