1. #1

    Question Custom sized shelf boxes and importing pngs for UI

    What's the process of adding in custom png's like this color swatch? I came across Cryrid's UI a few days ago over on Polycount. He posted the script but I couldn't get it to load so I figured I'd just try making my own. This is what his looks like.



    Thank you for any advice!
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	gaps on sides.png 
Views:	209 
Size:	180.8 KB 
ID:	497958  

  2. #2
    Moderator Follow User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    11,462

    Default

    Cryrid gives his code in this thread:
    http://polycount.com/discussion/9044...om-ui-showcase

    Basically you need to create a plugin button that has the image file specified in its parameters. You would then make the button part of your custom UI.


    [ISubPalette,"ZPlugin:Cryrid UI"]

    [IButton,"ZPlugin:Cryrid UI:QuickColor","Quick Colors",
    ,,1575 /*width*/,, "CryridUI\color1575_12.psd"/*image*/, 12 /*height*/]
    //end button

  3. #3

    Default

    Ok that makes sense. The process of making a custom sized plugin button is where you get into writing scripts huh? So if I wanted to adjust the height I'd just changed it in the .txt file and resave it.

  4. #4
    Moderator Follow User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    11,462

    Default

    If you look at the code I posted you'll see the button has a width of 1575 and a height of 12. Those are pixels that correspond to the image size.

    You can use that code as a guide for your own buttons. Create a text file in a text editor like Notepad and then load it using the ZScript>Load button. If your code is OK then ZBrush will create a ZSC file in the same location as your text file. If you put that in the ZStartup\ZPLugs64 folder your buttons will be available each time ZBrush starts.

  5. #5

    Default

    Yep makes sense Only thing left is why the psd files aren't loading with the plugin buttons. The script is working, just don't have the images loading. I have the psd's in the ZStartup/Zplugin so it should be showing up. To no avail though. Instead, the buttons have question marks on them.

  6. #6
    Moderator Follow User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    11,462

    Default

    The question mark means that the script can't find the image file. Either the file name is wrong in the code or the image file isn't in the right place. If your code just has the file name (no folder or path) then the image file needs to be in the same folder as the script.

  7. #7

    Default

    Having the script in the Zscript folder instead of ZStartup/ZPlugs was the issue. Thanks for the help Marcus!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •