[Sidefx-houdini-list] Particle Attribute Question

Agent Xray xray at agentxray.com
Fri Oct 17 00:03:00 EDT 2008


Wire your geometry to a POP network.

Put a Source POP down, first context geometry. Birth ordered from prim 
centroids. Add origin attribute. Impulse birth number of prims in source 
only $FF == 1.

Position POP with expression point("../../[source]",$ORIGIN,"P",0) in 
X,Y,Z of Position POP. Change 0 to 1 or 2 if it's the Y or Z value.

Suppress reaping if you like.

Sending you a hip file off-list.

# Automatically generated script: Thursday October 16, 21:01
\set noalias = 1
set saved_path = `execute("oppwf")`
opcf /obj

# Node geo1 (Object/geo)
opadd -n geo geo1
oplocate -x 1.88226 -y 3.04703 geo1
opset -S on geo1
opparm geo1 use_dcolor ( off )
chautoscope geo1 +tx +ty +tz +rx +ry +rz +sx +sy +sz
opset -d on -r off -h off -f off -y off -t off -l off -s off -u off -c 
off -e on -b off -x off geo1
opexprlanguage -s hscript geo1
opcf geo1

# Node torus1 (Sop/torus)
opadd -n torus torus1
oplocate -x -1.15882 -y 1.79412 torus1
opset -d off -r off -h off -f off -y off -t off -l off -s off -u off -c 
off -e on -b off torus1
opexprlanguage -s hscript torus1

# Node xform1 (Sop/xform)
opadd -n xform xform1
oplocate -x -1.06471 -y 1.14706 xform1
chblockbegin
chadd -t 0 0 xform1 ry
chkey -t 0 -v 0 -m 0 -a 0 -A 0 -T a  -F '$F' xform1/ry
chblockend
opparm xform1 r ( 0 ry 0 )
opset -d on -r on -h off -f off -y off -t on -l off -s off -u off -c off 
-e on -b off xform1
opexprlanguage -s hscript xform1

# Node popnet1 (Sop/popnet)
opadd -n popnet popnet1
oplocate -x -0.841177 -y 0.276471 popnet1
opset -d off -r off -h off -f off -y off -t off -l off -s off -u off -c 
off -e on -b off popnet1
opexprlanguage -s hscript popnet1
opcf popnet1

# Node source1 (Pop/source)
opadd -n source source1
oplocate -x 2.15285 -y 3.72938 source1
chblockbegin
chadd -t 0 0 source1 impulseactivate
chkey -t 0 -v 1 -m 0 -a 0 -A 0 -T a  -F '$FF==1' source1/impulseactivate
chadd -t 0 0 source1 impulserate
chkey -t 0 -v 1 -m 0 -a 0 -A 0 -T a  -F 'nprims("../../torus1")' 
source1/impulserate
chblockend
opparm source1 stdswitcher ( 3 3 3 3 ) emittype ( center ) usecontextgeo 
( first ) impulseactivate ( impulseactivate ) impulserate ( impulserate 
) constantactivate ( 0 ) constantrate ( 0 ) doorigin ( on )
opset -d on -r off -h off -f off -y off -t on -l off -s off -u off -c 
off -e on -b off source1
opexprlanguage -s hscript source1

# Node position1 (Pop/position)
opadd -n position position1
oplocate -x 2.29402 -y 2.84703 position1
chblockbegin
chadd -t 0 0 position1 tx
chkey -t 0 -v 0 -m 0 -a 0 -A 0 -T a  -F 
'prim("../../xform1",$ORIGIN,"P",0)' position1/tx
chadd -t 0 0 position1 ty
chkey -t 0 -v 0 -m 0 -a 0 -A 0 -T a  -F 
'prim("../../xform1",$ORIGIN,"P",1)' position1/ty
chadd -t 0 0 position1 tz
chkey -t 0 -v 0 -m 0 -a 0 -A 0 -T a  -F 
'prim("../../xform1",$ORIGIN,"P",2)' position1/tz
chblockend
opparm position1 t ( tx ty tz )
opset -d off -r on -h off -f off -y off -t off -l off -s off -u off -c 
off -e on -b off position1
opexprlanguage -s hscript position1
oporder -e source1 position1
opcf ..
oporder -e torus1 xform1 popnet1
opcf ..

opcf /obj
opcf geo1
opwire -n torus1 -0 xform1
opwire -n xform1 -0 popnet1
opcf popnet1
opwire -n source1 -0 position1
opcf ..
opcf ..
opcf $saved_path


-=X



Andrew D Lyons wrote:
> Jeff's email probably would have been helpful if the contents weren't
> stripped out somehow. (That's been happening for a few people - what
> causes that?)
>
> This will put a point at every prim centroid in SOPs. (Not sure if
> that helps.) Drop this in a hscript shell to see:
>
>
> # Automatically generated script: Wednesday October 15, 11:55
> \set noalias = 1
> set saved_path = `execute("oppwf")`
> opcf /obj
>
> # Node geo1 (Object/geo)
> opadd -n geo geo1
> oplocate -x -123.856 -y 7.61836 geo1
> opset -S on geo1
> opparm geo1 use_dcolor ( off )
> chautoscope geo1 +tx +ty +tz +rx +ry +rz +sx +sy +sz
> opset -d on -r off -h off -f off -y off -t off -l off -s off -u off -c
> off -e on -b off -x off geo1
> opexprlanguage -s hscript geo1
> opcf geo1
>
> # Node sphere1 (Sop/sphere)
> opadd -n sphere sphere1
> oplocate -x 0.500001 -y 1.959 sphere1
> opparm sphere1 type ( poly )
> opset -d off -r off -h off -f off -y off -t on -l off -s off -u off -c
> off -e on -b off sphere1
> opexprlanguage -s hscript sphere1
>
> # Node point1 (Sop/point)
> opadd -n point point1
> oplocate -x 0.500001 -y -0.3 point1
> opparm point1  numcustom ( 1 )
> chblockbegin
> chadd -t 0 0 point1 tx
> chkey -t 0 -v 0 -m 0 -a 0 -A 0 -T a  -F '$primCEX' point1/tx
> chadd -t 0 0 point1 ty
> chkey -t 0 -v 0 -m 0 -a 0 -A 0 -T a  -F '$primCEY' point1/ty
> chadd -t 0 0 point1 tz
> chkey -t 0 -v 0 -m 0 -a 0 -A 0 -T a  -F '$primCEZ' point1/tz
> chadd -t 0 0 point1 weight
> chkey -t 0 -v 1 -m 0 -a 0 -A 0 -T a  -F '$WEIGHT' point1/weight
> chadd -t 0 0 point1 diffr
> chkey -t 0 -v 1 -m 0 -a 0 -A 0 -T a  -F '$CR' point1/diffr
> chadd -t 0 0 point1 diffg
> chkey -t 0 -v 1 -m 0 -a 0 -A 0 -T a  -F '$CG' point1/diffg
> chadd -t 0 0 point1 diffb
> chkey -t 0 -v 1 -m 0 -a 0 -A 0 -T a  -F '$CB' point1/diffb
> chadd -t 0 0 point1 alpha
> chkey -t 0 -v 1 -m 0 -a 0 -A 0 -T a  -F '$CA' point1/alpha
> chadd -t 0 0 point1 nx
> chkey -t 0 -v 0 -m 0 -a 0 -A 0 -T a  -F '$NX' point1/nx
> chadd -t 0 0 point1 ny
> chkey -t 0 -v 0 -m 0 -a 0 -A 0 -T a  -F '$NY' point1/ny
> chadd -t 0 0 point1 nz
> chkey -t 0 -v 0 -m 0 -a 0 -A 0 -T a  -F '$NZ' point1/nz
> chadd -t 0 0 point1 mapu
> chkey -t 0 -v 0 -m 0 -a 0 -A 0 -T a  -F '$MAPU' point1/mapu
> chadd -t 0 0 point1 mapv
> chkey -t 0 -v 0 -m 0 -a 0 -A 0 -T a  -F '$MAPV' point1/mapv
> chadd -t 0 0 point1 mapw
> chkey -t 0 -v 0 -m 0 -a 0 -A 0 -T a  -F '$MAPW' point1/mapw
> chadd -t 0 0 point1 tension
> chkey -t 0 -v 1 -m 0 -a 0 -A 0 -T a  -F '$TENSION' point1/tension
> chadd -t 0 0 point1 springk
> chkey -t 0 -v 30 -m 0 -a 0 -A 0 -T a  -F '$SPRINGK' point1/springk
> chadd -t 0 0 point1 vx
> chkey -t 0 -v 0 -m 0 -a 0 -A 0 -T a  -F '$VX' point1/vx
> chadd -t 0 0 point1 vy
> chkey -t 0 -v 0 -m 0 -a 0 -A 0 -T a  -F '$VY' point1/vy
> chadd -t 0 0 point1 vz
> chkey -t 0 -v 0 -m 0 -a 0 -A 0 -T a  -F '$VZ' point1/vz
> chadd -t 0 0 point1 upx
> chkey -t 0 -v 0 -m 0 -a 0 -A 0 -T a  -F '$UPX' point1/upx
> chadd -t 0 0 point1 upy
> chkey -t 0 -v 0 -m 0 -a 0 -A 0 -T a  -F '$UPY' point1/upy
> chadd -t 0 0 point1 upz
> chkey -t 0 -v 0 -m 0 -a 0 -A 0 -T a  -F '$UPZ' point1/upz
> chadd -t 0 0 point1 pscale
> chkey -t 0 -v 1 -m 0 -a 0 -A 0 -T a  -F '$PSCALE' point1/pscale
> chblockend
> opparm point1 t ( tx ty tz )
> opset -d off -r off -h off -f off -y off -t off -l off -s off -u off
> -c off -e on -b off point1
> opexprlanguage -s hscript point1
>
> # Node facet1 (Sop/facet)
> opadd -n facet facet1
> oplocate -x 0.500001 -y 0.8295 facet1
> opparm facet1 unique ( on )
> opset -d off -r off -h off -f off -y off -t off -l off -s off -u off
> -c off -e on -b off facet1
> opexprlanguage -s hscript facet1
>
> # Node facet2 (Sop/facet)
> opadd -n facet facet2
> oplocate -x 0.500001 -y -1.4295 facet2
> opparm facet2 cons ( fpoints )
> opset -d off -r off -h off -f off -y off -t off -l off -s off -u off
> -c off -e on -b off facet2
> opexprlanguage -s hscript facet2
>
> # Node add1 (Sop/add)
> opadd -n add add1
> oplocate -x 0.500001 -y -2.559 add1
> opparm add1  points ( 1 ) prims ( 1 )
> opparm add1 keep ( on )
> opset -d on -r on -h off -f off -y off -t off -l off -s off -u off -c
> off -e on -b off add1
> opexprlanguage -s hscript add1
> oporder -e sphere1 point1 facet1 facet2 add1
> opcf ..
>
> opcf /obj
> opcf geo1
> opwire -n facet1 -0 point1
> opwire -n sphere1 -0 facet1
> opwire -n point1 -0 facet2
> opwire -n facet2 -0 add1
> opcf ..
> opcf $saved_path
>
>
> ------------------------
>
> Cheers
>
>
> 2008/10/15 Stephen Jones <stephenbjones25 at yahoo.com>:
>   
>> i am running into a problem with my pop network. i have a source that
>> is a tire rotating on some axis. i want only ONE point per primitive to
>> be birthed. i don't need any more particles than the number of
>> primitives i have. so to solve that problem, in the source pop i have
>> given the impulse birth rate the exact number of particles that i need
>> on frame one, and then turn the impulse activation off. when that
>> happens, the popnet no longer sees that those points which are being
>> birthed from the primitive center(ordered). how would i get those
>> points to stay with my moving source geometry. if anybody has any
>> tricks up their sleeves, it would be much appreciated. i basically need
>> a source pop that can create one point per primitive and those points
>> follow the moving source geometry, and the ability to toggle on an off
>> the points following the moving source geometry.
>>
>> i
>> know that what i have stated may be a little confusing, but if you
>> think you might have an idea and need an example hip file i'll be glad
>> to upload one.
>>
>> Thanks for any help!
>> Stephen
>>
>> sjones29 at student.scad.edu
>>
>>
>>
>> _______________________________________________
>> 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