WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-14-2008, 03:28 PM
Frank Verberne Frank Verberne is offline
Member
 
Join Date: Mar 2008
Location: Netherlands
Posts: 148
Locking every bone of a character

I was wondering if it's possible to create a function to lock all bones of a character? The only way I could think of is this:
Code:
bones = ['Bip01', 'Bip01 Footsteps', 'Bip01 Head', 'Bip01 HeadNub', 
'Bip01 L Calf', 'Bip01 L Clavicle', 'Bip01 L Finger0', 'Bip01 L Finger01', 
'Bip01 L Finger0Nub', 'Bip01 L Finger1', 'Bip01 L Finger11',
'Bip01 L Finger1Nub', 'Bip01 L Finger2', 'Bip01 L Finger21', 
'Bip01 L Finger2Nub', 'Bip01 L Finger3', 'Bip01 L Finger31', 
'Bip01 L Finger3Nub', 'Bip01 L Finger4', 'Bip01 L Finger41', 
'Bip01 L Finger4Nub', 'Bip01 L Foot', 'Bip01 L Forearm', 'Bip01 L Hand', 
'Bip01 L Thigh', 'Bip01 L Toe0', 'Bip01 L Toe0Nub', 'Bip01 L UpperArm', 
'Bip01 Neck', 'Bip01 Pelvis', 'Bip01 R Calf', 'Bip01 R Clavicle', 
'Bip01 R Finger0', 'Bip01 R Finger01', 'Bip01 R Finger0Nub', 
'Bip01 R Finger1', 'Bip01 R Finger11', 'Bip01 R Finger1Nub', 
'Bip01 R Finger2', 'Bip01 R Finger21', 'Bip01 R Finger2Nub', 
'Bip01 R Finger3', 'Bip01 R Finger31', 'Bip01 R Finger3Nub', 
'Bip01 R Finger4', 'Bip01 R Finger41', 'Bip01 R Finger4Nub', 
'Bip01 R Foot', 'Bip01 R Forearm', 'Bip01 R Hand', 'Bip01 R Thigh', 
'Bip01 R Toe0', 'Bip01 R Toe0Nub', 'Bip01 R UpperArm', 'Bip01 Spine', 
'Bip01 Spine1', 'Bip01 Spine2']

def lock_all_bones():
	for i in range(0, len(bones)):
		bone = avatar.getBone(bones[i])
		bone.lock()
The only problem is that I had to manually fill bones[] with the right names, so it only works with characters that have these bones. Is it possible to fill this array with a function that goes through all the bones a character has? If so, how can it be accomplished? For example, if I would want to lock all the bones of the standard duck-character, I would have to manually change all the names in bones[] because I don't know a way to get the names of the bones otherwise.
Reply With Quote
  #2  
Old 03-14-2008, 05:32 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Use the following code to lock all bones of an avatar:
Code:
for bone in avatar.getRootBoneList():
	bone.lock(True)
Reply With Quote
  #3  
Old 03-17-2008, 10:21 AM
Frank Verberne Frank Verberne is offline
Member
 
Join Date: Mar 2008
Location: Netherlands
Posts: 148
Thank you, I wasn't aware of the function getRootBoneList(), but it works fine!
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
vcc avatars: defining bone length bjgold Vizard 1 08-08-2007 11:24 AM
Getting Complex Character Rigs in Vizard shivanangel Vizard 2 01-04-2007 06:57 PM
Avatar bone rotations respect to world MiamiTodd Vizard 3 02-14-2006 10:41 AM
No character studio! valhalla Vizard 1 09-14-2004 12:58 PM
avatar bone movement epl Vizard 3 05-03-2004 04:27 PM


All times are GMT -7. The time now is 12:47 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC