how to create boneCapture attribute via python

   7978   8   2
User Avatar
Member
1799 posts
Joined: 10月 2010
Offline
Hi, I am wondering if someone has been able to do this before.

I am trying to extract some weights from an xml file into houdini; however, I am a bit confused on how to create the boneCapture attribute correctly via python?

I notice that when you create it using a capture SOP, it is named boneCapture (the four indices symbolizing bone name, weight value, bone name, weight value, etc.)

When looking at this attribute in the details view, it looks like the bone capture attributes are named

boneCapture regn, boneCapture w, boneCapture regn, boneCapture w…

I created mine as a simple array (boneCapture, boneCapture, boneCapture, etc, but when feeding this into a deform SOP, I get the “No Capture Attributes Exists error”

any help on this would be greatly appreciated!

thank you!
-G
User Avatar
Member
606 posts
Joined: 5月 2007
Offline
If you look at it in the right click -> Extended Information panel, you see its type is “Index Pair”. It is a special type of attribute, that can only be created in HDK, as far as I know.

When I was down that road, I created some dummy bones and a Capture SOP, just to create those attributes
User Avatar
Member
1799 posts
Joined: 10月 2010
Offline
hey eetu, creating those attributes with the bones in the scene actually worked! the part I am having a bit of a hard time now is setting the attribute to be the right size (i.e. boneCapture or boneCapture) so that when I try to set it via my script, it does not fail.

I was looking into the captureOverride as a means to set point 0 to have the right amount of dummy influences, but it seems to act a bit weird at times. What did you do to get around this problem?

thank you for the help!
-G
User Avatar
Member
183 posts
Joined: 12月 2011
Offline
Hi GrayOlorin, I am struggling with this same issue and was wondering if you've figured out this problem?
User Avatar
Member
1799 posts
Joined: 10月 2010
Offline
Hey 90ender, I unfortunately had to move to something else. However, my difficulty was being able to set the number of influences, which since then, a python function has been added specifically to do so (I cannot recall the function right now, but I believe is part of hou.Geometry )
-G
User Avatar
Member
183 posts
Joined: 12月 2011
Offline
Great to know. I will start looking there. Thanks!
User Avatar
Member
1799 posts
Joined: 10月 2010
Offline
btw I think this is the one:

https://www.sidefx.com/docs/houdini13.0/hom/hou/IndexPairPropertyTable [sidefx.com]


you can return one of these using hou.Attrib

However, I seem to be missing the function for adding or removing indices.. mhhh… I am going to have to dig in a bit more through my emails
-G
User Avatar
Member
2 posts
Joined: 8月 2010
Offline
Sorry for necro-posting, but this thread still pops up as the 1st result in google on the boneCapture subject.
In case someone else would get here...

THE SOLUTUTION:
Capture Attribute Pack/Unpack nodes:
https://www.sidefx.com/docs/houdini/nodes/sop/captureattribpack.html [www.sidefx.com]
https://www.sidefx.com/docs/houdini/nodes/sop/captureattribunpack.html [www.sidefx.com]

Unpack the attrib to a regular attribs, do whatever you want with python/vex, pack them back.
The boneCapture attrib itself stays "a special snowflake" and you can't/shouldn't modify it directly. (I geuess, SideFX does some performance-optimised C++-side mumbo-jumbo when this attrib is set, so you shouldn't be editing it after packing anyway).
Edited by terk-dsn - 2021年2月22日 15:25:39
User Avatar
Member
1 posts
Joined: 12月 2016
Offline
terk-dsn
THE SOLUTUTION:
.

Thank you very much. It is my big luck to see this and a very big gap in Houdini help
  • Quick Links