Hscript

From DreamsteepWiki

Jump to: navigation, search

Notes from Keith

HSCRPT CHEAT SHEET

IMPORT A CHANNEL WITH HSCRIPT

#import animation 
opcd   /obj/pSphere1
chblockbegin
chadd  /obj/pSphere1 rx ry rz
chkey -t 0 -v 0 -m 0 -A 0 -F '$F' /obj/pSphere1
chblockend

chread rx ry rz -f 0 13 C:/data/pSphere1.chan




Basically, in Houdini use the textport command "openport 554" where 554 is any number (do "help openport" in the Houdini textport for more info).

Then, you can use the command "hcommand 554 opls" to access Houdini from "outside". So, in your Python script, do whatever the command is to call an external program (in Python) using "hcommand 554 xxx" and replace xxx with whatever Houdini command you want. That's it! That's why Python isn't embedded anymore, it's not needed to be embedded. You can program in Cshell, Python, VB, Fortan, Pascal, C++ or whatever the heck you want ;) 



help commands

help

exhelp


history - shows command history

opscript - builds a script to re create a node
opscript -r /obj/model/foo

USEFUL COMMANDS

cd = alias for opcf

  1. = REM , // etc



//get a filenode path

opparm -d /obj/model/file1 file

//set a file path

opparm /obj/CITYNODE/file1 file "eee"

//opwire

opwire subnet1 -0 xform1

//add an expression /channel /keyframe

chkey -t 0 -v 0 -m 0 -A 0 -F 'ch("../cam1/tx")' model/sx
chkey -f 12 -v 45.3 ../xform1/t?
chkey -f 122 -v 45.3 -F `ch("../box1/sizex")` ../xform1/t?

remove a channel

chrm /obj/geo1/xform1/tx


> chkey -f 1 -v 3 -F 'cubic()' geo*/t? Sets the value to 3 and expression function to cubic() for all channels matching geo*/t?.


USEFULL EXPRESSIONS

BOUNDING BOX DIMENSIONS

bbox("../file1/",D_X)

CENTER

centroid("../f1tr/",D_Y)




NAMING(PATTERNS)

PATTERN MATCHING

  • any sequence

? any single character

[ set ] any enclosed in square brackets



variables

$n = frame number


set Usage: set [-g] name = value set -p name = value set -u name set [-s]

local

set f = "test"

set f = 44


global

setenv f = "test"


ARRAYS



STRINGS

set foo1 = bob set foo2 = sue for i = 1 to 2 echo ${foo${i}} end

printing

echo $f



TO RUN A COMMAND PUT IN A TEXTFILE AND

source "C://foo.h"


ucd - unix current dir

pwd - node location

upwd - disk location






machine stuff

java

tcl

tk

unix







LOGIC


() parentheses

|| or

&& and

== equal

< less

> gretaer

<= less equal

>= great equal


for loops

set foo1 = bob set foo2 = sue for i = 1 to 2 echo ${foo${i}} end


iterating

set f = `$f+1`


foreach

foreach variable (element list )

...

end


while

while (expression)

...

end



IF

set foo = "keith"

if ($foo=="bob")

echo "FOO IS BOB"

endif


if ($foo == "keith")

echo "FOO is KEITH "

endif








OPERATOR COMMANDS

omsls available selectors (?)

oplocate -x 0 -y 0 model ##moves the node in the view

opadd- makes a node

opname - rename

opfind -t light

opcp - copy

oprm - operator remove

opgroup

---

opls - opertalor list

---

oppwf - present op folder

---

opinfo /obj/CITY/sphere1


optype /obj/CITY/sphere1


opget - info querry on an operator

opget -q -p subnet1


--- opset -d on/obj/ CITY

opset -q blur1



opset -d on geo* opset -p off light* opset -l hard -s on geo*/*

opset -d on -r off -h off -f off -y off -t off -l off -s off -u off -c off -C on -p on -e on -b off -S on -x off CITY


opparm -

opparm xform1 s 1 2 3

opparm -d xform1 s

opparm -d /obj/g/box1 type


opscript- build a script for a node


opscript -r /obj/g


opsave write an operator to disk

opsave -f 1 3 /obj/CITY/foo "E://foo.$N.iges"

opunwire blur1 -0

opwire


opwire xform1 -0 subnet1

opwire xform1 -1 subnet1


PARAMETERS (like mayas attributes)

chadd - ??

parmeditor

parmList

paramset /obj/geo1/sphere1.radius 2


TIME

fcur - current frame set or query

tcur

CHANNEL COMMANDS



expression syntax


exread "c:\\nameoffile.h"

==>

double (numbert)

{

number = number*2;

return number;

}

<==


exls



Personal tools