[Sidefx-houdini-list] Simple VEX Question

Jordan Walsh jordan.h.walsh at gmail.com
Sat Jul 15 07:35:47 EDT 2017


I would be careful doing this as you will be looping over the extra two
points as well, comparing them to themselves. Unless you want to do this
then I would keep the 2 extra points as one input to keep them separate to
the points you want to loop over.

Jordan

On 15 July 2017 at 08:59, Floyd Gillis <floyd at afcg.com> wrote:

> 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
>>
>>
> _______________________________________________
> Sidefx-houdini-list mailing list
> 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