Add files to a digital asset using Hscript.

OTCONTENTADD adds contents to an OTL, or Houdini Digital Asset.

Date Created:Friday December 29th, 2006 03:41 AM
Date Modified:Wednesday July 30th, 2008 02:34 AM

The filename must include the full unix path:
otcontentadd Object/OTL_name newscriptname /tmp/file

If the unix path is set to the directory that the file is located in, you can use just the name of the file.
otcontentadd Object/OTL_name newscriptname file

# this script will take an array and store it in the contents # use: `run("source opdef:/Object/center_divider?array")` # to refer to it in the coords param of curve sop

set SOP= `oppwf()` 

if $argc == 2
    set OPP= $SOP/geo/$arg1
else if $argc == 1
    set OPP= $SOP/geo/merged

set coords= "" 
for i = 1 to `npoints("$OPP")`
        set pex = `evals(point("$OPP","$i","P",0))`
        set pey = `evals(point("$OPP","$i","P",1))`
        set pez = `evals(point("$OPP","$i","P",2))`
        set zed = $zed $pex,$pey,$pez " "
set coords = $zed
echo -n 'echo '> $TEMP/array.txt
echo $coords >> $TEMP/array.txt

set table = `optypeinfo("$SOP","T")`
set label = `optype("$SOP")`
set tOTL   = ${table}/${label}

otcontentadd $tOTL array $TEMP/array.txt

foreach d(`run("opfind -t curve -p $SOP")`)
 opcook -F $d