Jump to content

record creationtime,endtime attr of points


Benyee

Recommended Posts

A random pattern(red) spreading and then fade out on a ploy plane(black),

if a point becomes red(say $CR>.1),assign its creationtime attr value with current glabal time(in second) and keep it;

...

if a point becomes black($CR<=.1) by fading out,record the endtime attr with current time and keep it;

During this,record its age attr.

How to set up the process,thanks.

Link to comment
Share on other sites

Use a VOPPOP.

Use one attribute storing creationtime and initialize it to -1. In the VOPPOP compare if it have been initialized. If not set it's creationtime as soon as it turns red. Keep a second attribute that you update whenever it is red. Calculate the age by subtracting the creationtime from the endtime.

EDIT: This was trickier than I thought.

EDIT2: I believe the attached file is what you wan't. There is probably a more elegant way of doing it but this calculates the age while the particle is red and otherwise returns 0.

age.hipnc

Edited by Erik_JE
Link to comment
Share on other sites

This approach will not work for a surface as it uses preserve groups which are unique for particles.

For doing it on a surface geometry i believe you need to bring it into a SOPSolver to be able to accumulate the age. Not my strong side, maybe someone else knows.

Link to comment
Share on other sites

Thanks,this give me some tips.

Actually,I wanna record those attrs of points of a surface.

Here's my approach which uses a SOP Solver.

It allows you to specify a threshold which will record a birthtime if it goes above and a deathtime if it goes back under.

You can also invert this behavior if desired.

I tried to make this as flexible, robust, and modular as possible. So copying the asset into your scene should be fairly painless.

recordattrib3.hip

Link to comment
Share on other sites

Here's my approach which uses a SOP Solver.

It allows you to specify a threshold which will record a birthtime if it goes above and a deathtime if it goes back under.

You can also invert this behavior if desired.

I tried to make this as flexible, robust, and modular as possible. So copying the asset into your scene should be fairly painless.

Hi,CTEffects.Thank you for the helps,pretty good job.

And so I got a simplified version with less logics.record_birth_attrib.hip

Link to comment
Share on other sites

  • 2 weeks later...

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