[WSE] Body customization with vertex animations

Users who are viewing this thread

Hi everyone. Im trying to make use of this function using WSE2 to allow for body customization with vertex animations.
First i tried to defom the mesh 4, corresponding to the armor or body on mission_templates.py when in town:
Python:
common_body_build_agent = (
  ti_on_agent_spawn, 0, 0, [
    (store_trigger_param_1, ":agent_no"),
    (get_player_agent_no, ":player_agent"),
    (eq, ":agent_no", ":player_agent"),
  ], [
    (store_trigger_param_1, ":agent"),
    (agent_body_meta_mesh_get_current_deform_frame, ":frame", ":agent", 4),
    (assign, reg5, ":frame"),
    (display_log_message, "@Frame = {reg5}"),# Prints 0
    #(agent_body_meta_mesh_deform_in_range, ":agent", bmm_armor, 10, 50, 10000),
    (agent_body_meta_mesh_set_vertex_keys_time_point, ":agent", bmm_armor, 50),
    (agent_body_meta_mesh_get_current_deform_frame, ":frame", ":agent", 4),
    (assign, reg5, ":frame"),
    (display_log_message, "@Frame = {reg5}"),# Prints 50
  ])
I have a body mesh with about 6 vertex animation frames, set to 0=0, 1=10, 2=20 up to 5=50, but when i call agent_body_meta_mesh_deform_in_range at the agent spawn, the game shows a second body mesh flickering performing the animation on t-pose, unnafected by skining while the original body also flickers during the time (10s), after that, it stops and only the original body remains (my character is naked the whole time).
When i call agent_body_meta_mesh_set_vertex_keys_time_point nothing happens.

So i tested this code using something like this flail code, only instead of a flail, im using the same body mesh for the weapon:
Python:
["sword_test_mesh", "Test Blade", [("human_male_body",0),("khergit_sword_b_scabbard", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_scimitar|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
 105 , weight(1.25)|difficulty(0)|spd_rtng(100) | weapon_length(97)|swing_damage(29 , cut),imodbits_sword_high, [(ti_on_weapon_attack,
    [
      (get_player_agent_no, ":player_agent"),
      (try_begin),
        (agent_get_wielded_item_slot_no, ":slot_no", ":player_agent"),
        (val_add, ":slot_no", bmm_item_1),
        #(agent_body_meta_mesh_set_vertex_keys_time_point, ":player_agent", ":slot_no", 10),
        (agent_body_meta_mesh_deform_in_range, ":player_agent", ":slot_no", 10, 50, 10000),
        (agent_body_meta_mesh_set_vertex_keys_time_point, ":player_agent", bmm_armor, 50),
        (agent_play_sound, ":player_agent", "snd_shield_hit_metal_metal"),# sound to see its beeing called
      (try_end),
    ])]],
With this code, the weapon performs the deformation flawlessly, but nothing happens to the body mesh.
Is it possible to do this with a skinned mesh? kind of what this post shows.
Any insight is appreciated.
 
Solution

Tested agent_body_meta_mesh_deform_in_range an this is works perfectly with body.
But your armor mesh must have material with skin shader, so only cpu skinning doesn't really work with vertex animation.
It's not even a problem, given that ALL rigged meshes MUST have a skin shader, otherwise there will be performance issues.
I don't have an answer for you, but I am super interested in this idea. What a fantastic idea!

I'll sit down tonight and see about helping suss out a solution for you, but I wanted to post and follow the thread just in case.
 
Upvote 0
Thanks, i tested the weapon animation script using a module with wse1 but it's the same behavior.
Notice that with the agent spawn, the log prints the expected values, just does not deform the mesh.
 
Upvote 0
Tried this trigger:
Python:
player_body_build_agent = (
  0, 0, 0, [], [
    (get_player_agent_no, ":player_agent"),
    (agent_body_meta_mesh_set_vertex_keys_time_point, ":player_agent", bmm_armor, 50),
    (agent_play_sound, ":player_agent", "snd_shield_hit_metal_metal"),# sound to see its beeing called
  ])
I asume this gets called every frame, the sound gets played but the body remains unaffected, im gonna try this for other body meshes like the foots.
Edit: It works for bmm_left_foot and bmm_left_hand, sadly those parts do not get affected by skinning
 
Last edited:
Upvote 0
Thanks. Just tried discarding the skinning from the body in the brf file and now the vertex animation plays as expected with both methods on t pose (agent_body_meta_mesh_deform_in_range and agent_body_meta_mesh_set_vertex_keys_time_point) on agent spawn.
Looks like the cause is that armature and vertex animations just dont work together on the game.
 
Upvote 0

Tested agent_body_meta_mesh_deform_in_range an this is works perfectly with body.
But your armor mesh must have material with skin shader, so only cpu skinning doesn't really work with vertex animation.
It's not even a problem, given that ALL rigged meshes MUST have a skin shader, otherwise there will be performance issues.
 
Upvote 1
Solution
There it worked thank you! I dont know anithing about shaders, but the one from core_shaders.brf called "standart_shader_skin_nobump_nospec" worked. I asume its because of the technique it uses, because i tried others with the flag "uses skinning" but didn´t work.
 
Upvote 0
Back
Top Bottom