Notifications
Clear all
[Closed] custom attributes ui & controller connection severed
Sep 29, 2010 9:11 am
Ive made custom attributes on a modifier that i will use to drive finger rotations in a rig. Im having a hard time understanding why the connection between the ui spinners and their controllers is severed if re-open the scene?
for o in selection do
(
try if o.modifiers[1].name == "Fingers" do deletemodifier o 1 catch()
b = emptymodifier()
b.name = "Fingers"
try addmodifier o b catch()
fing = attributes fingers
(
parameters main rollout:fingers_ro
(
ff type:#float ui:ffi default:0.0 animatable:true
bf type:#float ui:bfi default:0.0 animatable:true
lf type:#float ui:lfi default:0.0 animatable:true
rf type:#float ui:rfi default:0.0 animatable:true
)
rollout fingers_ro "Finger rotations" width:161 height:50
(
spinner ffi "Front" range:[-1.5,1.5,0.05] scale:0.01
spinner bfi "Back" range:[-1.5,1.5,0.05] scale:0.01
spinner lfi "Left" range:[-1.5,1.5,0.05] scale:0.01
spinner rfi "Right" range:[-1.5,1.5,0.05] scale:0.01
)
)
custattributes.add o.modifiers["Fingers"] fing
for j = 1 to 4 do o.modifiers["Fingers"].fingers[j].controller = bezier_float()
puoli ="L"
if (findstring o.name"_L") != undefined then puoli = "L" else puoli = "R"
fingerz = #("F","B","L","R")
for j in fingerz do
(
kont = Float_expression()
kont.AddScalarTarget "daa" (execute("$.modifiers[1].fingers."+j+"f.controller"))
kont.Setexpression "daa"
kont2 = Float_expression()
kont2.AddScalarTarget "daa" (execute("$.modifiers[1].fingers."+j+"f.controller"))
kont2.Setexpression "-daa"
execute("$kurki_RIG_leg_"+puoli+"_fingerbone_"+j+"_01.rotation.controller[1][2].controller = kont")
execute("$kurki_RIG_leg_"+puoli+"_fingerbone_"+j+"_02.rotation.controller[1][3].controller = kont2")
)
)