How to run hscript commands without textport

   4637   5   1
User Avatar
Member
23 posts
Joined: July 2005
Offline
Hi,

I can't seem to figure out how to run a command without using the textport. I'd like to be able to run “tk” at a certain point during playback, like if $F> 100 then run “hscript tk”. Can this be done in an expression CHOP? How do people generally use hscript while Houdini is running?

Thanks for your help,
Christine Smith
Northrop Grumman
Engineering Visualization Resource
User Avatar
Member
12498 posts
Joined: July 2005
Offline
Hey there,

I think you'll find the Logic CHOP is place to do what you're trying to do.

Good luck,
Jason
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
User Avatar
Member
398 posts
Joined: July 2005
Offline
chrsmith, I'm not sure, does make sense starting Tk in the specific frame. But if this is actually necessary, that you can use the following construction

float RunTk(float frame, value) {
if(frame == value) {
execute(“tk”);
}
}

A question has long ago interested me, why the construction given above works correctly, but the expression like

if($F == 100, execute(“tk”), 0)

starts Tk in each frame, not only in frame number 100. Similar problem appears with use postrender and postframe scripts. In that sense, that the script is started not AFTER the render of current frame or entire sequence, but BEFORE the render.
f = conserve . diffuse . advect . add

fx td @ the mill
User Avatar
Member
23 posts
Joined: July 2005
Offline
hoknamahn
chrsmith, I'm not sure, does make sense starting Tk in the specific frame. But if this is actually necessary, that you can use the following construction

float RunTk(float frame, value) {
if(frame == value) {
execute(“tk”);
}
}


hok:
Your code is not hscript is it? Where would it go?

What I'm trying to do is make tk run automatically without typing it. I need to make Houdini interactive. While Houdini is playing, and when it reaches a certain frame, or when a trigger CHOP fires, or a channel reaches a certain value, a tk window pops up. I do something in the tk window to manipulate objects in Houdini, then tk closes. I've got tk working, but I don't know how or where to execute the command to start it.

Any ideas/suggestions?

Thanks,
Christine
User Avatar
Member
398 posts
Joined: July 2005
Offline
hok:
Your code is not hscript is it? Where would it go?

What I'm trying to do is make tk run automatically without typing it. I need to make Houdini interactive. While Houdini is playing, and when it reaches a certain frame, or when a trigger CHOP fires, or a channel reaches a certain value, a tk window pops up. I do something in the tk window to manipulate objects in Houdini, then tk closes. I've got tk working, but I don't know how or where to execute the command to start it.

Any ideas/suggestions?

Thanks,
Christine

It's not HScript code. It's an expression function. This function (or rather execute()) makes it possible to call any HScript command (like the command line of HScript), including Tk. This function can be used in any place, where is allowed use expressions. For example, it is possible to create Null Obj and use RunTk in one of the channels. Thus, function will be carried out in each frame. But in the necessary frame it will run Tk.
If I do not make mistakes, there is no other way for the starting of something at the specific moment of time.

Example www.cgtalk.ru/~hoknamahn/run_tk.hipnc
f = conserve . diffuse . advect . add

fx td @ the mill
User Avatar
Member
23 posts
Joined: July 2005
Offline
For anyone who wants to know, I typed that function in the Aliases and Variables window under the Expressions tab, then called the function in a channel.

Thanks!!!
  • Quick Links