Jump to content

create point attribute outside cookmysop().


Syrux

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.

Link to comment
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.

Link to comment
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
Link to comment
Share on other sites

  • 2 weeks later...
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?

Link to comment
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
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...