Syrux Posted November 27, 2014 Author Share Posted November 27, 2014 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. Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted November 27, 2014 Share Posted November 27, 2014 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. Quote Link to comment Share on other sites More sharing options...
Syrux Posted November 28, 2014 Author Share Posted November 28, 2014 (edited) 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 November 28, 2014 by Syrux Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted December 8, 2014 Share Posted December 8, 2014 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? Quote Link to comment Share on other sites More sharing options...
Syrux Posted December 8, 2014 Author Share Posted December 8, 2014 (edited) 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 December 8, 2014 by Syrux Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.