Capture weights cleanup with a Point Wrangle

   1482   3   0
User Avatar
Member
313 posts
Joined: Oct. 2016
Offline
Hi, it feel a bit embarrassing to ask for help but since people are very helpful in this community why not ask?

My capture weights for a KineFX rig has some incorrect influences so the idea is to go VEX using a Point Wrange for that.

Here's my algorithm so far:

// if point in prim group called group:tongue1
if ( inprimgroup ( 0, "tongue1", @primnum ) )

// go through all boneCapture regn[n]

// if influence from Jaw_1 or Jaw_2 is found, delete it or set it to 0

Do you happen to know some or all of the missing syntax?
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
User Avatar
Member
9374 posts
Joined: July 2007
Offline
https://www.sidefx.com/forum/topic/86029/ [www.sidefx.com]
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
313 posts
Joined: Oct. 2016
Offline
tamte
https://www.sidefx.com/forum/topic/86029/ [www.sidefx.com]

Thanks for the reply.

The case is so that it is only the tongue group that should get rid of all weights from joints Jaw_1 and Jaw_2.

If the VEX function find() only run once to return the index of a given string maybe it is meaningful to add a Capture Attribute Unpack node. However, for "simplicity" (less nodes and more VEX) maybe it is possible to do this without it. The author also mentions "It's a little counter-intuitive" so I'll avoid that route for now.

The method to use Capture Correct SOP I've been using for optimization to remove tiny small weights. However, I don't see how to easily limit the effect to only a given group (such as tongue_1)

Probably I'll just have to learn this from the basics (VEX). Thanks anyway.

Edit: In the initial example getting the group works, and can be used to set a color. Now I just want to filter out specific capture regions (using strings, not integers) and initially set them to 0.
Edited by SWest - Sept. 16, 2023 04:28:33
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
User Avatar
Member
313 posts
Joined: Oct. 2016
Offline
It took a couple of hours to learn this because I almost know no VEX, but this is what was expected:

// VEX used to delete joint influence
// SWest 2023

// Dependencies: 
// place this VEX in a pointwrangle node (it support group filtering)
// add a captureattributeunpack before it 
// add a captureattributepack node after 

// TUI
string influences_to_delete[] = {"Jaw_1","Jaw_2"};

// routine
string influence_to_delete;
for(int i = 0; i < len(influences_to_delete); i++)
{
influence_to_delete = influences_to_delete[i];
string joint_names[] = detail(0, "boneCapture_pCaptPath", 0);
int joint_index = find(joint_names, influence_to_delete);
i[]@boneCapture_index;
f[]@boneCapture_data;
int find_res = find(@boneCapture_index, joint_index);
pop( @boneCapture_index, find_res );
pop( @boneCapture_data, find_res );
}

Attachments:
output.gif (682.3 KB)

Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
  • Quick Links