Jump to content

echo commands


varomix

Recommended Posts

Hi

Maybe this been asked before but I could not find anything.

Is it posible to echo commands like in maya's script editor, you know, you click on create sphere and in the script editor show the MEL commands that generate the sphere.

If this is not possible, how can I find out the commands for example, of the move tool, rotate tool, etc

this might be very simple but I can't find it

thank you

varomix

Link to comment
Share on other sites

Hi

Maybe this been asked before but I could not find anything.

Is it posible to echo commands like in maya's script editor, you know, you click on create sphere and in the script editor show the MEL commands that generate the sphere.

If this is not possible, how can I find out the commands for example, of the move tool, rotate tool, etc

this might be very simple but I can't find it

thank you

varomix

Depending on whether you need Hscript or Python there are different ways to do this. Search the help for "opscript" or type "help opscript" in the hscript text pane and that should get you on your way. The Python replacements for opscript are listed at the bottom in the help pane. ex. >>> print hou.node("/obj/geo1/xform1").asCode()

For example. this is the output of opscript for the transform node in a simple network (Hscript)

/ -> opscript -r /obj/geo1/xform*
# Node xform1 (Sop/xform)
opadd -n xform xform1
oplocate -x -2.06564 -y -1.46078 xform1
opspareds "" xform1
opparm xform1 group ( "" ) grouptype ( guess ) xOrd ( srt ) rOrd ( xyz ) t ( 0 0 0 ) r ( 0 0 0 ) s ( 1 1 1 ) shear ( 0 0 0 ) p ( 0 0 0 ) scale ( 1 ) updatenmls ( on ) vlength ( on ) invertxform ( off )
chlock xform1 -*
chautoscope xform1 -*
opcolor -c 0.8 0.8 0.8 xform1
opset -d on -r on -h off -f off -y off -t off -l off -s off -u off -c off -e on -b off xform1
opexprlanguage -s hscript xform1
oporder -e box1 xform1 
opcf ..

There are some cool possibilities with this stuff. I think opscript will even output a text file for you, which you could then use as a .cmd file that another program uses to generate geometry on the fly, etc.

Edited by Alanw
Link to comment
Share on other sites

The fundamental difference in houdini is you build a network how you want it first then use opscript to see what script commands to use to recreate it. This gives you only the commands needed and no other stuff that might have been disgarded during working.

Having said that if you start building otls there are very few times these days when you need to script anything out, so make sure you actually need to write a script before doing so...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...