[Sidefx-houdini-list] lines from point positions

Olivier Jeannel facialdeluxe at gmail.com
Thu Oct 6 16:25:03 EDT 2016


ptnum (@ptnum in VEX, (also named $PT in the expression field) ) is the
pointnumber (equivalent to Index), it's an integer.
numpt (@numpt in VEX, (also named $NPT in the expression field)) is the
total number of points, it's an integer.

When inside the Attribute VOP, the big block on the left *get* some common
attributes (P, v, N, ptnum, numpt, etc.) , and the block on the right *sets*
some attibutes (P,v,N, etc)
Those are common attributes, but you can Bind (get) and Bind Export (set)
any attribute you created.
For examble here, BindExport "pscale".
pscale is a float attributes that already exist in Houdini that is usualy
used to set a scale  value on a point.

IntegerToFloat is a node tha converts an integer to a  ...float.
Doing this forces Houdini to give the result of the division to be a float
value.

The ratio :
lets say you have a line of 10 points,
.__.__.__.__.__.__.__.__.__.

1/ That means numpt = 10

2/  and that means that Houdini numbers the point (ptnum) from 0 to 9.
ptnum=0, ptnum=1, ptnum=3, ...up to ptnum=9

0  1   2    3   4    5   6  7  8   9
.__.__.__.__.__.__.__.__.__.




Doing a ratio
ptnum / numpt
is a convenient way to give the points of the line a numbering that goes
fro 0 to 1
0 / 10 = 0
1 / 10 = 0.1
2 / 10 = 0.2
3 / 10 = 0.3
4 / 10 = 0.4
5 / 10 = 0.5
6 / 10 = 0.6
7 / 10 = 0.7
8 / 10 = 0.8
9 / 10 = 0.9

0  0.1  0.2  0.3  0.4  0.5  0.6  0.7  0.8   0.9
.___.___.___.___.___.___.___.___.___.

Bind Export this as "pscale" means you create an attribute called pscale
means that now each point carries that pscale attribute
for example
point ptnum.= 4 pscale = 0.4


Fit Range node (it seams there was a problem on what you have in your mail,
its all decay compared to what I originaly typed)
also called "rescale" or "change range" in other softs.
its used to remap values.
here you input the result of the divide.
Source min 0
Source Max 1
Dest Min 1
Destmax 0
this simply reverts the values. of the pscale to have 0 at the beginning of
line and 1 at the bottom.

And yes, you type @pscale in the polywire wire radius field


On Thu, Oct 6, 2016 at 8:45 PM, Gary Jaeger <gary at corestudio.com> wrote:

> Thanks Olivier. You’re diagrams are quite helpful :) I really appreciate
> it. I’m having flashbacks to the early days of maya when experienced users
> would patiently explain what they meant by ‘do a samplerInfo node and
> attach a ramp to the u-value and map that to the out color of a
> surfaceshader’ and my head was spinning. maya ptsd… anyway, thanks for the
> patience.
>
>
> Gary Jaeger / 650.728.7957 direct / 415.518.1419 mobile
> http://corestudio.com <http://corestudio.com/>
> > On Oct 6, 2016, at 10:55 AM, Olivier Jeannel <facialdeluxe at gmail.com>
> wrote:
> >
> > If you take yesterday setup you could insert an attributeVOP and add a
> > PolyWire
> >
> >    Line
> >       |
> > AttributeVOP                        Grid
> >                   |                         |
> >                  Carve       Scatter
> >                           |       |
> >                           Copy
> >                                |
> >                         PolyWire
>
> got it
>
> >
> >
> > In the AttribVOP create a ratio value going from 0 to 1  for each points
> > along the line
> >
> > ptnum___ IntegerToFloat
> >                                        \
> >                                         Divide -----Fit 0-1
> > 1-0----BindExport (pscale)
> >                                        /
> > numpt___ IntergerToFloat
>
> OK, I got most of this I think. But a few things are hanging me up. So the
> integer to floats are just converting the values and passing them on? where
> are the ptnum and numpt coming from? Just curious mostly.
>
> but the middle 1-0----BindExport (scale) and the Fit part I’m not
> following. I assume I’m entering “pscale” in the Name field of the
> BindExport, right? But what is the 1-0? and does the numpt__IntegerToFloat
> fval pipe into the bind? then into Divide? Or what I think you might be
> saying is to create a new attribute in AttribVop that is a ratio? That I’m
> not sure how to do.
>
> Then the “Fit”, is that a “Fit Range”? so looks like that’s mapping the
> 0-1 to some other range, right?
>
> >
> > In the PolyWire, Wire Radius @pscale
>
> by this, you mean literally to enter “@pscale” in the Wire Radius field,
> right?
>
> >
> >
> >
> > On Thu, Oct 6, 2016 at 7:17 PM, Ron Schab <ron.schab at gmail.com> wrote:
> >
> >> Hey Garry,
> >>
> >> glad it was what u are after.
> >>
> >> The way it works I would describe it as:
> >> Width is just a point attribute that mantra "automatically" understands
> as
> >> a "thickness" value when rendering curves.
> >> It is set on a per point (on the curve) basis and interpolated in
> between
> >> those points.
> >>
> >> So, if  for example you give each point on your curve a random "width"
> >> value the curve should be rendered with varying width along it.
> >>
> >> As a quick test and for illustration purposes you could:
> >> - drop down a line-sop and give it let's say 10points.
> >> - then drop down a point-vop-sop after that, dive in, plug ptnum into a
> >> fitrange-vop and set "maximum value in source range" on that fitrange
> to 10
> >> (to keep it procedural you could channel reference "Points" from your
> line
> >> sop after promoting that parameter)
> >>
> >> =>That should give u a funnel like line with a thickness/width starting
> >> from 0 and going to 1.
> >>
> >> In your point-vop-sop you could plug in a ramp-parameter-vop after your
> >> fit-range-vop, chose spline ramp in order to get an adjustable & visual
> >> representation of the shape that will be rendered on your point-vop-sop.
> >>
> >> With that in mind you should be able to get any desired width-shape for
> >> your curves.
> >>
> >> Hope this clarifies things a bit more :)?
> >>
> >>
> >> cheers
> >> Ron
> >>
> >> Ron Schab
> >> -----------------------------------------------------------------------
> >>
> >> http://www.ronthedon.com
> >>
> >>
> >> On Thu, Oct 6, 2016 at 6:53 PM, Gary Jaeger <gary at corestudio.com>
> wrote:
> >>
> >>> Thanks Ron. That works, but I’m not sure the advantage. But to be
> clear,
> >>> I’m sure I’m doing it wrong. That’s pretty my my mantra(!) while
> learning
> >>> houdini,
> >>>
> >>> So at the end of my network, I put and Attribute Create node. Name is
> >>> width and I can set it to get my lines. It’s the randomizing part
> that’s
> >>> throwing me. Do I then create an Randomize Attribute? Or an wrangle?
> If I
> >>> set up a randomize, depending on settings I get something that looks
> >> like a
> >>> fuzzy line but I can’t seem to get the widths of various lines to be
> >>> randomized. I’m not looking for random along length. Yet. But simply to
> >> set
> >>> a range like rand(.1,.5) or whatever.
> >>>
> >>> thanks again.
> >>>
> >>> Gary Jaeger / 650.728.7957 direct / 415.518.1419 mobile
> >>> http://corestudio.com <http://corestudio.com/>
> >>>> On Oct 6, 2016, at 2:14 AM, Ron Schab <ron.schab at gmail.com> wrote:
> >>>>
> >>>> Hey Gary,
> >>>>
> >>>> not having looked at your scene ....
> >>>>
> >>>> I am assuming when you are trying to use pscale for "the weight of the
> >>>> lines as they render" you are trying to set their width/thickness?
> >>>>
> >>>> If so, try using f at width instead for lines :)
> >>>>
> >>>> cheers
> >>>> Ron
> >>>>
> >>>>
> >>>>
> >>>> Ron Schab
> >>>> ------------------------------------------------------------
> >> -----------
> >>>>
> >>>> http://www.ronthedon.com <http://www.ronthedon.com/>
> >>>>
> >>>>
> >>>> On Thu, Oct 6, 2016 at 12:44 AM, Gary Jaeger <gary at corestudio.com
> >>> <mailto:gary at corestudio.com>> wrote:
> >>>>
> >>>>> Thanks Neil. This works well, except I couldn’t get it working using
> >>>>> Custom Discrete. Messing around I got it basically working using
> >> Uniform
> >>>>> (Discrete) and fiddling with the random seed. Still seems to favor
> one
> >>> of
> >>>>> the colors, but that might be ok. I’d like to understand why though.
> >>>>>
> >>>>> In a similar vein, I’ve been trying to randomize the weight of the
> >> lines
> >>>>> as they render. I put an Attribute Create at the end of the chain,
> >> and I
> >>>>> can set a value there. Putting an Attribute Randomize after that with
> >>>>> attribute name set to pscale doesn’t seem to do it. Is it because
> >>> they’ve
> >>>>> already been created?
> >>>>>
> >>>>> Ha, things are (slowly) sinking in…
> >>>>>
> >>>>> in case you’re curious the masterpiece is here
> >>> https://www.dropbox.com/s/
> >>>>> ra4walh9qqd99be/1676_FX2_v002.hip?dl=0
> >>>>>
> >>>>> Gary Jaeger / 650.728.7957 direct / 415.518.1419 mobile
> >>>>> http://corestudio.com <http://corestudio.com/> <
> >> http://corestudio.com/
> >>> <http://corestudio.com/>>
> >>>>>> On Oct 5, 2016, at 10:41 AM, Neil Dickson <ndickson at sidefx.com>
> >> wrote:
> >>>>>> For the picking from 3 colours randomly, a way to do it, though
> >> others
> >>>>>> probably have better ways for specific situations, is to use
> >> Attribute
> >>>>>> Randomize with Attribute Name set to colour_choice, Distribution set
> >> to
> >>>>>> Custom Discrete, 3 values, set to 0, 1, and 2, (this just lets you
> >>> easily
> >>>>>> adjust the relative proportions of each colour), then in an
> Attribute
> >>>>>> Wrangle:
> >>>>>>
> >>>>>> if (@colour_choice == 0) {
> >>>>>>  @Cd = chv("colour0");
> >>>>>> }
> >>>>>> else if (@colour_choice == 1) {
> >>>>>>  @Cd = chv("colour1");
> >>>>>> }
> >>>>>> else { // @colour_choice == 2
> >>>>>>  @Cd = chv("colour2");
> >>>>>> }
> >>>>>>
> >>>>>> You can press the "Create spare parameters..." button next to the
> >>>>>> VEXpression to create the parameters for the colours and adjust
> those
> >>> to
> >>>>>> set the colours.  To have attributes, including Cd, copied from the
> >>>>>> template points to the copies, turn on Use Template Point Attributes
> >> in
> >>>>> the
> >>>>>> Attribute tab of the Copy SOP.
> >>>>>>
> >>>>>> Cheers,
> >>>>>> Neil
> >>>>>
> >>>>> _______________________________________________
> >>>>> Sidefx-houdini-list mailing list
> >>>>> Sidefx-houdini-list at sidefx.com <mailto:Sidefx-houdini-list@
> sidefx.com
> >>>
> >>>>> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list <
> >>> https://lists.sidefx.com/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 <
> >>> https://lists.sidefx.com/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
>
> _______________________________________________
> 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