connecting slider with position controller in position list

281 views Asked by At

I made script for facial rigging, and I used wire parrameter for connecting sliders to position axis of face nodes, but when I add more than one Position_XYZ controller to the position list, I cannot wire by the scripting the new slider to the second Position_XYZ because the second has same name, that means I have two position_XYZ controller and when I wire the second slider to the second position_XYZ by the script, then the script wire the second to the first Postion_XYZ, how can I fix this problem?

2

There are 2 answers

3
Swordslayer On

Rename the controller and fix the script. With such a general question with no code whatosoever, there's no way to give a specific answer.

0
Laszlo Sebo On

You should reference the subcontrollers in the list controller by indexing its subanims instead of directly by names:

CLEyelidUpper.pos.controller.Available.controller = Position_XYZ()
paramWare.connect $faceCControl.modifier[#PEN_Attribute_Holder].faceCon[#EyeWi‌​deL] $ClEyelidUpper.pos.controller[1].controller[#X_Pos‌​iton] "EyeWideL*0.0025"

If you want to assign to the last position_XYZ that you just added, simply use the .count property:

$ClEyelidUpper.pos.controller[$ClEyelidUpper.pos.controller.count].controller[#X_Pos‌​iton]