instance sequence stutter
1222 5 0- AndyW
- Member
- 336 posts
- Joined: Dec. 2014
- Offline
So I'm getting random duplicate frames when I instance cached animation, seems to be due to the way I'm driving the frame number of the cached files with @age, rounding errors when it converts to integer? I'm doing int frame_num = (@age * 24) when I build my instancepath string, how should I be going about this? Thanks!
- howiem
- Member
- 146 posts
- Joined: Sept. 2011
- Offline
- AndyW
- Member
- 336 posts
- Joined: Dec. 2014
- Offline
- jsmack
- Member
- 7659 posts
- Joined: Sept. 2011
- Offline
sounds like you need to do rint() instead. If age stratification was enabled in pop source, then the ages would have some partial time increment added to them at birth, and you would never have any ages so close to the multiple of the time increment that float precision comes into play.
int frame = (int)rint(@age * 24.0); s@path = sprintf("/foogeo.%04d.bgeo", frame);
- AndyW
- Member
- 336 posts
- Joined: Dec. 2014
- Offline
- jsmack
- Member
- 7659 posts
- Joined: Sept. 2011
- Offline
-
- Quick Links