sanostol Posted October 3, 2008 Share Posted October 3, 2008 is there a way to get all pointpositions in a vector array? martin Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted October 3, 2008 Share Posted October 3, 2008 is there a way to get all pointpositions in a vector array? Very likely.... but for which context? Quote Link to comment Share on other sites More sharing options...
sanostol Posted October 3, 2008 Author Share Posted October 3, 2008 SOP Very likely.... but for which context? Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted October 3, 2008 Share Posted October 3, 2008 SOP Just thinking out loud here, but: Feed a dummy, single-point geometry to the first input of a VopSOP, and the geometry with the points you want to put into the array into the second input, then in an inline vop (inside the VopSOP), write something like this: vector $pts[] = array(P); int $n = npoints(1); resize($pts,$n); vector $p; int $i; for($i=0;i<$n;i++) { if(!import("P",$p,1,$i)) break; $pts[$i] = $p; } float $larr[] = serialize($pts); addattribute("points",$larr,arraylength($pts)); This would stuff the point array into a float[] attribute called "points". To recover the vectors, you'd need to unserialize() the array after importing the attribute. Untested. Quote Link to comment Share on other sites More sharing options...
Jason Posted October 3, 2008 Share Posted October 3, 2008 Whats with all the '$' signs? Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted October 3, 2008 Share Posted October 3, 2008 Whats with all the '$' signs? It's meant to go inside an InlineVOP, so the '$' signs avoid symbol clashes. If this were straight VEX, then you wouldn't need them. Quote Link to comment Share on other sites More sharing options...
Jason Posted October 3, 2008 Share Posted October 3, 2008 It's meant to go inside an InlineVOP, so the '$' signs avoid symbol clashes. If this were straight VEX, then you wouldn't need them. Ohhhh - sorry, I missed that:) GOTO 10. 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.