HDA - OS Integration
eharetea

Adding contents to HDAs and saving contents to disk from HDAs.

Communication between Houdini and the operating system.

Date Created:Friday December 29th, 2006 03:41 AM
Date Modified:Friday August 01st, 2008 02:53 AM

* Adding contents to HDAs and saving contents to disk from HDAs.

    
    # this defines the table/label of the current otl

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


    # this deletes a section named array

    otcontentdelete $OTL array
    otcontentdelete Object/MyHDA array


    # this adds a section named array from $TEMP/$file

    otcontentadd $OTL array $TEMP/$file
    otcontentadd Object/MyHDA array $TEMP/array.txt


    # this does a loop an all the content in an HDA and dumps it to disk.

    foreach content(`run("otcontentls $OTL")`)
        otcontentsave -o $TEMP/$content $OTL $content
    end


    # this would make a file executable and run it, if you dump a shell script.

    unix chmod + x $file
    unix ./$file

    # pass an argument into a script

    unix ./$file $arg1