Notifications
Clear all

[Closed] Renaming Biped Parts

hi, im writting a small script to rename part of a slected biped so it will work better with a new animation pipeline, coded the biped selection and all, just having a bit of trouble with the renaming of the selected biped parts.
heres my current code:

on tochar pressed do
(
i = bipList.items[bipList.selection]
try
(
(format i”
“)
select (biped.getNode i #pelvis link:1)
biped.getNode i #Head.name = “Head”
)
catch()
)
)

From the “(format i”
“) command i know that the right bip name is being used, but nothing is selected and nothing is renamed.

any help would be much appreacted.

4 Replies

You need to put your biped.getnode line in parenthesis. Try this:

 (biped.getNode i #Head).name = "Head"

–Jon

cheers jonlauf, worked perfectly!

but im having another problem now, im useing a selection box to find all the bipeds in the scene so the user can select 1 to rename. I’ve got all the code done for that, its just using that data.

i know the selection box thing is working fine becouse it prints out the name of the biped selected in the box, its just making that the current selection in the viewport is being a bit of a pain. Heres my code

 
on tochar pressed do
(
i = bipList.items[bipList.selection]
(format i" 
")
select(biped.getNode i #Head) 
)

The error message that keeps coming up is “Unable to convert: “Bip01” to type: Controller”

I’d have to see the rest of your code to say for certain, but I assume your listbox contains biped names and the biped.getNode method is expecting a controller. See if this works:

select (biped.getNode (getNodeByName i) #Head) 

But, if all you are trying to do is select the node from the it’s name in the list box you could use something simpler like:

select (getNodeByName bipList.selected)

yeah that works brilliantly, thanks soo much