[Sidefx-houdini-list] Row of books, procedurally

Mario Marengo mario at axyzfx.com
Wed Feb 8 16:09:23 EST 2006


On February 8, 2006 03:06 pm, Peter Bowmar wrote:
> 	Basically, if I have a Box SOP representing a single book, Y and Z
> scale unimportant, but X is 1 unit wide, I want to copy that book in X,
> having each copy be a random size in X (but greater or equal to 1), and
> each copy transformed in X so it sits nicely with no gap next to the
> previous book.

Hey Pete,

Is this kind'a what you want?

(watch out for wrapped lines)

--8<----------------------------------------------------------
# Automatically generated script: Wednesday February 08, 16:06
\set noalias = 1
set saved_path = `execute("oppwf")`
opcf /obj

# Node books
opadd -n geo books
oplocate -x 0 -y 0 books
opset -S on books
opparm books use_dcolor ( off )
chautoscope books +tx +ty +tz +rx +ry +rz +sx +sy +sz +px +py +pz +scale
opset -d on -r off -h off -f off -y off -t off -l off -s off -u off -c off -C 
on -p on -e on -b off -x off books

opcf /obj
opcf $saved_path
/ -> opscript -b -r /obj/books
# Automatically generated script: Wednesday February 08, 16:06
\set noalias = 1
set saved_path = `execute("oppwf")`
opcf /obj

# Node books
opadd -n geo books
oplocate -x 0 -y 0 books
opset -S on books
opparm books use_dcolor ( off )
chautoscope books +tx +ty +tz +rx +ry +rz +sx +sy +sz +px +py +pz +scale
opset -d on -r off -h off -f off -y off -t off -l off -s off -u off -c off -C 
on -p on -e on -b off -x off books
opcf books

# Node box1
opadd -n box box1
oplocate -x 1.39706 -y 1.55294 box1
chblockbegin
chadd -t 0 0 box1 ty
chkey -t 0 -v 0 -m 0 -A 0 -F '.5*ch(sizey)' box1/ty
chadd -t 0 0 box1 tx
chkey -t 0 -v 0 -m 0 -A 0 -F '.5*ch(sizex)' box1/tx
chadd -t 0 0 box1 tz
chkey -t 0 -v 0 -m 0 -A 0 -F '-.5*ch(sizez)' box1/tz
chblockend
opparm box1 size ( 1 7 5 ) 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 -C 
off -p off -e on -b off box1

# Node copy1
opadd -n copy copy1
oplocate -x 1.39706 -y -0.358827 copy1
chblockbegin
chadd -t 0 0 copy1 val1
chkey -t 0 -v 0 -m 0 -A 0 -F '$CY' copy1/val1
chadd -t 0 0 copy1 tx
chkey -t 0 -v 0 -m 0 -A 0 -F '$SIZEX' copy1/tx
chblockend
opparm copy1 ncy ( 8 ) t ( tx 0 0 ) stamp ( on ) param1 ( cy ) val1 ( val1 )
opset -d on -r on -h off -f off -y off -t off -l off -s off -u off -c off -C 
on -p on -e on -b off copy1

# Node xform1
opadd -n xform xform1
oplocate -x 1.41177 -y 0.626463 xform1
chblockbegin
chadd -t 0 0 xform1 sx
chkey -t 0 -v 1 -m 0 -A 0 -F '1+rand(stamp("../copy1","cy",0)+.666)' xform1/sx
chblockend
opparm xform1 s ( sx 1 1 )
opset -d off -r off -h off -f off -y off -t off -l off -s off -u off -c off -C 
off -p off -e on -b off xform1
oporder -e box1 copy1 xform1 
opcf ..

opcf /obj
opcf books
opwire -n xform1 -0 copy1
opwire -n box1 -0 xform1
opcf ..
opcf $saved_path


--8<----------------------------------------------------------

-- 
......................................................................
Mario Marengo                                  mailto:mario at axyzfx.com
AXYZ ANIMATION                                 http://www.axyzfx.com
......................................................................



More information about the Sidefx-houdini-list mailing list