CHOPs & COPs

   10616   16   2
User Avatar
Member
543 posts
Joined: July 2005
Offline
Hi,

I admit, I haven't used COPs much in the past, just simple things, but now I've got to do a bit more complicated sequence and I'm stumped …

What I need to do is take values out of CHOPs and export them to COPs, primarily to a Font COP, I need to:
a) change the text field to be the value of my exported CHOP value
b) change the position of the text based on the CHOP values …

But I can't seem to export to a COP, when I look at the help for the COPs I'm using, I don't see any channels listed.

Am I missing something? Looking in the wrong place?
Hints? Work arounds?

As usual, thanks!


–Mark
========================================================
You are no age between space
User Avatar
Member
4140 posts
Joined: July 2005
Offline
Translate is easy - just add an export CHOP after whatever you want exported, add a translate COP after the font COP, then point the export at the transform COP, then enter “tx”(no quotes) in the “Path” field in the export CHOP. it breaks it up into two lines - the OP and the channel. Scrub the timebar and you should see the font moving(it needs a kick to show up). I've not been able to export directly to the Font COP - not sure why, but it's probably related to the fact that the channel is called “translate” and consists of two fields, instead of being two separate enitities called tx and ty. Probably need to construct the channel to match that I suppose.

I'm thick on the outputting text thing. How does a channel contain a text value?

Cheers,

J.C.
John Coldrick
User Avatar
Staff
5156 posts
Joined: July 2005
Offline
You can print the CHOP's channel value by entering the following expression in the Font's text field:

`chopf(“/ch/ch1/wave1/chan1”, $F)`

(note the backticks around the expression). Replace the path with the path to your CHOP. The last part of the path is the channel name (my node is wave1, it has a channel chan1).

Unfortunately, the transform parms in the Font COP are terribly named - translate1, translate2, scale1, scale2, etc.. I must have hit my head hard before writing it. ops: As long as you get the path right, the export should kick in.
User Avatar
Member
543 posts
Joined: July 2005
Offline
Hey, hey, hey!

JColdrick
I've not been able to export directly to the Font COP - not sure why, but it's probably related to the fact that the channel is called “translate” and consists of two fields, instead of being two separate enitities called tx and ty. Probably need to construct the channel to match that I suppose.

I'm thick on the outputting text thing. How does a channel contain a text value?

Ah yes, I now have the Transform COP working, but I would have expected the same from the Font, Layer, and other COPs that have Translate fields … all the COPs help pages that I checked don't have any channels listed (even though as you point out, at the very least, the Transform COP does have channels available).

What the deal is with the text from CHOPs is this: I have a set of min/max values stored in a bunch of files, they are selected by a Switch CHOP based on elapsed time. What I need to do is “convert” those CHOP values to text in COPs. Still stumped …


–Mark
========================================================
You are no age between space
User Avatar
Member
4140 posts
Joined: July 2005
Offline
Heh - looks like Mark A. posted one minute before Mark S. Hopefully that answered your question Mark #1…

Btw - I was stuck on the Font COP channel naming too - but whenever that happens, I just open the textport and type(for example):

opscript /img/img1/font1

and that lists the channels for the op. For the record, the help popup in v6.5+ does actually give the param name - it just *seems* wrong. It actually says “translate” under params…which is correct.

Cheers,

J.C.
John Coldrick
User Avatar
Staff
5156 posts
Joined: July 2005
Offline
Heh - looks like Mark A. posted one minute before Mark S. Hopefully that answered your question Mark #1…

Yeah, I posted, looked back and… hey, that's not what I wrote…

Btw - I was stuck on the Font COP channel naming too - but whenever that happens, I just open the textport and type(for example):

opscript /img/img1/font1

The only problem with opscript is that it only prints out the ‘base name’ of the parm, ‘translate’ ( translate { 0 0} ). The channels themselves have extensions placed on them (1,2,3 for floats, x,y,z for points, r,g,b, etc).

If you can't find the channel names in the helpcards (which shouldn't be an issue with the new helpcards) and popups are off, you can Alt+LMB the parm label to create a channel, and Shift+LMB it to scope the channels in the channel editor - the names will be displayed there (and then Undo). However, you shouldn't need to do this, 6.5 and up.
User Avatar
Member
4140 posts
Joined: July 2005
Offline
Ah - OK then…probably something to tag the docs people with since it literally only says “translate” in the Font help. That also explains why I couldn't get it to work - I thought it was a single array with two entries - should have known better…

Cheers,

J.C.
John Coldrick
User Avatar
Member
543 posts
Joined: July 2005
Offline
twod
`chopf(“/ch/ch1/wave1/chan1”, $F)`

Perfect!

Thanks!!
========================================================
You are no age between space
User Avatar
Member
2199 posts
Joined: July 2005
Online
To find the names of channels I always just copy them and then look on the clipboard, gives you all sorts of useful info including the names of the channels.
The trick is finding just the right hammer for every screw
User Avatar
Staff
1072 posts
Joined: July 2005
Offline
In newer versions of Houdini you can just hover the mouse over the parameter label to get popup help.
User Avatar
Member
2199 posts
Joined: July 2005
Online
Wow that's cool, don't think my mouse has ever lingered long enough over a parameter to notice that, i work too quick….
The trick is finding just the right hammer for every screw
User Avatar
Member
1631 posts
Joined: July 2005
Offline
And you can create your own aliases (RMB on the parameter label) for channels too. So if you don't like “what_cha_ma_call_it”, you can alias it as “foo_x” & reference that instead. opparm works too!

Cheers!
steven
User Avatar
Member
543 posts
Joined: July 2005
Offline
stevenong
And you can create your own aliases (RMB on the parameter label) for channels too. So if you don't like “what_cha_ma_call_it”, you can alias it as “foo_x” & reference that instead. opparm works too!

Oh, I did not know that, thanks!


–Mark
========================================================
You are no age between space
User Avatar
Member
412 posts
Joined: July 2005
Offline
dang, what version are you guys running, i cant seem to get any of these nifty things… ( i usually use the clipboard as well simon)…
Dave Quirus
User Avatar
Member
1631 posts
Joined: July 2005
Offline
It has been available since Houdini 6.5.
User Avatar
Member
2199 posts
Joined: July 2005
Online
H6.5 and H7 seem to have it.
The trick is finding just the right hammer for every screw
User Avatar
Member
412 posts
Joined: July 2005
Offline
ahh ok.. 6.1 here..
Dave Quirus
  • Quick Links