Jump to content

Procedural way to animate visibility per face of an object


Andy_Ireland

Recommended Posts

Was messing around with something and got stuck trying to figure out a way to proceduraly animate the visibility of an object,
by animating the visibility of each face or maybe deleting faces in reverse.
So ideally you would see one face of the object on the first frame and the rest would be revealed over say 200 frames.
I used a sort node to arrange the faces in the order I would like to see them revealed but cant figure out a way to do this, 
Im sure there is an easy way to do it and I cant figure it out, any suggestions would be gratefully accepted

Link to comment
Share on other sites

in case you wanna be more fancy and have the prims appear in a growing fashion, drop down a fuse SOP in unique mode before that code

//primwrangle

vector center = @P;
int primpts[] = primpoints(0, @primnum);

foreach(int i; primpts)
{
    vector dir = center - point(0, “P”, i);
	float fit = fit(@primnum+1+@Frame, @primnum+1+(@Frame*(@primnum > @Frame)), (@primnum+1)*2.05, 1, 0);
	float ramp = chramp(“scale_ramp”, fit);
	vector set = dir*ramp;
	setpointattrib(0, “P”, i, set, “add”);
}

play with the ramp (i found moving right point closer to left side looks nice) and with the 2.05 in the code (make it parameter or so, jsut make sure its always > 2) to adjust "trail length" and falloff

also pretty cool if you reverse the fit to (x,y, 0, 1) and have the ramp zero all the way then close to right side make it go to 1. gives a nice trail when disintegrating

Edited by 3dome
Link to comment
Share on other sites

2 hours ago, 3dome said:

in case you wanna be more fancy and have the prims appear in a growing fashion, drop down a fuse SOP in unique mode before that code


//primwrangle

vector center = @P;
int primpts[] = primpoints(0, @primnum);

foreach(int i; primpts)
{
    vector dir = center - point(0, “P”, i);
	float fit = fit(@primnum+1+@Frame, @primnum+1+(@Frame*(@primnum > @Frame)), (@primnum+1)*2.05, 1, 0);
	float ramp = chramp(“scale_ramp”, fit);
	vector set = dir*ramp;
	setpointattrib(0, “P”, i, set, “add”);
}

play with the ramp (i found moving right point closer to left side looks nice) and with the 2.05 in the code (make it parameter or so, jsut make sure its always > 2) to adjust "trail length" and falloff

also pretty cool if you reverse the fit to (x,y, 0, 1) and have the ramp zero all the way then close to right side make it go to 1. gives a nice trail when disintegrating

Thanks 3dome, trying this now but its crashing Houdini

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...