From the start, I wanted things like "Time" to be a little easier to understand so 0 - 24 seemed more appropriate. Yes I could have made this anything, it is an alien planet after all and days could be longer, but for the sake of usability: 7 is morning, 12 is midday, 8 is evening, etc.
Originally I used the maya command:
maya.cmds.connectControl(scene_time, "grp_light_control.rotateX") where the group held a light whose pivot rotated around the scene. For testing purposes I had to set the slider from 0 - 360 to work.
To get a better slider scale to work I was first a little stumped. I thought I'd have to add new attributes to objects with a scale I wanted, then use the hypershade editor to connect them to the existing attributes that needed to be controlled. Although I did need new attributes, set driven key was the solution.
Simply, I had to create a new attribute on the object I was controlling, so for the light control I added a variable named scene_time which had a minimum of 0 and maximum of 24. I then used set driven key to key the object's rotation (where 0 was 0 and 24 was 360). And now I have sliders that are appropriately scaled, hooray.
maya.cmds.connectControl(scene_time, "grp_light_control.rotateX") where the group held a light whose pivot rotated around the scene. For testing purposes I had to set the slider from 0 - 360 to work.
To get a better slider scale to work I was first a little stumped. I thought I'd have to add new attributes to objects with a scale I wanted, then use the hypershade editor to connect them to the existing attributes that needed to be controlled. Although I did need new attributes, set driven key was the solution.
Simply, I had to create a new attribute on the object I was controlling, so for the light control I added a variable named scene_time which had a minimum of 0 and maximum of 24. I then used set driven key to key the object's rotation (where 0 was 0 and 24 was 360). And now I have sliders that are appropriately scaled, hooray.
No comments:
Post a Comment