OPmenu
eharetea

Create a custom item in the menu when you right-click on a node.

Customize your nodes in Houdini!

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

"*"   commenter  "Comment This OP"   $HOME/houdini${HOUDINI_MAJOR_RELEASE}.${HOUDINI_MINOR_RELEASE}/scripts/comment


when you click on any op, it will pass in $arg1 as the path to the operator.


This was an example script associated with the commenter OPmenu choice

set type = `optype($arg1)`
set table = `optypeinfo($arg1,"T")`

set file = $HOME/OPcomments/$table/$type

set comment = `system("cat $file")`
set curcomment = `run("opcomment $arg1")`

if ( `strmatch(strreplace(run("opcomment $arg1")," ","_"),"No_comment")` == 0 ) then
        set check = `run("message -b Append,Overwrite,Cancel -d 0 This Node has a comment:\n\n$curcomment\n\n\nDo you want to...")`
else
        opcomment -c "$comment" $arg1
endif

if $check != 2

        if `strlen($comment)` == 0
                message no comment on disk!
        else
 
                if $check == 0 #append 
                        opcomment -a -c "$comment" $arg1
                else if $check == 1 #overwrite
                        opcomment -c "$comment" $arg1
                endif
        endif
endif