arrow_forward_ios

HouPy Wiki

Support

There is some information overlap. So also check out wedge from parameter for some shelf script powered TOP stuff.

If you've ever tried to resize images with the dreaded ROP Composite TOP, you will know the pain of waiting 8 seconds for a single crop from 1:1 to 16:9.

We can use ImageMagick commandline tools to resize the image far faster.

We can start with a file pattern TOP that is reading all images from our directory, like this $HIP/images/*.png.

One caveat is that the images don't get passed perfectly to the resize setup, so just enabe the Output Attribute parm on the file pattern TOP.

From here, we can drop down an ImageMagick node, set the input source to custom file path and pass our output attriute from above in to this box.

We set the "Operation" to "Convert" and then go down to the extra arguments section.

Set the "Argument Name" to resize and set the "Argument Source" to Custom Value. Then we can set the "Arguement Value" to 1920x1080 or whatever values you need. I have this wrapped up in an HDA with a slider for size that lets me quickly chop down images for ImageMagick montages, etc. This is more of an excercise into using custom ImageMagick commands in the extra arguments section. Read more commands here.

Contributed by:
Picture of the author

Let's run TOPnets from the terminal using hbatch and hython

I have a simple TOPnet that creates directories and subdirectories, kind of like what the Set Projectoption does in Houdini : $HIP/project_{wedgeindex}/tex|flips|geo|render

hbatch is hscript, we'll use the python equivalent hython later.

when running hbatch $myhipfile or hython $myhipfile , it will open a textport or a python shell where you can input commands interactively. From there you can use whatever hscript or python commands to cook your topnet. Let's be lazy and run everything with a single command.

hbatch lets you use the -c flag to specify a .cmd file

test.cmd

echo "Cooking Topnet"
topcook /obj/mytopnet
echo "Done"
quit

Then you can run:

hbatch -v -c test.cmd $myfile.

-v is the verbose flag.

"but this is a python wiki, I don't wanna hear about hscript".

Let's take a look at hython:

$HHP/pdgjob/topcook.py is a python utility script provided by SideFx that lets you run a topnet from the command line.

hython $HHP/pdgjob/topcook.py --hip $myfile --toppath /obj/create_directories_and_sub_directories.

--hip expects a hipfile. --toppath expects a topnet.

Contributed by:
Picture of the author