[Sidefx-houdini-list] Point count from a group

Andrew D Lyons tstexture at gmail.com
Thu Apr 23 00:03:58 EDT 2009


It's kind of a tough one. Where do you want to query it from? Where do
you want to store it?

For a dynamic solution you could put the delete SOP + attribCreate SOP
with npoints expression in a foreach SOP and maybe put the result in a
detail attrib named after that group. There's a bunch of group related
expressions.

Alternately you could put the custom expression below in an attrib SOP
to have each point store the number of points in it's group:

{
   string inputSop = strcat( "../", opinput(".",0) );
   string inputGroups = pointgrouplist(inputSop);
   float nargs = argc( inputGroups );

   for ( i = 1; i <= nargs; i++ )
   {
       string myGroup = arg(inputGroups, i-1 );
       float len = argc(pointlist(inputSop, myGroup));
       float inGroup = haspoint ( myGroup, inputSop, $PT );
       if ( inGroup == 1 ) return len;
   }
}

It kind of depends how you want to query it?

Cheers


2009/4/22 robert east <east.robert at gmail.com>:
> Hi Prema ,
>                   I have already used the npoints function and blasted away
> unwanted points at the SOP level that works, but I really wanted a more
> elegant way. As it would be nice to read in the point count from predefined
> groups as required by the user.
>
> Kind regards rob
>
>
> On Thu, Apr 23, 2009 at 11:07 AM, Premamurti Paetsch <
> premamurti.paetsch at gmail.com> wrote:
>
>> Hi Rob,
>>
>> What about blasting away all but the group in question, and then simply use
>> $NPT to return the point count?
>>
>> Cheers,
>> Prema
>>
>>
>> 2009/4/23 robert east <east.robert at gmail.com>
>>
>> > Hi List ,
>> >
>> > Is there a function I can use to read the point count from a group at the
>> > sop level into a pop network as I want to use that to emit particles in
>> my
>> > birth tab
>> >
>> >
>> > Kind regards Rob
>> > _______________________________________________
>> > Sidefx-houdini-list mailing list
>> > 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
>>
>
>
>
> --
> Robert East
>
> www.tenmenmarching.com
> Sydney Australia + London UK
> +61 (0) 0424648857
>
> "Houdini is a pipeline in a box. Maya is a box that you have to build a
> pipeline for"
> _______________________________________________
> Sidefx-houdini-list mailing list
> Sidefx-houdini-list at sidefx.com
> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>



-- 
=======================================
Andrew D Lyons | Digital Artist | http://www.tstex.com
=======================================



More information about the Sidefx-houdini-list mailing list