### Author Topic: Effect - move instances back 1m at frame -1  (Read 2052 times)

#### George

• Full Member
• Posts: 122
##### Effect - move instances back 1m at frame -1
« on: January 24, 2018, 07:51:17 AM »
Could I get a hand with this? It isn't quite doing what I expect.

vector currentPosition = fpItem.position;
vector currentRotation = fpItem.rotation;

real angle = currentRotation.z;
vector rotationVector = [cos(angle),sin(angle),0];

fpItem.position = currentPosition + (rotationVector * 1) * min(Max.time, 0);

#### Michal Karmazín

• iToo Software
• Hero Member
• Posts: 1736
##### Re: Effect - move instances back 1m at frame -1
« Reply #1 on: January 24, 2018, 03:21:01 PM »
Hi,

First let me mention, that the current animation time is being measured in ticks - 4800 ticks per second. Depending on your frame rate you'll get the corresponding value for one frame (when using the default rate 30 FPS, one frame corresponds to 4800/30 = 160 ticks).

Please describe more in detail, how the final effect should behave.

For example, to move it on the Z axis you can use the following expression:

fpItem.position.z = min(Max.time/160, 0);

Thanks in advance for any further comments.

Best regards,

#### George

• Full Member
• Posts: 122
##### Re: Effect - move instances back 1m at frame -1
« Reply #2 on: January 24, 2018, 03:42:18 PM »
It should move -1m along its forward vector, which i'm trying to get from the rotation. The effect i'm trying to achieve is cars on a road, and if i move them back 1m and turn motion blur on for my still image it looks like they're moving. It doesn't matter that they're not moving along the road - moving backwards looks good enough.

#### Michal Karmazín

• iToo Software
• Hero Member
• Posts: 1736
##### Re: Effect - move instances back 1m at frame -1
« Reply #3 on: January 24, 2018, 05:44:52 PM »
Hi,

I'm afraid, these position changes of distributed items will not have any effect on the motion blur calculation, but you can animate the Custom Object for these purposes.

I would suggest you apply to your Custom Object a XForm modifier and animate its Gizmo > movement on the X axis (instead of animating directly Position/Rotation/Scale controller of the Custom Object as Forest takes control over this during scattering calculation). The Animation > Follow Geometry mode should do the trick (the motion blur should be calculated as supposed when using Forest's Animation modes).

Hope that helps.

Best regards,

#### George

• Full Member
• Posts: 122
##### Re: Effect - move instances back 1m at frame -1
« Reply #4 on: January 25, 2018, 02:17:17 AM »
Ok good to know, thanks.

#### George

• Full Member
• Posts: 122
##### Re: Effect - move instances back 1m at frame -1
« Reply #5 on: January 25, 2018, 02:47:33 AM »
I tried doing this but the cars don't animate in the forest object. I turned on Animation->Follow Geometry and turned off Animate only at render time to check it in the viewport. Obviously I checked the render too!

#### Michal Karmazín

• iToo Software
• Hero Member
• Posts: 1736
##### Re: Effect - move instances back 1m at frame -1
« Reply #6 on: January 25, 2018, 05:34:24 PM »
Hi,

Please find attached a sample scene showing the advised approach (tested with the V-Ray / Corona renderer). Hope you'll find useful.

Best regards,