hwatermark working for anyone??

   6892   13   4
User Avatar
Member
21 posts
Joined: Dec. 2012
Offline
Hi all,

I was following the SESI tutorial on wedging just fine until I entered the command for stamping the image with the wedge name. The help card lists the command as
unix hwatermark -x 4 10 -m “$WEDGE” `chs(“vm_picture”)` `chs(“vm_picture”)` $HFS/houdini/fonts_texture/Fixed-Bold.24

My renders failed every time this text was in the post-frame script box. I soon realized there's no “font_texture” folder any longer so I changed that to “font” would help but no go.

I tried using hwatermark independently on a simple .pic file on the C drive using many variations of

hwatermark -m “test text” -x 4 10 “Cwedge.pic” “Cwedge.pic” “CProgram Files/Side Effects Software/Houdini 12.5.562/houdini/fonts/Courier-Bold.24”
or
hwatermark -m “test text” -x 4 10 “Cwedge.pic” “Cwedge.pic” “CProgram Files/Side Effects Software/Houdini 12.5.562/houdini/fonts” Courier-Bold.24
… with quotes, without quotes, backwards and forwards slashes, etc., but it either shows me the options (which I take to mean I didn't enter the command correctly) or I get “Error: cannot open resource” . Not sure if “resource” means the file or hwatermark.

Any ideas?

BTW, I tried this in Houdini 12.5.562 and 13.0.198
User Avatar
Staff
2590 posts
Joined: July 2005
Offline
NYU_Animation
Hi all,

I was following the SESI tutorial on wedging just fine until I entered the command for stamping the image with the wedge name. The help card lists the command as
unix hwatermark -x 4 10 -m “$WEDGE” `chs(“vm_picture”)` `chs(“vm_picture”)` $HFS/houdini/fonts_texture/Fixed-Bold.24

My renders failed every time this text was in the post-frame script box. I soon realized there's no “font_texture” folder any longer so I changed that to “font” would help but no go.

I tried using hwatermark independently on a simple .pic file on the C drive using many variations of

hwatermark -m “test text” -x 4 10 “Cwedge.pic” “Cwedge.pic” “CProgram Files/Side Effects Software/Houdini 12.5.562/houdini/fonts/Courier-Bold.24”
or
hwatermark -m “test text” -x 4 10 “Cwedge.pic” “Cwedge.pic” “CProgram Files/Side Effects Software/Houdini 12.5.562/houdini/fonts” Courier-Bold.24
… with quotes, without quotes, backwards and forwards slashes, etc., but it either shows me the options (which I take to mean I didn't enter the command correctly) or I get “Error: cannot open resource” . Not sure if “resource” means the file or hwatermark.

Any ideas?

BTW, I tried this in Houdini 12.5.562 and 13.0.198

hwatermark was changed to support TTF fonts. So you need to pass the path to a TTF font (and specify the size). The usage is now: Usage: hwatermark <srcimg> <dstimg> <fontfile> <fontsize>
Where the src.pic is the image to watermark, dst.pic the file to
save the result to, and fontfile the full path to the file to use as thefont.
Options:
-m text : Message to composite onto the image (required)
-c r g b : Specify color (0-255) for text. Default: 255 255 255
-a value : Specify alpha (0-255) for compositing text. Default: 255
-S offset : Shadow offset (in pixels). 0 to disable. Default: 0
-s r g b : The color (0-255) of the shadow Default: 0 0 0
-B r : The radius of the shadow blur Default: 2.0
-A alpha : Specify alpha of shadow (0-255) Default: 128
-x x y : Specify location of text in pixels. (0, 0) is bottom left
-j : Right justify the text
-o : Overwrite alpha on the destination image.
-q : Suppress all text output


So, for example, you might call it like this: hwatermark -m “Hello world” Mandril.pic Watermarked.pic $HH/fonts/DejaVuSans 12
Edited by - Jan. 21, 2014 10:06:37
User Avatar
Member
21 posts
Joined: Dec. 2012
Offline
Mark
hwatermark was changed to support TTF fonts. So you need to pass the path to a TTF font (and specify the size). The usage is now: Usage: hwatermark <srcimg> <dstimg> <fontfile> <fontsize>
Where the src.pic is the image to watermark, dst.pic the file to
save the result to, and fontfile the full path to the file to use as thefont.
Options:
-m text : Message to composite onto the image (required)
-c r g b : Specify color (0-255) for text. Default: 255 255 255
-a value : Specify alpha (0-255) for compositing text. Default: 255
-S offset : Shadow offset (in pixels). 0 to disable. Default: 0
-s r g b : The color (0-255) of the shadow Default: 0 0 0
-B r : The radius of the shadow blur Default: 2.0
-A alpha : Specify alpha of shadow (0-255) Default: 128
-x x y : Specify location of text in pixels. (0, 0) is bottom left
-j : Right justify the text
-o : Overwrite alpha on the destination image.
-q : Suppress all text output


So, for example, you might call it like this: hwatermark -m “Hello world” Mandril.pic Watermarked.pic $HH/fonts /DejaVuSans 12

Thank you for the quick reply, Mark. Unfortunately I still get the same error (“cannot open resource”).

FWIW I tried your code as written and when that didn't work I added the source and dest path to the file (CMandril.pic CWatermarked.pic (file copied to C:\)), with and without quotes and using backwards and forwards slashes. Apologies if I'm missing something obvious!
User Avatar
Staff
2590 posts
Joined: July 2005
Offline
NYU_Animation
Mark
hwatermark was changed to support TTF fonts. So you need to pass the path to a TTF font (and specify the size). The usage is now: Usage: hwatermark <srcimg> <dstimg> <fontfile> <fontsize>
Where the src.pic is the image to watermark, dst.pic the file to
save the result to, and fontfile the full path to the file to use as thefont.
Options:
-m text : Message to composite onto the image (required)
-c r g b : Specify color (0-255) for text. Default: 255 255 255
-a value : Specify alpha (0-255) for compositing text. Default: 255
-S offset : Shadow offset (in pixels). 0 to disable. Default: 0
-s r g b : The color (0-255) of the shadow Default: 0 0 0
-B r : The radius of the shadow blur Default: 2.0
-A alpha : Specify alpha of shadow (0-255) Default: 128
-x x y : Specify location of text in pixels. (0, 0) is bottom left
-j : Right justify the text
-o : Overwrite alpha on the destination image.
-q : Suppress all text output


So, for example, you might call it like this: hwatermark -m “Hello world” Mandril.pic Watermarked.pic $HH/fonts /DejaVuSans 12

Thank you for the quick reply, Mark. Unfortunately I still get the same error (“cannot open resource”).

FWIW I tried your code as written and when that didn't work I added the source and dest path to the file (CMandril.pic CWatermarked.pic (file copied to C:\)), with and without quotes and using backwards and forwards slashes. Apologies if I'm missing something obvious!

I had an extra space between the path ($HH/fonts) and the font name (DejaVuSans). I've edited my original post.
User Avatar
Member
21 posts
Joined: Dec. 2012
Offline
mark
[I had an extra space between the path ($HH/fonts) and the font name (DejaVuSans). I've edited my original post.

So now I've tried
hwatermark -m “Hello world” Mandril.pic Watermarked.pic $HH/fonts/DejaVuSans 12

but still get the error in H12.5.526 & 13.0. I cracked open an earlier version of hwatermark (Houdini 11.0.658) and at least I don't get the error, but no watermark.pic file gets written.
User Avatar
Staff
2590 posts
Joined: July 2005
Offline
Can you try the attached .hip file. There's an output driver (in /out) that has the hwatermark command in it.

Attachments:
water.hip (40.5 KB)

User Avatar
Member
21 posts
Joined: Dec. 2012
Offline
Thanks Mark. Unfortunately it crashes mplay each time I hit Render. I replaced “ip” with “watermark.pic” in the command (no quotes of course) but nothing got written out.
User Avatar
Member
21 posts
Joined: Dec. 2012
Offline
Hi Mark, any other thoughts? If it's working on your end I don't understand why it wouldn't on mine unless a problem with the Houdini version(s) I'm using?
User Avatar
Staff
2590 posts
Joined: July 2005
Offline
NYU_Animation
Hi Mark, any other thoughts? If it's working on your end I don't understand why it wouldn't on mine unless a problem with the Houdini version(s) I'm using?

I've been able to run the sample .hip file on Linux and Windows without getting a crash.

What happens if you replace the “ip” with another disk file name (like test.jpg). Does it still crash? Is the file created properly?

Does mplay work on your system?
Are you able to run hwatermark outside of Houdini?

My guess is that it's a configuration or system problem, but that's just a guess.
User Avatar
Member
21 posts
Joined: Dec. 2012
Offline
mark
NYU_Animation
Hi Mark, any other thoughts? If it's working on your end I don't understand why it wouldn't on mine unless a problem with the Houdini version(s) I'm using?

I've been able to run the sample .hip file on Linux and Windows without getting a crash.

What happens if you replace the “ip” with another disk file name (like test.jpg). Does it still crash? Is the file created properly?

Does mplay work on your system?
Are you able to run hwatermark outside of Houdini?

My guess is that it's a configuration or system problem, but that's just a guess.

Thanks for your response, Mark. Maybe it is a configuration issue after all. On one of our machines I was able to run the command as you'd printed it and the image did indeed pop up in mplay. Only when I included the full path to Mandril.pic did it work on my problem machine.

I also tried running hwatermark from the shell and used the same syntax for the command:
hwatermark -m “Hello world” “C:\Program Files\Side Effects Software\Houdini 12.5.562\houdini\pic\Mandril.pic” “C:\watermark.pic” “$HH/fonts/DejaVuSans” 20

I still get the “Error: Cannot open resource” message, but at least hwatermark is working in Houdini so that's a big plus!
User Avatar
Staff
2590 posts
Joined: July 2005
Offline
NYU_Animation
mark
NYU_Animation
Hi Mark, any other thoughts? If it's working on your end I don't understand why it wouldn't on mine unless a problem with the Houdini version(s) I'm using?

I've been able to run the sample .hip file on Linux and Windows without getting a crash.

What happens if you replace the “ip” with another disk file name (like test.jpg). Does it still crash? Is the file created properly?

Does mplay work on your system?
Are you able to run hwatermark outside of Houdini?

My guess is that it's a configuration or system problem, but that's just a guess.

Thanks for your response, Mark. Maybe it is a configuration issue after all. On one of our machines I was able to run the command as you'd printed it and the image did indeed pop up in mplay. Only when I included the full path to Mandril.pic did it work on my problem machine.

I also tried running hwatermark from the shell and used the same syntax for the command:
hwatermark -m “Hello world” “C:\Program Files\Side Effects Software\Houdini 12.5.562\houdini\pic\Mandril.pic” “C:\watermark.pic” “$HH/fonts/DejaVuSans” 20

I still get the “Error: Cannot open resource” message, but at least hwatermark is working in Houdini so that's a big plus!

If there are spaces in the path (i.e. $HH has “Program Files”, you have to be very careful with quoting of command line arguments.
User Avatar
Member
21 posts
Joined: Dec. 2012
Offline
mark
If there are spaces in the path (i.e. $HH has “Program Files”, you have to be very careful with quoting of command line arguments.

Thanks Mark. So is this to say we should use simple paths so as to avoid quotes altogether?

FWIW I went back to my earlier Houdini wedge file and messed around a bit more. I'm finally at the point where it adds the text to the image as in the example.

In the small chance it might be helpful to others reading this post, part of the problem had to do with the text I was trying to stamp. Apparently there must not be any spaces between the quotes after the “-m” flag, so something like

unix hwatermark -m “hello world” `chs(“vm_picture”)` `chs(“vm_picture”)` “$HH/fonts/DejaVuSans” 20

failed every time for me, while

unix hwatermark -m “Hello_World” `chs(“vm_picture”)` `chs(“vm_picture”)` “$HH/fonts/DejaVuSans” 20

worked just fine.

The same goes for the Prefix channel of the Wedge render node should a user choose to fill in something besides WEDGE - no spaces between words. Surely obvious to some but maybe not all?

So going back to the initial command syntax I posted, here is the syntax that works, with the change you suggested highlighted:
unix hwatermark -x 4 10 -m “$WEDGE” `chs(“vm_picture”)` `chs(“vm_picture”)` “$HH/fonts/DejaVuSans” 20

Thanks again for your help!

Attachments:
wedgeExample_working.hipnc (524.5 KB)

User Avatar
Member
142 posts
Joined: Feb. 2012
Offline
Can you do multi line text with hwatermark or do I need to call it multiple times with increasing offsets?
Showreel 2013 [vimeo.com]
User Avatar
Member
100 posts
Joined: Sept. 2006
Offline
This is an update for the command for Hou 16.5. Its seems some things have changed since the last post .
This works for me on Windows:

unix -q hwatermark -x 4 10 -m “$WEDGE” `chs(“picture”)` `chs(“picture”)` “$HH/fonts/DejaVuSans.ttf” 24

For the newbs:

Hwatermark is a host system command that can only be called via “unix”
To access Hwatermark the command would read: unix Hwatermark. Try it thru the Textport window.
To preserve quotation marks when passing arguments thru “unix” call use “-q”.
The channel name of your ROP has changed from ‘vm_picture’ to simply ‘picture’.
The font needs its extension specified as well. Otherwise “cannot open resource” error gets thrown at you.

Al.
Edited by axelsp - July 20, 2018 05:43:06
  • Quick Links