Hi, I'm new to Houdini. I would like to move a box or other object by a certain amount using an attribute wrangler when a certain frame occurs but I'm not sure how to do it. I'm trying to use find() with arrays but it's not working. Is there something like this that can work?
float p = {8.78, 8.19, 7.31, 7.23};
float o = {0, 136, 273, 409, 545};
float frames = {100, 200, 300, 400, 500};
if(find(frames, @Frame) >= 0){
int pos = find(frames, @Frame);
@P.x += o / 20.;
@P.z += p * 2.;
}
Move object based on current frame
1186 3 1- mattschumaker
- Member
- 1 posts
- Joined: 3月 2018
- Offline
- vusta
- Member
- 555 posts
- Joined: 2月 2017
- Offline
- tamte
- Member
- 8772 posts
- Joined: 7月 2007
- Offline
you don't necessarily need a solver
float p[] = {8.78, 8.19, 7.31, 7.23}; float o[] = {0, 136, 273, 409, 545}; float frames[] = {100, 200, 300, 400, 500}; foreach(int i; float frame; frames){ if (@Frame >= frame){ @P.x += o[i] / 20; @P.z += p[i] * 2; } else break; }
Edited by tamte - 2020年1月2日 19:14:58
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- vusta
- Member
- 555 posts
- Joined: 2月 2017
- Offline
-
- Quick Links