Light object rotating using slider
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi guys. I have a bit an issue with a project I'm currently working on. Basically I'm trying to create a very very basic slider which is hooked up to my light object and this will essentially replicate hours of the time. But my issue is, is that I cant get it to work or even I cant find the right type of slider. Heres what I have now:
And heres my code for it:
frameLayout -collapsable true -label "Time Options"; gridLayout -cellWidthHeight 300 50 -numberOfColumns 2; attrFieldSliderGrp -label "Time 24H" -min 0 -max 24 -sliderMinValue 0 -sliderMaxValue 24 -at sun_light.rotateX;
What I need this to do is to show in my window an integer of 1-24 (the 24 hour system we use) but on the actual attribute (light object(lets just call it sun_light for now)) it needs to be rotating at a certain angle. I thought maybe using the expression editor would be a good way to get around this but I don't know how I would calculate the rotation values and how I would hook them up with each other.
So for example if the slider is at a value of 5 which in 24 hour time would be 05:00, the sun_light object would be rotated at a certain angle to replicate that.
I made a thread a while back regarding a similar issue to this but I wanted to try using something less similar and using as little code as possible in order to achieve a simple script (if there is even such a thing as a simple script haha), thanks.