
Adriano Zanetti
Adriano
About Me
EXPERTISE
Freelancer
INDUSTRY
Film/TV
Houdini Skills
Availability
Not Specified
Recent Forum Posts
Lag / Overshoot / Smooth in VEX June 10, 2025, 11:26 a.m.
I'm trying to recreate the CHOP Lag / Overshoot / Smooth in vex. Trying to add some features to a little sequential value generator i'm feeding to animated geos / cameras to automate animatino.
Script looks like that, but it's all a bit abrupt, the ease in and out function is not working as expected, I'd love to smooth things in and out with controls. Any pointers welcome.
Cheers.
int frame = @Frame;
// Timing Controls
int rot_interval = chi("rot_interval");
int pause_interval = chi("pause_interval");
float rot_rand = chf("rot_interval_randomness");
float pause_rand = chf("pause_interval_randomness");
float ease = chf("ease");
// Axis Controls
float x_step = chf("x_step");
float y_step = chf("y_step");
float z_step = chf("z_step");
float flip_prob_x = chf("flip_prob_x");
float flip_prob_y = chf("flip_prob_y");
float flip_prob_z = chf("flip_prob_z");
int auto_pingpong = chi("auto_pingpong");
int dir_manual_x = chi("dir_manual_x");
int dir_manual_y = chi("dir_manual_y");
int dir_manual_z = chi("dir_manual_z");
// Estimate rough phase
int estimated_total = rot_interval + pause_interval;
int rough_phase = frame / estimated_total;
// Random Phase durations
float rand_rot = fit01(random(rough_phase * 111.1), 1.0 - rot_rand, 1.0 + rot_rand);
float rand_pause = fit01(random(rough_phase * 222.2), 1.0 - pause_rand, 1.0 + pause_rand);
int actual_rot = max(1, int(rot_interval * rand_rot));
int actual_pause = max(0, int(pause_interval * rand_pause));
int total = actual_rot + actual_pause;
int phase = frame / total;
int local_frame = frame % total;
// Axis setup
vector step = set(x_step, y_step, z_step);
vector flip_probs = set(flip_prob_x, flip_prob_y, flip_prob_z);
vector rot = {0, 0, 0};
vector base = {0, 0, 0};
int dir_table = array(dir_manual_x, dir_manual_y, dir_manual_z);
// per-axis rotation accumulation with direction
for (int axis = 0; axis < 3; axis++) {
float acc = 0;
int dir = dir_table;
// Flip history
for (int i = 0; i < phase; i++) {
if (auto_pingpong == 1 && random((i + axis * 1000) * 999.9) < flip_probs) {
dir *= -1;
}
acc += dir * step;
}
base = acc;
// Flip this phase
if (auto_pingpong == 1 && random((phase + axis * 1000) * 999.9) < flip_probs) {
dir *= -1;
}
float target = acc + dir * step;
if (local_frame < actual_rot) {
float t = clamp(float(local_frame) / float(actual_rot), 0.0, 1.0);
float s = t * t * (3.0 - 2.0 * t);
float shape = lerp(t, s, ease);
rot = lerp(acc, target, shape);
} else {
rot = target;
}
}
@x_rot = rot.x;
@y_rot = rot.y;
@z_rot = rot.z;
Script looks like that, but it's all a bit abrupt, the ease in and out function is not working as expected, I'd love to smooth things in and out with controls. Any pointers welcome.
Cheers.
int frame = @Frame;
// Timing Controls
int rot_interval = chi("rot_interval");
int pause_interval = chi("pause_interval");
float rot_rand = chf("rot_interval_randomness");
float pause_rand = chf("pause_interval_randomness");
float ease = chf("ease");
// Axis Controls
float x_step = chf("x_step");
float y_step = chf("y_step");
float z_step = chf("z_step");
float flip_prob_x = chf("flip_prob_x");
float flip_prob_y = chf("flip_prob_y");
float flip_prob_z = chf("flip_prob_z");
int auto_pingpong = chi("auto_pingpong");
int dir_manual_x = chi("dir_manual_x");
int dir_manual_y = chi("dir_manual_y");
int dir_manual_z = chi("dir_manual_z");
// Estimate rough phase
int estimated_total = rot_interval + pause_interval;
int rough_phase = frame / estimated_total;
// Random Phase durations
float rand_rot = fit01(random(rough_phase * 111.1), 1.0 - rot_rand, 1.0 + rot_rand);
float rand_pause = fit01(random(rough_phase * 222.2), 1.0 - pause_rand, 1.0 + pause_rand);
int actual_rot = max(1, int(rot_interval * rand_rot));
int actual_pause = max(0, int(pause_interval * rand_pause));
int total = actual_rot + actual_pause;
int phase = frame / total;
int local_frame = frame % total;
// Axis setup
vector step = set(x_step, y_step, z_step);
vector flip_probs = set(flip_prob_x, flip_prob_y, flip_prob_z);
vector rot = {0, 0, 0};
vector base = {0, 0, 0};
int dir_table = array(dir_manual_x, dir_manual_y, dir_manual_z);
// per-axis rotation accumulation with direction
for (int axis = 0; axis < 3; axis++) {
float acc = 0;
int dir = dir_table;
// Flip history
for (int i = 0; i < phase; i++) {
if (auto_pingpong == 1 && random((i + axis * 1000) * 999.9) < flip_probs) {
dir *= -1;
}
acc += dir * step;
}
base = acc;
// Flip this phase
if (auto_pingpong == 1 && random((phase + axis * 1000) * 999.9) < flip_probs) {
dir *= -1;
}
float target = acc + dir * step;
if (local_frame < actual_rot) {
float t = clamp(float(local_frame) / float(actual_rot), 0.0, 1.0);
float s = t * t * (3.0 - 2.0 * t);
float shape = lerp(t, s, ease);
rot = lerp(acc, target, shape);
} else {
rot = target;
}
}
@x_rot = rot.x;
@y_rot = rot.y;
@z_rot = rot.z;
GridMarkets not finding gridmarkets_lib? Rings a bell? Oct. 19, 2024, 1:54 p.m.
Struggling with the gridmarkets install, it keeps breaking, works for a bit, then can't find the "lib" folder which is perfectly installed in the otls folder, vairables at set properly, i'm getting super confused. THis stuff is quite unreliable. Any idea how to fix this stuff please?

thanks a lot,
A.
thanks a lot,
A.
Gridmarket pre flight issue?, houdini environment variables issue?? Oct. 19, 2024, 1:51 p.m.
Just taking a shortcut here. I'm having a problem with gridmarkets submitter not finding the "lib". It was working fine, i submitted jobs, then suddenly it just won't find the grodmarkets_lib, which is perfectly installed in the proper otls folder. I had that yesterday and somehow managed to fix that by installing/reinstalling and all buncha of manual clean up and sequence of stuff i can't recall. But it worked again... and bam, today again the same crap, it just won't find the lib. Have you ever had that issue? Their crappy enjoy lunacher app does not let you choose the location of installation of their files so god knows what it does. But it appears it installs in some obscur users folder that has nothing to do with the main one.
Any pointers welcome, this stuff is a real pain.
Cheers,
A.
Any pointers welcome, this stuff is a real pain.
Cheers,
A.