[Bf-extensions-cvs] [86abd3cf] master: Animall: rename properties so they're more explicit and standard
Damien Picard
noreply at git.blender.org
Sat Jun 18 10:46:31 CEST 2022
Commit: 86abd3cf487b081fee71a6bbcec77bcc0a8f2ef7
Author: Damien Picard
Date: Sat Jun 18 08:09:12 2022 +0200
Branches: master
https://developer.blender.org/rBA86abd3cf487b081fee71a6bbcec77bcc0a8f2ef7
Animall: rename properties so they're more explicit and standard
- key_points -> key_point_location
- key_shape -> key_shape_key
- key_vgroups -> key_vertex_group
- key_ebevel -> key_edge_bevel
- key_vbevel -> key_vertex_bevel
===================================================================
M animation_animall.py
===================================================================
diff --git a/animation_animall.py b/animation_animall.py
index 06e5f7df..9a0b7ddc 100644
--- a/animation_animall.py
+++ b/animation_animall.py
@@ -30,63 +30,59 @@ class AnimallProperties(bpy.types.PropertyGroup):
key_selected: BoolProperty(
name="Key Selected Only",
description="Insert keyframes only on selected elements",
- default=False
- )
- key_shape: BoolProperty(
+ default=False)
+
+ # Generic attributes
+ key_point_location: BoolProperty(
+ name="Location",
+ description="Insert keyframes on point locations",
+ default=False)
+ key_shape_key: BoolProperty(
name="Shape Key",
description="Insert keyframes on active Shape Key layer",
- default=False
- )
- key_uvs: BoolProperty(
- name="UV Map",
- description="Insert keyframes on active UV coordinates",
- default=False
- )
- key_vbevel: BoolProperty(
+ default=False)
+
+ # Mesh attributes
+ key_vertex_bevel: BoolProperty(
name="Vertex Bevel",
description="Insert keyframes on vertex bevel weight",
- default=False
- )
- key_ebevel: BoolProperty(
- name="Edge Bevel",
- description="Insert keyframes on edge bevel weight",
- default=False
- )
- # key_vcrease: BoolProperty(
+ default=False)
+ # key_vertex_crease: BoolProperty(
# name="Vertex Crease",
# description="Insert keyframes on vertex crease weight",
- # default=False
- # )
- key_ecrease: BoolProperty(
- name="Edge Crease",
- description="Insert keyframes on edge crease weight",
- default=False
- )
- key_vgroups: BoolProperty(
+ # default=False)
+ key_vertex_group: BoolProperty(
name="Vertex Group",
description="Insert keyframes on active vertex group values",
- default=False
- )
+ default=False)
+
+ key_edge_bevel: BoolProperty(
+ name="Edge Bevel",
+ description="Insert keyframes on edge bevel weight",
+ default=False)
+ key_edge_crease: BoolProperty(
+ name="Edge Crease",
+ description="Insert keyframes on edge creases",
+ default=False)
+
key_attribute: BoolProperty(
name="Attribute",
description="Insert keyframes on active attribute values",
- default=False
- )
- key_points: BoolProperty(
- name="Points",
- description="Insert keyframes on point locations",
- default=False
- )
+ default=False)
+ key_uvs: BoolProperty(
+ name="UVs",
+ description="Insert keyframes on active UV coordinates",
+ default=False)
+
+ # Curve and surface attributes
key_radius: BoolProperty(
name="Radius",
description="Insert keyframes on point radius (Shrink/Fatten)",
- default=False
- )
+ default=False)
key_tilt: BoolProperty(
name="Tilt",
description="Insert keyframes on point tilt",
- default=False
- )
+ default=False)
# Utility functions
@@ -147,21 +143,21 @@ class VIEW3D_PT_animall(Panel):
row = col.row(align = True)
if obj.type == 'LATTICE':
- row.prop(animall_properties, "key_points")
- row.prop(animall_properties, "key_shape")
+ row.prop(animall_properties, "key_point_location")
+ row.prop(animall_properties, "key_shape_key")
elif obj.type == 'MESH':
- row.prop(animall_properties, "key_points")
- row.prop(animall_properties, "key_shape")
- row = col.row(align = True)
- row.prop(animall_properties, "key_vbevel")
- row.prop(animall_properties, "key_ebevel")
- row = col.row(align = True)
- row.prop(animall_properties, "key_ecrease")
+ row.prop(animall_properties, "key_point_location")
+ row.prop(animall_properties, "key_shape_key")
+ row = col.row()
+ row.prop(animall_properties, "key_vertex_bevel")
+ row.prop(animall_properties, "key_edge_bevel")
+ row = col.row()
+ row.prop(animall_properties, "key_edge_crease")
row.prop(animall_properties, "key_uvs")
row = col.row(align = True)
row.prop(animall_properties, "key_attribute")
- row.prop(animall_properties, "key_vgroups")
+ row.prop(animall_properties, "key_vertex_group")
# Vertex group update operator
if (context.active_object is not None
@@ -178,15 +174,15 @@ class VIEW3D_PT_animall(Panel):
break
elif obj.type == 'CURVE':
- row.prop(animall_properties, "key_points")
- row.prop(animall_properties, "key_shape")
+ row.prop(animall_properties, "key_point_location")
+ row.prop(animall_properties, "key_shape_key")
row = col.row(align = True)
row.prop(animall_properties, "key_radius")
row.prop(animall_properties, "key_tilt")
elif obj.type == 'SURFACE':
- row.prop(animall_properties, "key_points")
- row.prop(animall_properties, "key_shape")
+ row.prop(animall_properties, "key_point_location")
+ row.prop(animall_properties, "key_shape_key")
row = col.row(align = True)
row.prop(animall_properties, "key_radius")
row.prop(animall_properties, "key_tilt")
@@ -202,7 +198,7 @@ class VIEW3D_PT_animall(Panel):
row = layout.row()
row.operator("anim.clear_animation_animall", icon="CANCEL")
- if animall_properties.key_shape:
+ if animall_properties.key_shape_key:
shape_key = obj.active_shape_key
shape_key_index = obj.active_shape_key_index
@@ -221,7 +217,7 @@ class VIEW3D_PT_animall(Panel):
else:
row.label(text="No active Shape Key", icon="ERROR")
- if animall_properties.key_points and animall_properties.key_shape:
+ if animall_properties.key_point_location and animall_properties.key_shape_key:
row = layout.row()
row.label(text='"Points" and "Shape" are redundant?', icon="INFO")
@@ -249,14 +245,14 @@ class ANIM_OT_insert_keyframe_animall(Operator):
data = obj.data
if obj.type == 'LATTICE':
- if animall_properties.key_shape:
+ if animall_properties.key_shape_key:
if obj.active_shape_key_index > 0:
sk_name = obj.active_shape_key.name
for p_i, point in enumerate(obj.active_shape_key.data):
if not animall_properties.key_selected or data.points[p_i].select:
insert_key(point, 'co', group="%s Point %s" % (sk_name, p_i))
- if animall_properties.key_points:
+ if animall_properties.key_point_location:
for p_i, point in enumerate(data.points):
if not animall_properties.key_selected or point.select:
insert_key(point, 'co_deform', group="Point %s" % p_i)
@@ -269,7 +265,7 @@ class ANIM_OT_insert_keyframe_animall(Operator):
or CV.select_control_point
or CV.select_left_handle
or CV.select_right_handle):
- if animall_properties.key_points:
+ if animall_properties.key_point_location:
insert_key(CV, 'co', group="Spline %s CV %s" % (s_i, v_i))
insert_key(CV, 'handle_left', group="Spline %s CV %s" % (s_i, v_i))
insert_key(CV, 'handle_right', group="Spline %s CV %s" % (s_i, v_i))
@@ -283,7 +279,7 @@ class ANIM_OT_insert_keyframe_animall(Operator):
elif spline.type in ('POLY', 'NURBS'):
for v_i, CV in enumerate(spline.points):
if not animall_properties.key_selected or CV.select:
- if animall_properties.key_points:
+ if animall_properties.key_point_location:
insert_key(CV, 'co', group="Spline %s CV %s" % (s_i, v_i))
if animall_properties.key_radius:
@@ -297,38 +293,37 @@ class ANIM_OT_insert_keyframe_animall(Operator):
for obj in [o for o in objects if o.type in {'MESH', 'CURVE', 'SURFACE'}]:
data = obj.data
if obj.type == 'MESH':
- if animall_properties.key_points:
+ if animall_properties.key_point_location:
for v_i, vert in enumerate(data.vertices):
if not animall_properties.key_selected or vert.select:
insert_key(vert, 'co', group="Vertex %s" % v_i)
- if animall_properties.key_vbevel:
+ if animall_properties.key_vertex_bevel:
for v_i, vert in enumerate(data.vertices):
if not animall_properties.key_selected or vert.select:
insert_key(vert, 'bevel_weight', group="Vertex %s" % v_i)
+ # if animall_properties.key_vertex_crease:
+ # for v_i, vert in enumerate(data.vertices):
+ # if not animall_properties.key_selected or vert.select:
+ # insert_key(vert, 'crease', group="Vertex %s" % v_i)
- if animall_properties.key_ebevel:
- for e_i, edge in enumerate(data.edges):
- if not animall_properties.key_selected or edge.select:
- insert_key(edge, 'bevel_weight', group="Edge %s" % e_i)
-
- if animall_properties.key_vgroups:
+ if animall_properties.key_vertex_group:
for v_i, vert in enumerate(data.vertices):
if not animall_prope
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list