Jump to content

newbie chkey question


keithlegg

Recommended Posts

Hello all, I am very much a beginner with houdini and I am trying to get a simple scripting problem to work. I wish my first post here wasnt such a simple question but here goes anyway.

My question is this. I am trying to write a houdini .cmd script and I

want to know the command to insert an expression into a channel. The

equivilant of dragging one channel to another and getting the

ch("../box1/sizex") , etc only with a script command instead of

actually dragging it. From my research my instinct tells me that I

should use the chkey function but it does not work in a straitforward

manner.

suppose i want to link the scalex of box2 to box1. would I not type

chkey -f 1 -v 1 -F `ch("../box1/sizeX")` box2/sx

why does this not work? what am I missing here? I am hoping for that reassuring green color to tell me the channel is hooked up and nothing I have tried so far will do that. I looked at a lot of

other scripts that do it this way and it seems like it should work.

Any help would be appreciated.

all the other commands in houdini seem to make sense but that damn chkey doesnt act the way I would expect. Also houdini doesnt always return any error message so I dont know where to turn for help.

Thanks

Keith

Link to comment
Share on other sites

Thank you Steven!!! Now it works. It seems odd to me to add a transform channel when it already has one there. anyway I got it to work. I fancy myself quite the melscripter in maya and its like starting all over again in houdini. One other dumb newbie question and I promise my next one will be a smart question. What the heck is a "chautoscope"?? This is the only command that I dont understand now and there is no help for this. Thanks so much!

Keith

Link to comment
Share on other sites

It's syntax is exactly like the chlock command (see "help chlock" in the textport). Except that it doesn't change the "lock" flag on parameters, it changes the "autoscope" flag on parameters. The "autoscope" flag on a parameter says whether a particular parameter will be automatically "scoped" (ie. show up in channel editor, and its keys in the playbar if it has a channel) when the given operator is selected.

Instead of just demonstrating how to use that command, let me set things up in H7 while we're at it to make users coming from package XYZ more comfortable.

1. Load a default Houdini session.

2. From the top Desktop menu, choose Animate.

3. The default desktop isn't actually so useful, let's make it look like application XYZ. Close all the panes except for the Viewer and Network Editor. In the Pane menu of the Network Editor, change it to a Channel List pane instead. Just to the left of the menu you just used, there should be this small vertical line button. Click on it to hide the top toolbar of the pane. Now drag the splitter between your two panes more to the right. From the File menu, choose "Save Current Desktop".

4. With your mouse in the Viewer, do Tab > Generators > Geometry. Since it's automatically selected when put down, notice how all its transform parameters have been "scoped" and show up in the Channel List pane.

5. But let's say we don't actually want the Pivot, Scale, or Uniform Scale parameters to autoscope. By default, the Channel List shows the parameter labels (ie. the nice names) instead of the actual parameter token names which we need to know for scripting. With your mouse hovering over the parameters in the channel list pane, press CTRL+right mouse button. This should bring up a menu. Turn off Use Parm Labels. Now it shows the actual parameter token names instead of labels.

6. From the top Windows menu, choose Textport. In the Textport, type this command:

chautoscope /obj/geo1 -p* -s*

From now on, those parameters in the node /obj/geo1 which either start with the letter p or the letter s will no longer autoscope. We could have explicitly used "px py pz sx sy sz scale" but why do all that extra typing? You can close the textport window now.

7. To see the effect of the chautoscope command, we need to reselect the object. With your mouse in the viewer, hit the s key. This invokes the "favourite" tool which defaults to the Transform tool at the Object level.

8. Click on empty space in the viewer to deselect the object.

9. Click on the geo object to select it again. Notice now that in the Channel List pane, we only have the translate and rotate parameters. Now you can save this hip file and the behaviour will be saved with it.

Link to comment
Share on other sites

Yeah, I guess the concept is a bit odd. Think of a channel as what you use when you have a parameter that is animated. The easy way to see whether you have a channel on a parameter is that its background colours changes to some form of green. In Houdini, a channel means that it is animated either via keyframes or an expression.

Link to comment
Share on other sites

I am a total beginner with houdini but it seems to me that it follows the paradigm of the old analog synths and patch cords. a "channel" is a flow of data (usually animation or audio from chops?) that hooks to a "parameter" or plug, to change it over time. They are related but not the same thing exactly. The "scoping" is the ability to organize your data and hide the extraneous parameters . In application M , the equivilant thing to autoscope would be "setAttr -e -keyable true " . Again I dont know much about this stuff but I think I get it now.

Keith

Link to comment
Share on other sites

Hi Keith,

IMHO, a channel is a function curve similar to other applications so "chadd" is to "create" the channel(fcurve) & "chkey" is to add keys to the channel(fcurve).

Scoping is to display the channel(s) in the Channel Editor where you can edit the slopes, values etc.

Cheers!

steven

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...