Jump to content
Syrux

create point attribute outside cookmysop().

Recommended Posts

You could also check if the attribute already exists, if so, just get it, otherwise create it.

I'm not sure which attribute creation method you will take, but it should look something along those lines:

auto normalTuple = normalRef.getAIFTuple();

 

 

Don't auto and getAIFTuple() slow down the performance? auto because the compiler needs to guess what type is, getAIFTuple because the layer of abstraction may impact performance.

Share this post


Link to post
Share on other sites
Guest mantragora

Don't auto and getAIFTuple() slow down the performance? auto because the compiler needs to guess what type is, getAIFTuple because the layer of abstraction may impact performance.

 

1. C++ is statically typed, so the types must be know at runtime. So auto have zero effects on performance. My performance on the other hand, with all those new things that C++11 offers, gone up :)

2. As I wrote:

I'm not sure which attribute creation method you will take...

I'm not using this method I posted here in my code. Grabbed first thing I had under my fingers. Check documentation for other methods.

Share this post


Link to post
Share on other sites

That means you need something time dependent. Maybe it's time to look into POPs/DOPs?

If you create attributes in POPs, do you have to create them in each cook like in SOPs or you set their values and the remain trough all the frames.

Edited by Syrux

Share this post


Link to post
Share on other sites
Guest mantragora

If you create attributes in POPs, do you have to create them in each cook like in SOPs or you set their values and the remain trough all the frames.

You can force SOp to be time dependent. Have you tried method from link I posted in #20 post here?

Share this post


Link to post
Share on other sites

You can force SOp to be time dependent. Have you tried method from link I posted in #20 post here?

SOP Solver, That's it.

 

I hook the previous frame to the plugin.

 

The link you mentioned needs two frames to work (is basically the TimeCompare example in the documentation), so my logic says that you will end with two copies of the same geometry in the memory or cook the two frames at the time required.

 

I recently saw this code that deals with particles and yes, you have to loop trough all the points to update the attribute, instead of changing only the attributes of the points I want.

 

I am also using duplicateChangedSource(0, context, &changed_input); but still the plugin its not as fast as I expected (in fact my original Python Code its slow when setting the attributes)

 

Looping half million points takes like 8 seconds or so (I don't know if this is considered fast in Houdini). I want to try multithreading but the documentation says that changing attributes is not safe.

 

Happy Christmas!  :)

Edited by Syrux

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×