Add a new method for material animation.
This function would allow for independent channel animation on different faces of the same link or faces throughout a linkset.
Rules for a material channel override containing an empty list are not animated.
New/Improved Mode Flags:
ANIM_ON: Starts the animation.
LOOP: Repeats the animation indefinitely.
REVERSE: Plays the animation backward.
PING_PONG: Alternates between forward and backward animation.
SMOOTH: Provides smoother transitions between frames.
ROTATE: Rotates the texture map (e.g., for rotating textures).
SCALE: Animates texture scaling.
BLEND: Cross-fades between frames for smoother transitions.
RANDOM_START: Randomizes the start frame in the animation sequence.
SYNC_ALL_LINKS: Synchronizes animations across all linked objects.
SYNC_CHANNELS: Synchronizes animation material channels. ie base, metallic, normal, emission.
FRAME_BLEND: Allows frame blending (interpolation between frames).
The material rules would contain the following:
string material_UUID: Defines the texture asset to be used for the material.
integer size_x: Defines the grid size (for sprite sheet-based animations or texture tiling).
integer size_y: Defines the grid size (for sprite sheet-based animations or texture tiling).
float start: Start position in the animation cycle.
float length: Length of the animation cycle.
float rate: Speed of the animation.
float transition_time: Optional parameter for smooth transitions between frames.
Example Useage:
// Define mode flags
integer mode_flags_face_0 = ANIM_ON | LOOP | SMOOTH | SCALE;
integer mode_flags_face_1 = ANIM_ON | LOOP | REVERSE | PING_PONG;
integer mode_flags_face_2 = ANIM_ON | LOOP | SMOOTH | ROTATE | FRAME_BLEND;
// Animation rules for face 0 (Base Color, Metallic, Normal, Emission)
list base_color_rules_face_0 = ["UUID-of-BaseColor-Texture", 4, 4, 0.0, 1.0, 0.5];
list metallic_rules_face_0 = ["UUID-of-Metallic-Texture", 2, 2, 0.0, 1.0, 0.8];
list normal_rules_face_0 = ["UUID-of-Normal-Texture", 3, 3, 0.0, 1.0, 1.0];
list emission_rules_face_0 = ["UUID-of-Emission-Texture", 4, 4, 0.0, 1.0, 1.2];
// Animation rules for face 1 (Base Color, Metallic, Normal, Emission)
list base_color_rules_face_1 = ["UUID-of-BaseColor-Texture2", 3, 3, 0.0, 1.0, 1.0];
list metallic_rules_face_1 = ["UUID-of-Metallic-Texture2", 3, 3, 0.0, 0.5, 0.5];
list normal_rules_face_1 = ["UUID-of-Normal-Texture2", 3, 3, 0.0, 1.0, 1.0];
list emission_rules_face_1 = ["UUID-of-Emission-Texture2", 3, 3, 0.0, 0.8, 1.2];
// Animation rules for face 2 (Base Color, Metallic, Normal, Emission)
list base_color_rules_face_2 = ["UUID-of-BaseColor-Texture3", 5, 5, 0.0, 1.0, 1.0];
list metallic_rules_face_2 = ["UUID-of-Metallic-Texture3", 5, 5, 0.0, 1.0, 1.5];
list normal_rules_face_2 = ["UUID-of-Normal-Texture3", 5, 5, 0.0, 1.0, 1.0];
list emission_rules_face_2 = ["UUID-of-Emission-Texture3", 5, 5, 0.0, 1.0, 1.2];
// Set animations for face 0
llSetLinkMaterialAnim(2, 0, mode_flags_face_0, base_color_rules_face_0, metallic_rules_face_0, normal_rules_face_0, emission_rules_face_0);
// Set animations for face 1
llSetLinkMaterialAnim(2, 1, mode_flags_face_1, base_color_rules_face_1, metallic_rules_face_1, normal_rules_face_1, emission_rules_face_1);
// Set animations for face 2
llSetLinkMaterialAnim(2, 2, mode_flags_face_2, base_color_rules_face_2, metallic_rules_face_2, normal_rules_face_2, emission_rules_face_2);