Jump to content

attribwrangle vex expression


mr_stiff

Recommended Posts

Hi there,

 

I'm a very junior VFX artist, and new to houdini - and in need of some help.

 

I have a point cloud out of a popnet, which i want to run through a attribwrangle, to adjust the density of points that have less than n neighbours.

I have the attribute numproximity, and I want to reduce the density of points with less than 500 neighbours down by 20% per frame.

 

this is what i came up with with my limited knowledge:

 

if (@numproximity <= 500);
    @density = density * 0.2

 

which of course is not working since it .a. does not work, and .b.  would reduce the density of all points (I think).

 

Any help will be much appreciated!

 

No help at all? How about an alternative solution?

Edited by mr_stiff
Link to comment
Share on other sites

 are you running this in SOPS or DOPS ?  If you are running this in SOPS then what you have here won't animate,  as SOPS is not aware of time (ie. each frame is independant of previous frames).    In DOPS if you have the numproximity attribute on your particles and a density attribute,  you could lower the density attribute on your particles each time the wrangle cooks with code similiar to what you have:

 

  if(@numproximity <= 500)){

     @density *= 0.8;

  }

 

 in SOPS it's a little more tricky because the state at which numproximity crosses the threshold could change.  So if you wanted to do it post sim you should look into using a solver sop (which is just a DOPNET wrapped inside an otl for SOPS).

 

 -G

 

 

Hi there,

 

I'm a very junior VFX artist, and new to houdini - and in need of some help.

 

I have a point cloud out of a popnet, which i want to run through a attribwrangle, to adjust the density of points that have less than n neighbours.

I have the attribute numproximity, and I want to reduce the density of points with less than 500 neighbours down by 20% per frame.

 

this is what i came up with with my limited knowledge:

 

if (@numproximity <= 500);
    @density = density * 0.2

 

which of course is not working since it .a. does not work, and .b.  would reduce the density of all points (I think).

 

Any help will be much appreciated!

 

No help at all? How about an alternative solution?

Link to comment
Share on other sites

 there is a nice example of animating point attributes with a sop solver in this thread which Tomas provided.:

 

http://forums.odforce.net/topic/23623-changing-attributes-on-points-that-are-changing/

 

 -G

 

 

 are you running this in SOPS or DOPS ?  If you are running this in SOPS then what you have here won't animate,  as SOPS is not aware of time (ie. each frame is independant of previous frames).    In DOPS if you have the numproximity attribute on your particles and a density attribute,  you could lower the density attribute on your particles each time the wrangle cooks with code similiar to what you have:

 

  if(@numproximity <= 500)){

     @density *= 0.8;

  }

 

 in SOPS it's a little more tricky because the state at which numproximity crosses the threshold could change.  So if you wanted to do it post sim you should look into using a solver sop (which is just a DOPNET wrapped inside an otl for SOPS).

 

 -G

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...