[Sidefx-houdini-list] randomize P[y]

Neil Dickson ndickson at sidefx.com
Fri Jan 20 18:46:52 EST 2017


Yep, I completely agree that it'd be convenient to write to a single
component, even though the workaround is fairly simple.

I'm guessing you mean you want a "Uniform (Continuous)" distribution?  If
that's the case, it's pretty easy to do something entirely in Attribute
Wrangle, though Attribute Randomize does handle hashing the seed(s) nicely,
but it should be roughly equivalent to:

vector4 vseed = set(@ptnum%65536, at ptnum/65536,0,chf("seed"));
float u = random(random_fhash(vseed));
@P.y = fit01(u, chf("min"), chf("max"));

It's a bit overkill for most cases, but I wanted to make sure seeds were
handled well in Attribute Randomize, because it can sometimes cause strange
problems if they're not.  You can put that code in an Attribute Wrangle,
hit the "Create spare parameters..." button next to the code, and adjust
the seed, min, and max values.

Cheers,
Neil


On Fri, Jan 20, 2017 at 5:41 PM, Gregory Ecker <gregory.ecker at gmail.com>
wrote:

>  maybe just randomize an attribute 'like offsetY' and add that to your P in
> a wrangle after the randomize.
>
>  -G
>
> On Fri, Jan 20, 2017 at 5:37 PM, Gary Jaeger <gary at corestudio.com> wrote:
>
> > Thanks Neil. Just to be able to do a random distribution of P[y] so that
> > my little boxes are randomly placed on the y axis. For instance, if you
> put
> > an attribrandomize beneath the scatter, set it to P, set Dimensions to
> 1and
> > mess with the scale, you can scaled random placement on the X. I assume
> > because X is the first of [x,y,z]. But what if you want the same for Y?
> Or
> > Z for that matter. i.e. don’t touch X or Z, but randomize Y.
> >
> > Gary Jaeger / 650.728.7957 direct / 415.518.1419 mobile
> > http://corestudio.com <http://corestudio.com/>
> > > On Jan 20, 2017, at 10:30 AM, Neil Dickson <ndickson at sidefx.com>
> wrote:
> > >
> > > "While P works in the Attribute Name (and randomizes all three values),
> > > P[y] doesn’t. Why is that?"
> > >
> > > Sorry for the silly answer, but it's because "P[y]" isn't an attribute
> > > name.  I agree that it's a bummer that it doesn't yet have a special
> case
> > > to write to just *part* of an attribute, something like "P.y" or "P[1]"
> > > meaning the second component of P.  Please feel free to submit an RFE.
> > You
> > > can also write to an attribute named y, and then do @P.y = @y; in an
> > > Attribute Wrangle afterward.
> > >
> > > It's also just VEX inside, and most of the distributions are just
> > > delegating to VEX functions for sampling the distribution, so you can
> put
> > > together a custom thing fairly easily.  What distribution did you want
> to
> > > sample for the P.y values?
> > >
> > > Cheers,
> > > Neil
> > >
> > > On Fri, Jan 20, 2017 at 1:02 PM, Gary Jaeger <gary at corestudio.com>
> > wrote:
> > >
> > >> I was playing around with a basic setup using boxes copied to a
> scatter,
> > >> then using attribrandomize nodes below the scatter to muck things up.
> I
> > >> decided I’d try to just randomize only the y position. While P works
> in
> > the
> > >> Attribute Name (and randomizes all three values), P[y] doesn’t. Why is
> > >> that?  I’ve tried different combinations of Dimensions etc but now
> I’ve
> > >> given up.
> > >>
> > >> Gary Jaeger / 650.728.7957 direct / 415.518.1419 mobile
> > >> http://corestudio.com <http://corestudio.com/>
> > >> _______________________________________________
> > >> 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
> >
> > _______________________________________________
> > 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
>



More information about the Sidefx-houdini-list mailing list