Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rollout localtransformoffsets "Offset Animation" (
- local offsetPos = [0,0,0]
- local offsetRot = [0,0,0]
- local offsetScale = [0,0,0]
- EditText edtPostion "Position" text:"0,0,0"
- EditText edtRotation "Rotation" text:"0,0,0"
- EditText edtScale "Scale" text:"0,0,0"
- Group "Frame Range" (
- Spinner spStart "Start" type:#integer across:2
- Spinner spEnd "End" type:#integer
- )
- Button btnDoIt "Do It"
- HyperLink hyperWorm "Have a Good Diet of Worms" address:"http://dev.wallworm.com"
- function doOffsetPositions = (
- (offsetPos.x != 0 OR offsetPos.y != 0 OR offsetPos.z != 0)
- )
- function doOffsetRotations = (
- (offsetRot.x != 0 OR offsetRot.y != 0 OR offsetRot.z != 0)
- )
- function doOffsetScales = (
- (offsetScale.x != 0 OR offsetScale.y != 0 OR offsetScale.z != 0)
- )
- function offsetAnimation obj frame = (
- in coordsys local (
- if (doOffsetPositions()) then (
- at time frame obj.pos += offsetPos
- )
- if (doOffsetRotations()) then (
- at time frame obj.rotation += ((eulerAngles offsetRot.x offsetRot.y offsetRot.z) as quat)
- )
- if (doOffsetScales()) then (
- at time frame obj.scale += offsetScale
- )
- )
- )
- on btnDoIt pressed do (
- if selection.count == 0 then messagebox "Select Something" else (
- local doIt = true
- if selection.count > 1 then (doIt = queryBox "There are multiple objects selected. You sure about this?")
- if doIt then (
- offsetPosS = filterString edtPostion.text ","
- if offsetPosS.count == 3 then (
- offsetPos.x = offsetPosS[1] as float
- offsetPos.y = offsetPosS[2] as float
- offsetPos.z = offsetPosS[3] as float
- )
- offsetRotS = filterString edtRotation.text ","
- if offsetRotS.count == 3 then (
- offsetRot.x = offsetRotS[1] as float
- offsetRot.y = offsetRotS[2] as float
- offsetRot.z = offsetRotS[3] as float
- )
- offsetScaleS = filterString edtScale.text ","
- if offsetScaleS.count == 3 then (
- offsetScale.x = offsetScaleS[1] as float
- offsetScale.y = offsetScaleS[2] as float
- offsetScale.z = offsetScaleS[3] as float
- )
- doIt = (doOffsetPositions()) OR ( doOffsetRotations()) OR (doOffsetScales())
- if NOT doIt then (
- messagebox "Set some offsets."
- )
- )
- if doIt then (
- for obj in selection do (
- with animate on (
- for f = spStart.value to spEnd.value do (
- offsetAnimation obj f
- )
- )
- )
- )
- )
- )
- )
- createDialog localtransformoffsets
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement