Riffmaster
07-05-2011, 05:19 PM
I am putting together a simple script that lists all current scene cameras into a drop down list which I have setup below.
However as I select the items from the drop down list I also want it to select the corresponding camera in the scene. Obviously the items are stored in the list as string values, how can I convert these into object names eg. Converting the format of "Camera01" into $Camera01.
Thanks,
D.
CurrentCam = "NONE"
try(destroyDialog CamUtil)catch()
rollout CamUtil "Camera Match Utility" width:112 height:56
(
dropDownList ddl1 "Current Camera" pos:[10,8] width:100 height:10
fn getCams =
(
ddl1.items = sort (for c in cameras where (isKindOf c camera) collect c.name)
)
on ddl1 selected itm do
(
Currentcam = ddl1.selected
--select currentcam
)
on CamUtil open do
(
getcams()
registerRedrawViewsCallback getCams
)
)
Createdialog CamUtil
However as I select the items from the drop down list I also want it to select the corresponding camera in the scene. Obviously the items are stored in the list as string values, how can I convert these into object names eg. Converting the format of "Camera01" into $Camera01.
Thanks,
D.
CurrentCam = "NONE"
try(destroyDialog CamUtil)catch()
rollout CamUtil "Camera Match Utility" width:112 height:56
(
dropDownList ddl1 "Current Camera" pos:[10,8] width:100 height:10
fn getCams =
(
ddl1.items = sort (for c in cameras where (isKindOf c camera) collect c.name)
)
on ddl1 selected itm do
(
Currentcam = ddl1.selected
--select currentcam
)
on CamUtil open do
(
getcams()
registerRedrawViewsCallback getCams
)
)
Createdialog CamUtil
