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

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Picard <dam.pic@free.fr>2022-06-18 09:14:56 +0300
committerDamien Picard <dam.pic@free.fr>2022-06-18 11:30:44 +0300
commit8ea5c49499dcc171c400c88e7b478f46585e35d2 (patch)
tree313404b12a039f9ce7500b831a30b6bf039c530b
parent86abd3cf487b081fee71a6bbcec77bcc0a8f2ef7 (diff)
AnimAll: add material index for faces and curves
-rw-r--r--animation_animall.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/animation_animall.py b/animation_animall.py
index 9a0b7ddc..e7a12a2a 100644
--- a/animation_animall.py
+++ b/animation_animall.py
@@ -3,7 +3,7 @@
bl_info = {
"name": "AnimAll",
"author": "Daniel Salazar (ZanQdo), Damien Picard (pioverfour)",
- "version": (0, 9, 4),
+ "version": (0, 9, 5),
"blender": (3, 3, 0),
"location": "3D View > Toolbox > Animation tab > AnimAll",
"description": "Allows animation of mesh, lattice, curve and surface data",
@@ -41,6 +41,10 @@ class AnimallProperties(bpy.types.PropertyGroup):
name="Shape Key",
description="Insert keyframes on active Shape Key layer",
default=False)
+ key_material_index: BoolProperty(
+ name="Material Index",
+ description="Insert keyframes on face material indices",
+ default=False)
# Mesh attributes
key_vertex_bevel: BoolProperty(
@@ -158,6 +162,8 @@ class VIEW3D_PT_animall(Panel):
row = col.row(align = True)
row.prop(animall_properties, "key_attribute")
row.prop(animall_properties, "key_vertex_group")
+ row = col.row()
+ row.prop(animall_properties, "key_material_index")
# Vertex group update operator
if (context.active_object is not None
@@ -179,6 +185,8 @@ class VIEW3D_PT_animall(Panel):
row = col.row(align = True)
row.prop(animall_properties, "key_radius")
row.prop(animall_properties, "key_tilt")
+ row = col.row()
+ row.prop(animall_properties, "key_material_index")
elif obj.type == 'SURFACE':
row.prop(animall_properties, "key_point_location")
@@ -186,6 +194,8 @@ class VIEW3D_PT_animall(Panel):
row = col.row(align = True)
row.prop(animall_properties, "key_radius")
row.prop(animall_properties, "key_tilt")
+ row = col.row()
+ row.prop(animall_properties, "key_material_index")
col.separator()
col = layout.column(align=True)
@@ -258,6 +268,13 @@ class ANIM_OT_insert_keyframe_animall(Operator):
insert_key(point, 'co_deform', group="Point %s" % p_i)
else:
+ if animall_properties.key_material_index:
+ for s_i, spline in enumerate(data.splines):
+ if (not animall_properties.key_selected
+ or any(point.select for point in spline.points)
+ or any(point.select_control_point for point in spline.bezier_points)):
+ insert_key(spline, 'material_index', group="Spline %s" % s_i)
+
for s_i, spline in enumerate(data.splines):
if spline.type == 'BEZIER':
for v_i, CV in enumerate(spline.bezier_points):
@@ -335,6 +352,10 @@ class ANIM_OT_insert_keyframe_animall(Operator):
for uv_i, uv in enumerate(data.uv_layers.active.data):
if not animall_properties.key_selected or uv.select:
insert_key(uv, 'uv', group="UV layer %s" % uv_i)
+ if animall_properties.key_material_index:
+ for p_i, polygon in enumerate(data.polygons):
+ if not animall_properties.key_selected or polygon.select:
+ insert_key(polygon, 'material_index', group="Face %s" % p_i)
if animall_properties.key_attribute:
if data.attributes.active is not None: