Neon Junkyard Posted May 6, 2016 Share Posted May 6, 2016 Does anyone know a way of doing an attribute transfer but limiting it to only say the Y axis? Could be a point cloud lookup, either way. However PC lookup doesn't give you the blend width controls which I need as well. But basically I only want to transfer a color from a point cloud to another point cloud but only in the Y direction, so nothing would be transferred to the X and Z surrounding points. I vaguely know how to do this with a pcopen function but I can't recreate the blend width type functionality as the attribute transfer. Any ideas? Thanks Quote Link to comment Share on other sites More sharing options...
kgoossens Posted May 6, 2016 Share Posted May 6, 2016 It is hard to tell without seeing the data. But can't you achieve the same by Storing the point positions as an attrib flattening the shapes in the Y direction before the attrib transfer And then restoring the point positions? Quote Link to comment Share on other sites More sharing options...
mestela Posted May 7, 2016 Share Posted May 7, 2016 (edited) Or maybe this sort of thing; get the dot product between the vector from the src->target and {0,1,0}, clamp it. If its directly above the dot will be 1, if its at 90 degrees it'll be 0. Also get the distance between the source and target, and use that to drive a fade to give you controllable falloff. attribtransfer_filter_by_vector.hipnc Edited May 7, 2016 by mestela Quote Link to comment Share on other sites More sharing options...
Neon Junkyard Posted May 9, 2016 Author Share Posted May 9, 2016 Whoa mestela I'm not entire sure I follow your wrangle setup haha I will try and implement that, thanks for the suggestions Quote Link to comment Share on other sites More sharing options...
mestela Posted May 9, 2016 Share Posted May 9, 2016 (edited) Heh, you were gonna do a pclookup, but can't follow this? Cmon now... dot(v1,v2) indicates the orientation of 2 vectors relative to each other. If they're facing each other the result is 1, if they're perpendicular the result is 0, if they're parallel the result is -1. Distance(p1, p2) just returns the distance between 2 points. nearpoints() returns an array (a list) of points near a point, with controls for the maximum distance to search, and the maximum number of points to return. foreach is a nice way to loop through the results of an array. Thus armed, that wrangle does the following: setup a bunch of variables we can use, so we have sliders to control maxdist, number of points, vector to test against etc get a list of the closest 20 points within 1.2 units of the current point for each returned point: get its position get the vector between the current point on the grid and that returned point get the dot product between that vector, and a vector pointing directly up (ie, {0,1,0}) clamp it so it just goes between 0 and 1 (points underneat the grid will have a dot product between 0 and -1, we want to ignore those) get the colour of that returned point get the distance between the current point on the grid and the returned point invert that distance, so its greatest when the points are close, and fades off when far away. this gives the soft falloff multiply the colour by the dot product and the distance add that colour to the total @Cd. adding this up across all the returned points gives the blended colour result. you could do all that in less lines by writing big nested statements, but i find breaking it out like this easier to read, and for me, easier to read this than to dissect a vop network. not always mind you, but here, i think it is. Edited May 9, 2016 by mestela 2 Quote Link to comment Share on other sites More sharing options...
Neon Junkyard Posted May 10, 2016 Author Share Posted May 10, 2016 Wow thank you for taking the time to leave such a detailed explanation. And it works! Thanks again 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.