Itoo Software Forum

Author Topic: OffsetMap in Animate Scale by Age Effect  (Read 1609 times)

BC2301

  • Newbie
  • *
  • Posts: 2
OffsetMap in Animate Scale by Age Effect
« on: October 02, 2019, 09:45:24 AM »
Hello :)

I'm working on a large-scale scene and I need to animate growing trees by gradient. I want to use Effect  "Animate Scale by Age". I found that wideo showing exactly the effect, that I need to achieve (in 1:50 starts):

https://www.youtube.com/watch?v=S2Ad96anPMQ

My problem is that I don't know how to add Offset map into that effect, like in the video. Can anyone tip me how the scripted effect should looks like?

Best Regards :)


Michal Karmazín

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2447
Re: OffsetMap in Animate Scale by Age Effect
« Reply #1 on: October 02, 2019, 10:20:06 AM »
Hi,

To support the map input, that'll drive the Animation Offset, the "Animate Scale by Age" effect should be modified in the following way (please find attached the complete .eff file):

vector offsetMapAmount = evaluateTexture(OffsetMap,fpItem.distUVW); real randomStartTime = randomReal(RandomStart, RandomEnd)+(OffsetStart*offsetMapAmount.x);
real TimeInSecs = Max.time/4800.0;
real ActiveTime = if(TimeInSecs>randomStartTime,TimeInSecs-randomStartTime,0.0);

real timePosition = min(1,ActiveTime/SecondsToAnimate);
real newScale = evaluateCurve(XYZ_Scale,timePosition);
fpItem.scale = [newScale,newScale,newScale];


Just please take in mind, the "OffsetStart" parameter should be set to any "non-zero" value.

I hope that helps.

Best regards,

BC2301

  • Newbie
  • *
  • Posts: 2
Re: OffsetMap in Animate Scale by Age Effect
« Reply #2 on: October 02, 2019, 12:11:44 PM »
Thank You - that helped me a lot :)