hopbin9 Posted August 18, 2012 Share Posted August 18, 2012 Hi, I have a VOP SOP that calculates a float value that I want to write out to an attribute for a different point. I'm able to use the Import Attribute node to read an attribute from point X, but I'm not able to Export an attribute to point Y. What I'm trying to do is calculate a value and save it in the point's neighbours. Is this possible in VOP or maybe VEX? Quote Link to comment Share on other sites More sharing options...
anim Posted August 18, 2012 Share Posted August 18, 2012 this is not possible in vex AFAIK, your best option would probably be python sop 1 Quote Link to comment Share on other sites More sharing options...
hopbin9 Posted August 18, 2012 Author Share Posted August 18, 2012 this is not possible in vex AFAIK, your best option would probably be python sop Thanks, I think that's what I'll end up doing. I'll write out the neighbour information to an attribute in VOP and then use it in Python. My concern was performance. Anyone know how much slower Python is compared to VEX? Is it greatly slower or just slightly? Quote Link to comment Share on other sites More sharing options...
anim Posted August 18, 2012 Share Posted August 18, 2012 (edited) it's usually much slower for high point counts what exactly are you doing? maybe there is other way how do you imagine saving to neighbours to work? imagine you want to save some value to a neighbour of some point then another point may have the same neighbour and you want to save other value to the same attribute, do you expect them so sum up? average? replace each other? therefore it's easier to just gather the info from neighbours, process it and store in current point ( as VEX works), and that makes each point independent from others as well so it can be multithreaded so maybe if you just store information for your neighbours on the points in one VEX then gather that information from neighbours in other VEX or maybe in single VEX get neighbours and for each neighbour calculate the desired value from it's neighbours and store in current point which is like exporting some value to that point as a neighbour that will be slightly slower, but may be worth testing still depends on your goal, since this are just pure workflow ideas without me seeing the full purpose so it can be completely off EDIT: well another thing is that you can have inlinecpp in the python code which may make it actually faster if you know HDK Edited August 18, 2012 by anim Quote Link to comment Share on other sites More sharing options...
hopbin9 Posted August 18, 2012 Author Share Posted August 18, 2012 This happens to me often, because I work with splines a lot in Houdini. You want to make some kind of shape by merging together lines, rectangles or arcs. After they are merged you discover that the point order doesn't connect correctly. What you need is for the shape to have all points connected in correct winding order from 0 to last point. As a profile around the shape. Understand? So, you can use a Sort SOP to try and fix it, but often you have to go and re-order all the primitive splines before they are merged. It's kind of a pain, especially if you've made a complex SOP network already. I'm trying to create a tool that will fix this, by making all the points starting from 0 to the last point go in the correct order by walking the connected neighbours. Understand? Quote Link to comment Share on other sites More sharing options...
anim Posted August 18, 2012 Share Posted August 18, 2012 in that case Python would be my choice, since VEX process points in parallel so you would need another loop there anyway and because you are dealing with splines you probably don't have very high pointcounts and it sounds that it doesn't have to be runtime script unless your input topology is changing so I wouldn't worry that much about the speed Quote Link to comment Share on other sites More sharing options...
hopbin9 Posted August 18, 2012 Author Share Posted August 18, 2012 Actually, that wasn't to hard. Already got it working. I don't know what to call this new asset? Was thinking of calling it xSort, but it basically only does one thing. Any ideas? 1 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.