mcjLabelizer - Script for DazStudio 1/2/3/4 to quickly create text labels, signs, subtitles

mCasualmCasual Posts: 3,111
edited June 2012 in Freebies

download and manual : https://sites.google.com/site/mcasualsdazscripts2/mcjlabelizer

This script for Daz Studio lets you quickly create a text label, and apply it to a surface in the scene.

Ideal for those who use Daz Studio to create tutorials

Pre-Requisite : this script makes use of the services offered by imageMagick

as you can see below, you have access to all the fonts installed on your PC!

//=================================================================================
Version History
Jun 14, 2012 10:17 PM corrected problem: script did not accept new paths to imagemagic's convert.exe
May 23, 2012 9:39 PM update, opacity map and Face-the-camera
May 16, 2012 8:26 PM release
//=================================================================================

common.jpg
600 x 168 - 28K
foxy.png
369 x 562 - 12K
qbf2b.jpg
600 x 600 - 51K
qbf2.jpg
600 x 600 - 55K
Post edited by mCasual on

Comments

  • CriosCrios Posts: 803
    edited December 1969

    Can be really usefull for put info on a content...in the content folder.

    :coolsmile:

  • DisparateDreamerDisparateDreamer Posts: 1,727
    edited December 1969

    WOW this is a VERY handy script! I can't wait to use it! THANK YOU!

  • Eustace ScrubbEustace Scrubb Posts: 1,396
    edited December 1969

    Absolutely incredible! I've been wanting to be able to do just that, and hadn't quite known how!

  • Eustace ScrubbEustace Scrubb Posts: 1,396
    edited May 2012

    meh. doublepost.

    Post edited by Eustace Scrubb on
  • KalisxKalisx Posts: 104
    edited December 1969

    WOW very useful.
    Thank's a lot.

  • Wiccan1Wiccan1 Posts: 171
    edited December 1969

    Thanks, I really do adore your scripts! ♥

  • RAMWolffRAMWolff Posts: 5,585
    edited December 1969

    Looks very useful. Is there a way to make the object billboard transparent but NOT the text?

  • DollyGirlDollyGirl Posts: 1,700
    edited June 2012

    Casual, I just downloaded and installed Labelizer and I have a question. I placed ImageMagick in my Programs directory as indicated on the web page but when I tried to point the script to its location the default pointer did not change and I got the message "Please specify a valid path to imagemagick/convert.exe.".

    I am running a 64 bit Win 7 machine and DAZ4. OS is Windows 7 Ultimate, Service Pack 1. I run with admin access.

    I made a copy (did not install) of the ImageMagik program directory and put it on my root directory. The script ran successfully.

    I noticed that I have to have both the root directory and the Program Files directory for the script to run. I found this out when I renamed the Program Files directory to something else. When I did that the script no longer worked.

    I did not try to run the script with an install to the root directory only.

    I changed the default in the script file to point at the Program Files directory by changing
    var default_ed0text = "c:/imagemagick/convert.exe";
    to
    var default_ed0text = "c:/Program Files/imagemagick/convert.exe";

    The script ran successfully.

    Am I doing something wrong? If I need to give you more information just ask.

    This is a great tool and I am going to feature it in the July Freebie contest on July 2 with Eustaces' shaders, which happens to be about graphic/toon renders, "Heros, Heroines and 3DGraphics". I hope you can come by and check it out.
    Lonnie

    Post edited by DollyGirl on
  • mCasualmCasual Posts: 3,111
    edited June 2012

    Dollygirl said:
    ... Lonnie

    yes indeed it looks like my script doesn't accept to change the path to imagemagick !

    lets see ...

    oh i see now, the function called exeBrowse(), gets a path then does nothing with it !

    so i change it to

    
    //==================================================================
    //
    //==================================================================
    function exeBrowse()
    {
     var filename = FileDialog.doFileDialog( 
      true, 
      "Select Executable", 
      ed0.text, 
      "EXE Files (*.exe)" 
      );
     if( filename )
     {
      ed0.text = filename;
     }
    }
    }
    

    and it now works

    so i'll upload the corrected version in the next minutes

    thanks for pointing it out

    lets add a labelized image ...

    ( ah when will mcjSuperLathe v1,0 be launched?, Time will tell )

    sosuper.jpg
    600 x 600 - 68K
    Post edited by mCasual on
  • mCasualmCasual Posts: 3,111
    edited December 1969

    Dollygirl said:
    .... I am going to feature it in the July Freebie contest on July 2 with Eustaces' shaders, which happens to be about graphic/toon renders, "Heros, Heroines and 3DGraphics". I hope you can come by and check it out.
    Lonnie

    i want to participate in one of those contests someday , i like making renders, no just program program program :)

  • mCasualmCasual Posts: 3,111
    edited December 1969

    ~ News ~ Update ~ ~ News ~ Update ~ ~ News ~ Update ~ ~ News ~ Update ~ ~ News ~ Update ~

    Jun 14, 2012 10:17 PM corrected problem: script did not accept new paths to imagemagic's convert.exe

  • DollyGirlDollyGirl Posts: 1,700
    edited December 1969

    Casual said:
    ~ News ~ Update ~ ~ News ~ Update ~ ~ News ~ Update ~ ~ News ~ Update ~ ~ News ~ Update ~

    Jun 14, 2012 10:17 PM corrected problem: script did not accept new paths to imagemagic's convert.exe

    Thanks Casual. It worky now! Hope you can come play with us.
    Lonnie

  • timrathtimrath Posts: 26
    edited December 1969

    I hope you guys are still around! I can't get the script to work. :-(
    I specified the "image out file path" and "imagemagick/convert", but when I hit "Apply", I get:
    "Imagemagick rejected this command. Review the syntax of your options. Hints: font names and color names"

    These are my options:
    -background white
    -fill blue
    option 4 -font Verdana
    option 4 -pointsize 28
    option 5 -gravity center
    option 6 -size 512x512

    There's probably something wrong with the -font option. I changed it to different fonts, but always the same result.

  • mCasualmCasual Posts: 3,111
    edited February 15

    timrath said:
    I hope you guys are still around! I can't get the script to work. :-(
    I specified the "image out file path" and "imagemagick/convert", but when I hit "Apply", I get:
    "Imagemagick rejected this command. Review the syntax of your options. Hints: font names and color names"

    These are my options:
    -background white
    -fill blue
    option 4 -font Verdana
    option 4 -pointsize 28
    option 5 -gravity center
    option 6 -size 512x512

    There's probably something wrong with the -font option. I changed it to different fonts, but always the same result.

    possibly it's because there's blank spaces or tabs in your values
    or maybe you don't have the Verdana font

    bb.jpg
    1008 x 694 - 155K
    TR.jpg
    959 x 675 - 191K
    Post edited by mCasual on
  • timrathtimrath Posts: 26
    edited December 1969

    Thank you for your swift reply!
    I made sure that there are no empty spaces in any line. I also tried to substitute Verdana with Courier, System, and Arial, but with no luck. I even left that line blank, but that didn't help, either.

    Maybe ImageMagick is incompatible with Windows 8.1? How can I check if ImageMagick runs at all? When I start IMDisplay and try to open an image from MyDocumets, I get the error message: "IMDisplayDoc function [DoReadImage] reported an error. imdisplay.exe: unable to open image. No such file or directory @ error/blob.c/OpenBlob/2674"
    However, copying that image directly into the ImageMagick folder allows it to open it. It seems there's a permission problem. Setting IMDisplay.exe to "always run as an Administrator" doesn't help. Similarly, setting convert.exe to "always run as an Administrator" didn't help either. Finally, I changed ALL the *.exe files to "run as Administrator" - to no effect.

  • mCasualmCasual Posts: 3,111
    edited February 15

    timrath said:
    Thank you for your swift reply!
    I made sure that there are no empty spaces in any line. I also tried to substitute Verdana with Courier, System, and Arial, but with no luck. I even left that line blank, but that didn't help, either.

    Maybe ImageMagick is incompatible with Windows 8.1? How can I check if ImageMagick runs at all? When I start IMDisplay and try to open an image from MyDocumets, I get the error message: "IMDisplayDoc function [DoReadImage] reported an error. imdisplay.exe: unable to open image. No such file or directory @ error/blob.c/OpenBlob/2674"
    However, copying that image directly into the ImageMagick folder allows it to open it. It seems there's a permission problem. Setting IMDisplay.exe to "always run as an Administrator" doesn't help. Similarly, setting convert.exe to "always run as an Administrator" didn't help either. Finally, I changed ALL the *.exe files to "run as Administrator" - to no effect.

    i think that's where the latest windows8 version is
    http://www.imagemagick.org/script/binary-releases.php#windows

    if you run mcjLabelizer in Daz Studio's Scripting IDE tab
    you will see the command that mcjLabelizer builds and sends to imagemagick

    if you copy this command line using Notepad
    and save it in text format under the name DOTHISTEST.bat
    and place this batch file in the same folder as imagemagic's convert.exe

    convert.exe -background black -fill white -font Courier -pointsize 80 -gravity Center -size 800x800  label:"Hi Dave." "mytest.jpg"

    then by double-left-clicking on DOTHISTEST.bat
    you will execute this command
    which in turn will produce the label-image mytest.jpg

    if you add

    pause

    as the second command in DOTHISTEST.bat

    then you will have time to read any complaint imagemagick may report when trying to execute your command

    ....


    actually when i test this, my own imagemagick cant seem to find the fonts

    but when i remove the -font ------ part imagemagick stops complaining

    
    convert.exe -background black -fill white -pointsize 80 -gravity Center -size 800x800  label:"Hi Dave." "mytest.jpg" 
    pause


    also note that even when the fonts will work, we will have to enclose font names in quotation marks

    like

    -font "Times New Roman"

    i'm upgrading my imagemagick to

    ImageMagick-6.9.0-6-Q16-x64-static.exe


    in the image below you can see imagemagick cant find the font Courier

    but it produced an image-label anyway !

    i'm reading imagemagick forums and some people mention issues about the 64-bit version, so i'll install the 32 bit version instead

    downgrading to ImageMagick-6.9.0-6-Q16-x86-static.exe

    well not sure this last step solved the problem, but it now works

    but "Courier" was not a valid font name anyway

    so this command

    convert.exe -background black -font Verdana -fill white -pointsize 80 -gravity Center -size 800x800  label:"Hi Dave." "mytest.jpg" 
    pause
    

    did work !

    and i think the imagemagick 32 bit version installed more things than the 64 bit version

    oops i read somewhere that the spaces in font names must be replaced with dashes

    example

    convert.exe -background black -font "Century-Gothic" -fill white -pointsize 80 -gravity Center -size 800x800  label:"Hi Dave." "mytest.jpg" 
    pause
    

    so the quotation marks are not needed

    but i think on mcjLabelizer's page i have a list of font names

    to get a list of all fonts available on your PC

    type this in notepad and save it as showallfonts.bat and run that batch file

    convert -list font > allfonts.txt

    fonts.jpg
    1334 x 719 - 555K
    common.jpg
    600 x 168 - 42K
    mytest.jpg
    800 x 800 - 9K
    problemo.jpg
    677 x 342 - 47K
    Post edited by mCasual on
  • timrathtimrath Posts: 26
    edited December 1969

    Thank you for this detailed explanation, and for going through all that trouble!
    I did what you suggested, and could verfy that ImageMagick does work on my system. The image with the test message generated correctly. I was able to change the colour, font, font size and image size parameters at will, and ImageMagick obeyed them all.
    I also ran the allfonts.bat, and verified that all the fonts that I had tested were available on my computer.
    So, uh... since ImageMagick isn't the source of the problem, where should I investigate next?

  • mCasualmCasual Posts: 3,111
    edited February 15

    timrath said:
    Thank you for this detailed explanation, and for going through all that trouble!
    I did what you suggested, and could verfy that ImageMagick does work on my system. The image with the test message generated correctly. I was able to change the colour, font, font size and image size parameters at will, and ImageMagick obeyed them all.
    I also ran the allfonts.bat, and verified that all the fonts that I had tested were available on my computer.
    So, uh... since ImageMagick isn't the source of the problem, where should I investigate next?

    if you open DS Scripting IDE Tab

    File / Open / mcjLabelizer.dsa

    then run it -

    Execute button

    you will see what the script is commanding imagemagick to do

    then you can run this command using a batch file and see what imagemagick complains about

    possibly a question of quotation marks

    also possibly the text of your label contains "illegal" characters

    for example if your label text contains quotation marks, imagemagick will be very confused

    jjj.jpg
    1920 x 876 - 510K
    Post edited by mCasual on
  • timrathtimrath Posts: 26
    edited February 17

    I did as you suggested.

    These were the parameters:
    convert.exe -background white -fill blue -pointsize 28 -gravity center -size 512x512 label:"Test" "C:/ImageMagick/115.jpg"

    This was the result:
    convert.exe: unable to open image 'Test': No such file or directory @ error/blob.c/OpenBlob/2674
    convert.exe: RegistryKeyLookpuFailed 'CoderModulesPath' @ error/module.c/GetMagickModulePath/662.
    convert.exe: no decode delegate for this image format 'LABEL' @ error/constitute.c/ReadImage/501
    convert.exe: no image defined 'C:`/ImageMagick/115.jpg' @ error/convert.c/ConvertImageCommand/3212

    Apparently, convert.exe is mistaking the text for the output image file name and vice versa.

    I then returned to DAZ Studio changed the output file name to the name of an already existing image file. The result was that that image was applied onto the object in DAZ Studio. It seems that the script cannot create a new image, nor can it change existing images. It can only use images that are already there. Maybe an issue with Windows denying it permission to write stuff on the disk?
    However, doing the same thing in the *.bat file still produced the same error messages.

    Post edited by timrath on
  • timrathtimrath Posts: 26
    edited December 1969

    Some more details:
    I have Windows 8.1, 64 bit.
    mcjLabelizer.dsa has full security permissions.
    I'm logged in as the computer's Administrator.

  • mCasualmCasual Posts: 3,111
    edited February 18

    timrath said:
    Some more details:
    I have Windows 8.1, 64 bit.
    mcjLabelizer.dsa has full security permissions.
    I'm logged in as the computer's Administrator.

    the problem is most probably that

    convert doesn't have Write access to C:/ImageMagick/

    which is where you attempted to write the image file

    so it's better to put it in a folder like C:\Users\Public

    or add the user "Everyone" to the security list of c:\imagemagick
    and grant it write access

    ( not the preferred solution )

    Post edited by mCasual on
  • timrathtimrath Posts: 26
    edited December 1969

    It works! I went with the nuclear option and permission-bombed all the ImageMagick and DAZ folders and everything in them. Thank you for being so patient with me. :-)

Sign In or Register to comment.
Rocket Fuel