[Sidefx-houdini-list] Simple VEX Question

Floyd Gillis floyd at afcg.com
Sat Jul 15 03:59:33 EDT 2017


Thank you for your helpful suggestions Nick, Jordan, and Nikita.

I ended up merging the 2 “animated single points” into the geometry I 
wanted to manipulate and accessed them with point functions instead…

*/vector pnt_A = point(0, “P”, 1001);
vector pnt_B = point(0, “P”, 1002);/*

Then did the distance calculation like so…

*/vector dist = distance(pnt_A, pnt_B);/*

Then the following worked fine…

*/@P = @P * dist;/*

Again, this was just a simplified segment of a complex hscript 
expression I was trying to update to VEX.

Damn, VEX is fast! If I'm not careful I'll become a convert.

Cheers,

Floyd


On 7/14/17 6:51 PM, Nikita Musatov wrote:
> if you use @opinput1_P, @opinput2_P you need write type of variable. 
> Vex does't understand what kind of type this variable. Use v at opinput1_P
>
> пт, 14 июл. 2017 г. в 8:47, Nick Deboar <nick.deboar at gmail.com 
> <mailto:nick.deboar at gmail.com>>:
>
>     Hey,
>
>     Try something like:
>     v at sphereP = point(0,"P", at ptnum);
>     v at pointP = point(1,"P",0);
>     f at test = distance(@sphereP, @pointP);
>     @P = @P * @test;
>
>     Ta,
>
>     Nick
>
>     Nick Deboar
>     ------------------------------
>     www.nickdeboar.com <http://www.nickdeboar.com>
>     m +61 435887248 <tel:+61%20435%20887%20248>
>
>     On Fri, Jul 14, 2017 at 1:00 PM, Floyd Gillis <floyd at afcg.com
>     <mailto:floyd at afcg.com>> wrote:
>
>     > Hello All,
>     >
>     > Still muddling my way through VEX.
>     >
>     > As an example… I have an Attribute Wrangle with 3 inputs.
>     > Input 1: some geometry
>     > Input 2: a single animating point
>     > Input 3: another single animating point
>     >
>     > If I have the following vex snippet… (the actual function is
>     more complex.)
>     > *
>     > **/float test = 1.2;/**/
>     > /**/@P = @P * test;/*
>     >
>     > All points will have their xyz values multiplied by “test”.
>     >
>     > But if I have…
>     >
>     > */float test = distance(@opinput1_P, @opinput2_P);/**/
>     > /**/@P = @P * test;/*
>     >
>     > Only the first point will have it’s xyz values multiplied by “test”.
>     >
>     > Have tried various combinations of v@, @, etc.  Any help
>     appreciated.
>     >
>     > Floyd
>     >
>     > _______________________________________________
>     > Sidefx-houdini-list mailing list
>     > Sidefx-houdini-list at sidefx.com
>     <mailto:Sidefx-houdini-list at sidefx.com>
>     > https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>     >
>     _______________________________________________
>     Sidefx-houdini-list mailing list
>     Sidefx-houdini-list at sidefx.com <mailto:Sidefx-houdini-list at sidefx.com>
>     https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>




More information about the Sidefx-houdini-list mailing list