Update an attribute in VOP for a different point,
Posted 18 August 2012 - 07:17 AM
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?
Posted 18 August 2012 - 08:20 AM
Posted 18 August 2012 - 08:30 AM
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?
Posted 18 August 2012 - 08:45 AM
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 by anim, 18 August 2012 - 08:48 AM.
Posted 18 August 2012 - 09:08 AM
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.
Posted 18 August 2012 - 09:40 AM
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
Posted 18 August 2012 - 10:01 AM
I don't know what to call this new asset? Was thinking of calling it xSort, but it basically only does one thing.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users