How to paint weight on Blendshape?

   9753   7   2
User Avatar
Member
42 posts
Joined: Dec. 2016
Offline
Say I have a skinny man and a muscular man, both same topology. I want to make the arm of skinny man become muscular hand, so i select only the points on arm(until shoulder) and apply blendshape. Now comes the problem where the shoulder surface is not in smooth transition.

So how can I paint the weight for blendshape like in maya? I tried add a paint sop, and selected Color(Cd) under blendshape's “point Id attribute”, but not working.
User Avatar
Member
918 posts
Joined: March 2014
Offline
The ID attribute is only there to match points from the incoming shapes. It doesn't help with the painting.

I too miss an option for supplying a ‘mask’ on the blend shape SOP. I guess it's a good time to file an RFE.
In the meantime please have a look at the attached file. I hope it helps.

Andy

Attachments:
blend_with_paint_v01.hip (242.8 KB)

User Avatar
Member
42 posts
Joined: Dec. 2016
Offline
Andy58
The ID attribute is only there to match points from the incoming shapes. It doesn't help with the painting.

I too miss an option for supplying a ‘mask’ on the blend shape SOP. I guess it's a good time to file an RFE.
In the meantime please have a look at the attached file. I hope it helps.

Andy
Your attached hip file does what i needed! Thanks!
User Avatar
Member
46 posts
Joined: Dec. 2016
Offline
Hey Andy! thanks for your hip file!

I have few concerns on how about it works though….

@P *= (1-@opinput1_blend * ch(“intensity”));
@P += (@opinput1_P * @opinput1_blend * ch(“intensity”));



1.I see that you are using “@opinput1_blend”, and this is confusing me a little bit… I saw that “@opinput1_blend” is multiplied by “ch(”intensity“)” so I assume that is using a channel function blend.. is this right? Is this the way to use directly in vex channels functions?

2. why “@opinput1_blend” is subtracted from 1? is this getting me the initial valor of opinput1 before it gets blended?

I am really confused! a little bit of explanation would be really appreciated!

Thanks!
User Avatar
Member
8177 posts
Joined: Sept. 2011
Offline
Subtraction from one is the complement of the blend, it follows from the linear interpolation equation:

C = A * (1-a) + B * a

such that C = A when a = 0, and C = B when a = 1

A less verbose way to write it would be to use the built-in ‘lerp’ function:
C = lerp(A, B, a)

http://www.sidefx.com/docs/houdini/vex/functions/lerp.html [www.sidefx.com]

In your case, the vex could be simplified as:

@P = lerp(@P, v@opinput1_P, f@opinput1_blend * ch("intensity"));
User Avatar
Member
1755 posts
Joined: March 2014
Offline
Ay ay ay! I hope this feature's on way, no later than 17.
User Avatar
Member
8177 posts
Joined: Sept. 2011
Offline
I think the node you are looking for is called ‘attribute composite’

http://www.sidefx.com/docs/houdini/nodes/sop/attribcomposite.html [www.sidefx.com]

Attachments:
attrib_comp.zip (106.6 KB)

User Avatar
Member
1755 posts
Joined: March 2014
Offline
@jsmack I was referring to the feature “to paint weight on Blendshape”, which is a straightforward way to solve a problem, for cases when you don't need anything more than that. I have solve my problem by using your more elegant code of Andy58's vex solution for now, but I'll make sure I'll study that node to see how it may help me in the future. Thanks for this info.
  • Quick Links