Notifications
Clear all

[Closed] Wireparameter from the array

Hi
am trying to create a script to wire a parameter of multi cameras to a manipulator slider value
it work fine on the first item in the array but it stop after that because the base object
i can’t figure a solve for it
any suggestion please
here is my script:

rollout Floater “” width:200 height:70
(
button btn34 “X” pos:[170,3] width:15 height:15
button btn35 “-” pos:[155,3] width:15 height:15
button btn5 “[]” pos:[7,3] width:15 height:15
on btn34 pressed do
(

  try(cui.unRegisterDialogBar MY_ToolBox2Rol)


  catch()


  closerolloutfloater  MY_ToolBox2Rol

)
on btn35 pressed do
(

  cui.unRegisterDialogBar MY_ToolBox2Rol

)

on btn5 pressed do
(

  cui.DockDialogBar MY_ToolBox2Rol #cui_dock_right

)
)
MyChild=#()
MyTarget=#()
rollout Wirethem “Wire them” width:326 height:66
(

button pick_Childs_bt “Pick Childs” width:120
button pick_Target_bt “Pick Target” width:120
button Wire_bt “Wire These” width:120
button Free_bt “New Task” width:120

on pick_Childs_bt pressed do (
MyChild=getCurrentSelection()
pick_Childs_bt.text = MyChild.count as string +” objects”
)

on pick_Target_bt pressed do
(
append MyTarget $
pick_Target_bt.text = MyTarget.count as string +” objects”
)

on Wire_bt pressed do (
for i = 1 to MyChild.count do (
paramWire.connect MyTarget[i].baseObject[#value] MyChild[i].baseObject[#Exposure_Value] “value”
)
print MyChild
Print MyTarget
MyChild.wirecolor = red
)

on Free_bt pressed do (

  free MyChild
  pick_Childs_bt.text = "Pick Childs"
  free MyTarget
  pick_Target_bt.text ="Pick Target"
  )

)

MY_ToolBox2Rol = newRolloutFloater “MY ToolBox” 200 600 1250 100
addRollout Floater MY_ToolBox2Rol
addRollout Wirethem MY_ToolBox2Rol –rolledUp:true
–createdialog aaa style:#(#style_toolwindow, #style_sysmenu, #style_resizing) minSize:[190,310] maxSize:[190,310]
cui.RegisterDialogBar MY_ToolBox2Rol style:#(#cui_dock_vert,#cui_floatable,#cui_handles)
cui.getExpertMode()
updateToolbarButtons()