Hello,
n00b zscripter at it again! I am working on a bit of script that will automatically close and reload a pre-defined zscript.txt. It saves me a ton of time when iterating on a zscript so that I don’t have to close zbrush, delete the source .zsc file, re-load zbrush and re-load the source .txt file.
I have it working for me. The only issue is that if I try to run the re-loader script from the main menu ZPlugin drop down palate when it isn’t docked to the left or right side of the zbrush interface then I get a weird UI bug where it places the palate for the script that I’m trying to re-load right on top of the main menu ZPlugin palate. If if I try to run the re-loader script from the the Zplugin palate that IS docked to the left or right side of the zbrush interface, then everything executes fine. The defined zscript is closed and re-loaded and there are no issues.
I’ve tried using this “re-load” script to reload several different zscripts and it works on all of them, but the same weird UI palate issue happens on all of them so I don’t think it’s an issue of the zscript that I’m trying to re-load. I think it’s either a weird UI quirk of zbrush itself or something with this below re-loader code.
Here is a video showing the isssue
If anyone has any insight into this, I would love to hear it
Also, feel free to use the below code for your own zscripting projects if you find it helpful. I was planning on giving this away as soon as I sorted out this weird UI issue!
Thanks
Here is my code so far:
[ISubPalette,“Zplugin:E Tools Reloader”]
//creates sub palate in Zplugin palate for Reload Tools
[IButton, “Zplugin:E Tools Reloader:Reload E Tools”,
//creates button for Reload E tools
[IShowActions, 0]
[If, [IExists,Zplugin:E Tools],
//first checks to see if the above palate exists, if it does the next three commands are ran. If not the last two commands are ran.
[IClose,Zplugin:E Tools]
//command that force closes a specific Zplugin:Palate, in this case the “E Tools” palate will be closed with the above command
[FileNameSetNext,“ZBRUSH_\ZStartup\ZPlugs64\ETools. txt”]
//command to load a specific .txt file from ZStartup/Zplugs64 directory inside of zbrush
[IPress,Zscript:Load]
//command to load a zscript file
]
[FileNameSetNext,“ZBRUSH_\ZStartup\ZPlugs64\ETools. txt”]
//command to load a specific .txt file from ZStartup/Zplugs64 directory inside of zbrush
[IPress,Zscript:Load]
//command to load a zscript file
]
//end script