Here's how to constrain the skydome rotation to the camera:
- Create a group for the skydome (skydome_GRP)
- Parent constrain skydome_GRP to the layout camera (driver: camera, driven: skydome_GRP), maintaining offset and ONLY constraining translation values
- Open the expression editor and create a new expression (skyRot)
- Enter these expressions (<skydome> is the name of the sky GEOMETRY, not group and <camera> is the full name of the layout camera):
| 
int $ct = `currentTime -q`; | 
| 
float $rx = `getAttr -time $ct <camera>.rotateX` - `getAttr -time 1 <camera>.rotateX`; 
float $ry = `getAttr -time $ct <camera>.rotateY` - `getAttr -time 1 <camera>.rotateY`; 
float $rz = `getAttr -time $ct <camera>.rotateZ` - `getAttr -time 1 <camera>.rotateZ`; | 
| 
<skydome>.rotateX = $deg * $rx; 
<skydome>.rotateY = $deg * $ry; 
<skydome>.rotateZ = $deg * $rz; | 
Hit create expression and you're done! 
No comments:
Post a Comment