PDA

View Full Version : Get Bone ID from Selected Bones? or from Bone Names?


Opifex
04-08-2012, 07:28 PM
I'm currently trying to get the bone ID's from an aray of bone names which i can use to select the bones that I want the ID of, but I'm unsure of how to get the bone ID.

Any help much apreciated, thanks CGSociety this script is almost complete.

denisT
04-09-2012, 04:41 PM
I'm currently trying to get the bone ID's from an aray of bone names which i can use to select the bones that I want the ID of, but I'm unsure of how to get the bone ID.

Any help much apreciated, thanks CGSociety this script is almost complete.

bone_id = for k=1 to (skinOps.GetNumberBones sk) where skinOps.GetBoneName sk k == bone_name do exit with k

it has to be optimized but try to find the way yourself...

Opifex
04-10-2012, 03:10 AM
bone_id = for k=1 to (skinOps.GetNumberBones sk) where skinOps.GetBoneName sk k == bone_name do exit with k

it has to be optimized but try to find the way yourself...

Thanks Denis, I found the way, but now I'm trying to use the result with
skinOps.SetVertexWeights <Skin> <vertex_integer> \ ( <vertex_bone_integer> | <vertex_bone_array> ) \ ( <weight_float> | <weight_array> )

but the result is something like this as an array
#(#(6), #(7), #(1), #(5), #(8), #(4), #(9), #(10), #(11), #(12), #(13), #(14), #(15), #(16), #(17), #(18), #(19), #(20), #(3), #(21), ...)

I'm not really sure these are usable as a <vertex_bone_array> or not, could you possibly help me again.

Opifex
04-10-2012, 03:25 AM
I think I need to somehow turn each one into an integer.

Opifex
04-10-2012, 03:59 AM
ok nevermind i should of been joining instead of appending thanks so much!! YOU'VE HELPED ME A TON DENIS!!

CGTalk Moderation
04-10-2012, 03:59 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.