Notifications
Clear all
[Closed] List all Cameras in a Dropdown list, how?
Apr 09, 2008 4:45 am
You know when you press C you get a list of all your Cameras that you can select? How do I apply this to a dropdownlist and when the user selects the camera from the list, the viewport now views from that camera?
Im completely lost on where to start with this. Here is what I have:
group "Camera"
(
dropdownlist camSelect
)
I hope thats not too complicated
3 Replies
Apr 09, 2008 4:45 am
Hi,
here you go
(
rollout test_rollout "test"
(
local cams=#()
dropdownlist camSelect
on test_rollout open do
(
-- grab al cameras in the scene
cams = for c in cameras where classof c != TargetObject collect c
-- get the camera names
items = for c in cams collect c.name
-- populate the dropdown list items
camSelect.items = items
)
on camSelect selected i do
(
-- set the viewport to the chosen camera
viewport.setCamera cams[i]
)
)
createdialog test_rollout
)
Apr 09, 2008 4:45 am
You can also use my ViewportControl script…
http://www.neilblevins.com/soulburnscripts/soulburnscripts.htm
Just use the viewportControlCamera macroscript and hook it up to an icon or hotkey.
- Neil
Apr 09, 2008 4:45 am
Thanks for the reply guys! ZBuffer, I used your script and it works great! Thanks for the help on this
SoulBurn, I will check out your script also, thanks for posting!