ZBrushCentral

few basic questions

hi guys, i am back with some questions :wink:

question 1 :

How to unhide all subtool at once ( like when you click on the current subtool eye icon, it remove all the visibility settings for all Subtool.
how to repeat this during a script process ?

I bake the bpr render, depending of selected /visible /all , for Selected i found a nice workaround with [IPress, Trasnform:solo]
i can still turn the visibility on for each subtool in a loop, but there is no different way ?

my second Question :

the Script changes the materials, but it doens’t found all my custom materials, in fact it found one but not the other.

code :
//We prepare the mesh and material for the render
// select the proper material
[VarSet , matType, “red_NormalRGBMat”]
[IPress, [StrMerge, “Material:”, matType]] <— it doesn’t works

same here from the same routine works :
//We prepare the mesh and material for the render
// select the proper material
[VarSet , matType, “red_CavityMat_v2”]
[IPress, [StrMerge, “Material:”, matType]] <— it works

What’s going wrong here ?

  • red_normalrgb mat is in zbrush >startup >materials, but also into zbrush>data> material but has no effect.
  • red_cavitymat_v2 is into ZStartup/Materials only, no where else, but it works.

oh a last question,
Is it possible to use the ZUtilLib to sell a plugin ?

will be happy to have some feedback on that :slight_smile:
Nicolas

Answering to myself :slight_smile:
About the third question i guess it’s ok bebause Zscenemanager /Sketchfab use the ZFileUtils Lib.

For 2. still doesn’t understand why it refuses to load my material :frowning:
Is that possible the material is a matcap and not a normal material. the second material that loads properly is a normal material, but if i try with a matcap from the startup matcap materials like Framer01, it works.

For 1 . i don’t need that right now, but recording a little macro show me the way :slight_smile:
just get the selected Subtool than emulate the click on the Eye
[IModSet,Tool:SubTool:SUBTOOL-NAME,25]
:slight_smile:

  1. For toggling all subtools on/off you can use:

[VarSet,activeSubT,[SubToolGetActiveIndex]]
[VarSet,subToolPath,“Tool:Subtool 0”]
[VarSet,scrollPos,[SubToolGetCount]-(activeSubT+1)]
[ISet,Tool:SubTool:SubTool ScrollBar,0,scrollPos]
[IKeyPress,256,[IClick,#subToolPath]]

What the code does is position the scrollbar so that the active subtool is at the top of the list (so it becomes “Sub Tool 0”) and then simulates a SHIFT+click on the subtool - [IKeyPress, 256] is the SHIFT.

  1. On you material problem it’s difficult to say what could be going wrong but you could include a test:

[VarSet , matType, “red_NormalRGBMat”]
[If,[IExists,matType],
[IPress, [StrMerge, “Material:”, matType]]
,//else
[Note,“Material not found”]
]

  1. For ZFileUtils, there are no restrictions on use (or warranty either!).

HTH,

hello Marcus, thank you a lot, i really appreciated your help, really !

  1. to toggle on/off all subtools the code you gave me worked, i just had to duplicated the last line of your code.
    But it does the job :slight_smile:

  2. Yes the material isn’t founded, and still refuse to load, will investigate this one

  3. great news :wink:

Another problem :

I run into another problem, this issue persist from the beginning of the development, let me explain
when i startup Zbrush and then click for the first time on any button from my plugin UI, all button become unavailable .
I must to reload the plugin from a script command and then after the second launch it never happen again.
I have no idea what could be the source of this issue, Do you have any idea, Marcus ?

With the material problem, another thing you could do is copy the material to a suitable location (such as your plugin data folder) and then load it using the Material>Load button. It will replace the selected material so you need to select a material you don’t need first. You can then use:

[VarSet, matSelected, [IGet, Material:Item Info]] // store the current material

and

[ISet, Material:Item Info, matSelected] // reset material

to store and reselect the material once it’s been loaded.

For your new question, if it is switches [ISwitch] that are being disabled then you need to put this line of code for each switch at the end of your zscript:

[IEnable, “Zplugin:My Subpalette:My Switch”]

If it is buttons [IButton] that are becoming disabled then I’m not sure what’s going on. Check that you’ve not coded something in the enabled/disabled slot.

Hi marcus,so good that you are there to help, the hint with [IEnable] worked well :wink:

For material loading i found the way to handle all the loading of materials from the plugin
i must to be sure that material exists and if not i must to load them.
it works well , just that my code don’t save the current material before to render of materials file.
as i have a code that get environment setting like current tool, current alpha, current texture, “current material”, draw size, z/RGB intensity etc

when the baking is over, it restores the settings, but can’t to found the material that was the one selected before to run the baking process. I can’t to predict it :slight_smile:

I have no workaround, load replace the current material and i can’t to prevent which material will be active when any user would use my plugin.
So i can still save it and then reload it, but i don’t want to collect too much material in my plugin data.

If there is one material that no one ever use, which one would it be ? i would like to select that material before to load my own material.

I Have a last question for you :wink:

I had to be sure that flat color, framer1, flatsketch01 are loaded into the Zproject.
so i made some copy of the material in my plugin data. This help if i load a official content Zproject, if i immediatly run a baking
it load every material without the user to know we load them.
but if i want to sell my plugin do i have to remove those material from the plugin data ? that could lead me into trouble.
if flatcolor is removed nothing is working well.

I’ve given you the code above for storing the current material and then restoring it later. So long as you don’t overwrite the current material it won’t disappear. The Item Info slider is the slider at the top of the Material palette.

I’d select the Fibers1 or QuadShaders material, I doubt if people would use those. Many of the Standard Materials would be OK, I think. You could warn your users that you will do this if it worries you.

I don’t think there’s a problem including the materials with your plugin. After all, they are included with ZBrush anyway and you are simply ensuring they are present for the correct operation of your plugin.

HTH,

love you dude, everything is working well, i would like to thank you for the help you bring me :wink:

You’re welcome! :wink:

Marcus as i can’t to thank you enough , I will send you my plugin for free when everything will be done
:wink:
Im working on the activation currently, and i might need you to shed me again with your lights, i am looking for a way to build a string vars that contain a long script.

curl https://api.gumroad.com/v2/licenses/verify -i -o “check.zlic” -d product_permalink=“XXXX” -d license_key=“XXXX-XXXXX-XXXXX-XXXX” -X POST

i just need to split this script into Three parts, but i need to keep the double quotation, and the backslashes doesn’t escape the double quotation, is there any other way i can keep my double quotation safe ? ascii charset like " or #x32 doesn’t works at all :confused:

hey i finally found the way to write double quotes and back line:
double quotes :
[VarDef, quote, [StrFromAsc, 34]]
same with line feed :
[VarDef, backtoline, [StrFromAsc, 10]]

1 Like

Yes, you’ve got it! Though for a new line it’s best to put [StrFromAsc,13] in as well. This makes sure both MacOSX and Windows preferred method are taken care of:

[VarDef,gNewLine,[StrMerge,[StrFromAsc,13],[StrFromAsc,10]]]

And thanks for the offer on your plugin - I shall look forward to trying it!

ok so for mac you must to be sure CR (carriage return) + LF (line feed) are applied, i thought the carriage return were used only at the end of paragraph on mac, i might have mist understood thx again :slight_smile:
i could have something interesting to show you , you knowledge on Zbrush could maybe help me to make more than what i can do using my plugin.

let me just show you the Plugin Ui so you could understand what i had worked with :
quicksketchmaster-v0.9f.jpg
it a little bit rough now cause i putted some buttons for my tests and some should be simply removed for the 1.0 release.
create batch, run batch and read respond should become Activation button.
i made some material you can found for free here that i use in my render passes batch.
https://gumroad.com/facelessmind
a world normal map material and an enhanced tangent normal map.

My challenge as to make some pbr texture using Zbrush only, but it a little bit limited.
First i had to make this Rendering passes system to handle classic texturing workflow, capturing matcap and more.
make it also interesting for illustrator that want to quickly use Zbrush and a psd editor to make and mount all the rendered passes.

After this had been done, i had been in capacity to test out a workflow to make albedo, gloss /rough , specular, metallic.
unfortunately the only way i found is to use the quad shader
first channel store the albedo rgb value ( so i need to create preset material that match the chart and ofr UE4 and for Unity)
second channel store the gloss/rough it just a grayscale value
third is specular
and the fourth is the metallic.

the only way to bake this four maps, are to switch from SH1 to SH2 for all the used materials. and then bake, and again disable SH2 and enable SH3, then bake.
For all this the polypaint must to be disable or it will appears on each albedo/gloss/spec/metal.
it prevent me from create some variation on the albedo etc, i would love to have a texture sampler that repate along the canvas and then i can change depeing of the channel is am displaying and i m going to bake.

That would not be awesome to have PBR texturing ready in Zbrush and that can beat quixel /substance designer or that can be use as combo to give more option for the texturing workflow. This is what i am trying to achieve :slight_smile:

7000 lines of code currently :slight_smile:

i must to say about the name of the plugin that at first time my project of plugin was to make a BPR to Quicksketch system
and it work well, you can use the selector and then load the map you have rendered onto a classic QS mesh.

BPR to QS is more like you want a snapshot of you wieport, and then whant to immediately paint on it .

If you ever have any good plugin name for such of piece of software, after a month of development i stil lhaven’t found one that sound good at my ears :slight_smile:

Wow! That’s impressive. I’m not surprised that’s 7000 lines of code. As for plugin names - they are difficult!

HEy marcus, sorry for not being more active here,the plugin is progressing slowly, but it progress surely :slight_smile:

At some point , but idk when yet, that would have more sense to share my work on the Zbrush central even if the plugin is not yet ready for download/ purchase
Do you think if i can start to share something onto a dedicated post into the ZSCRIPTs Utility forum ?

i’d posted on polycount “tech art what are you working on” topic, i join the last progresses i made, with a short description

so i will simply copy it there :slight_smile:

NOte : The plugin is not ready for beta tester / public , as i aded a system to handle license key and registration using the licensing system and the GumRoad Api to activate the lisencing.
make it hard to share a license key when the plugin is still a Draft on my gumroad shop.

UI-version-09j.jpg

Sorry for the lack of information i still work on the UI of the plugin and that not easy to create tutorials and the documentation at same time, but i will try to resume quickly :slight_smile:

The objective are multiple with quicksketch master plugin, ( if anyone have a better name you can suggest me )

Illustrator/Rendering Usage:
The plugin has PSD Editor bridge and a Render Passes Batch system that renders and save all the requested maps so you can open them in photoshop and rebuilt the all the passes to get a similar rendering then when you render in material shaded mode.
The problem is that Zbrush can’t to export a layered psd file, so you have to do that manually within the psd Editor
oh it’s even better when the PSD editor supports the hot reload.

Sketch and concept art,
There is a tool that acts like the originally Quicksketch function made by pixologic,
but it renders the selected maps using BPR,save as a psd file, then reload the file as a texture, to apply the render onto a plane3d mesh texture maps slot
and turns the texture into polypaint data. So you can instantly start to sketch/draw on it.

It can be useful, when you make some silhouetting /concepting sketch into Zbrush, example : if you use move tool on the plane3D mesh
there is a distortion that can be removed by using BPR 2 Quicksketch feature.
There is also the classic Quicksketch option so everything is at the same place within Zbrush UI.

You can even transform a texture into a paintable quicksketch mesh. You just import a texture, make it be the current texture selected, then push “texture to quicksketch”
and it acts similarily to bpr 2 quicksketch, so you can paint on it

Note : at this moment , an option is missing , the one that reload the depth data into the displacement slot of the plane3D mesh instead of the BPR shaded render in texture maps slot.
, but i will add that soon before i release 1.0 version of the plugin.

That say, the main reason and objective with the development of that plugin was to create PBR textures using Zbrush, unfortunately, Zbrush shader system is restricted, so I made some workflow preset so you can work with many other software, substance designer/painter, quixel suite, using matID maps with the rendering batch.
I m working on a save plugin preference to File, so you can load custom settings and make you own.

Workflow-presets-help.jpg

I added some tools that help to create RGB mask for using with UE4 material editor, so you can have different shaders blended on the same UV set.
Lately i could develop a material library for ue4 or even use the starter pack material at first time, so i could recreate the setup just by pushing a button
and reading a config file that will be created from Zbrush.

Note that PBR shaders in Zbrush are preset materials already calibrated for UE4 and that respect the pbr charts.

shaders are simple quadshaders, you can load from lighbox, ( it a full mess, into the Zb material picker to handle all this pbr presets so i prefer to use lightbox. )

Albedo, gloss or rough, specular, metallic are store within the SH1, SH2 sh3 sh4 properties, just that pbr are very flat at export, because the quadshaders do not support texture input.

There is a switcher in pbr Workflow subpalette, it checks every materials used in the zproject, and switch to SH1 channel, disable all the SH2,3 and, 4 than bake the maps,
after that it disable SH1, enable SH2 and render again, and so on.

Now that everything is working as expected, i am working on tools that will support the use of nanotile mesh to create tiled textures.
When i would have achieve this part of the plugin, it will mean that Zbrush will have a full NONE DESTRUCTIVE Workflow, to create Tiled Textures maps.

I planned for the 1.1 version, after the release 1.0,
to add models support, so you could export from Zbrush your scene and subtools models and then Bake the maps you need using Substance BatchTools.

Voila !

Hey i will post a new reply cause I run in trouble with the save preference plugin to file function :confused: (more detail in the next post)

Nicolas Kirsch

Hi Nicolas,

This is really taking shape! As far as sharing information is concerned, I think it would be better to post in the ZScript Utilities forum when you have something ready for release. You might consider releasing a beta version for users to test, or a version 1 that only has those features you are happy with. That way I think you’ll get better feedback.

HTH,

thank you for the suggestion Marcus will probably do that :wink:

some progress :

illustration Workflow :
i added some more options for this workflow

  • shadows
  • floor

I just had published a tutorial that show up how to work with the render passes baker in Quicksketch Master plugin and a PSD editor ( photoshop in that case)

https://www.youtube.com/watch?v=I8WSi1xMcaQ

I try to give function that could be handful for different kind of work , i just been focused on that kind of work to be sure every one will be happy :wink:

Nicolas

still very slow progress,
quicksketch master roadmap on trello :
https://trello.com/b/yvOdA3Qz/
I would like to have place where i can write down some idea that I can’t focus now for the 1.0.

so any people could see what features are expected to added into the next builds (1.1, 1.2, etc).
But for now, I am in lack of motivation, it hard i try to get some feed back but it likes i’m invisible :stuck_out_tongue:

I get stuck at the save preference plugin to file, but i don’t know why Zbrush does not count like me, making it harder to wrote something that is bitwised in a memory file.
Some character are missing, so it break the the back to line ( CR /LF )

I should share with you my trouble maybe it could give me some more motivations after passing that milestone.

Ok let me explain :

i create some vars :
[VarDef, s_material, “”]
[VarDef, s_preview, “”]

when the save to file function is executed i set this vars to

[VarSet, s_material, “material:true”]
[VarSet, s_material, [StrMerge, s_material, backline]]

backline :

[VarDef, backline, [StrMerge, [StrFromAsc, 13],[StrFromAsc, 10]]]

so it check my UI to get the status of them like
if material switch is on or off, and then
set the s_material var to material:true if true, and then material:false , if the switch is off,
I merge the vars with with another one so i can add the back line.

(I got a lot more vars, i just use the two first one to illustrate the issue )

so now i have this code to create the function that write the file on the disk

[VarDef, bytes, 0]
[RoutineDef, SaveSettingsToFile,

[MemCreate, Settings_Filename, 332, 0]

hmm, 332 matchs the maximum of characters that should be written. note to get this number is just write the file myself and notepad++ gave me the full length including the CR/LF.

[VarDef, bytesCounter, 0]

this is the vars that will store the offset, not necessary for the very first vars to write into the file.

[If, ([IGet, ZPlugin:QuickSketch Master:Render Options:Material] = 1) ,//group command [VarSet, s_material, "material:true"] [VarSet, s_material, [StrMerge, s_material, backline]] //we count the bytes need to write the data [VarSet, bytes, [StrLength, s_material] ] //give 15 //add 15 to bytes counter [VarSet, bytesCounter, [Val, bytes]] //add 15 to bytes counter [MemWriteString, Settings_Filename, s_material, 0,0] ,//else [VarSet, s_material, "material:false"] [VarSet, s_material, [StrMerge, s_material, backline]] [VarSet, bytes, [StrLength, s_material]] [VarSet, bytesCounter, [Val, bytes]] [MemWriteString, Settings_Filename, s_material, 0,0] ]

Next Option to check the status :

[If, ([IGet, ZPlugin:QuickSketch Master:Render Options:Preview] = 1) ,//group command [VarSet, s_preview, "preview:true"] [VarSet, s_preview, [StrMerge, s_preview, backline]] [VarSet, bytes, 0] [VarSet, bytes, [StrLength, s_preview]] [VarSet, bytesCounter, [Val,( bytesCounter + bytes ) ]] [MemWriteString, Settings_Filename, s_preview, bytesCounter] ,//else [VarSet, s_preview, "preview:false"] [VarSet, s_preview, [StrMerge, s_preview, backline]] [VarSet, bytes, 0] [VarSet, bytes, [StrLength, s_preview]] [VarSet, bytesCounter, [Val,( bytesCounter + bytes ) ]] [MemWriteString, Settings_Filename, s_preview, bytesCounter] ]

Now the end of the my function :

[MemSaveToFile, Settings_Filename, "QuickSketchMasterData\data\preferences.zvr",1] //1 overwrite [MemDelete, Settings_Filename] // this is really necessary ?

]

and then how it looks into notepad++ with all symbols visible

http://i.imgur.com/YwuyVyt.png

you can see the LF is missing at the first line.

adding note, to get the vars size, and the current value if the bytecounter, give me correct math.
but with more vars to write into that file, it gives me a lot of odd result an issue which i have no idea how to make it count correctly :confused:

here is how the file looks with more vars to export:
http://i.imgur.com/uaQTUxh.png

have no idea why it all the mess like that, if you have any idea you are welcome man :slight_smile:

Nicolas

Hi Nicolas,

You’re making things difficult for yourself. If you are using [MemWriteString] to write a string to a memory block then the command returns the number of bytes written, so you can easily keep track. Also, you can create a memory block larger than needed and then use [MemResize] to make sure you don’t have garbage at the end of the file. See this example of how to write and read strings to and from a file:

Also, you can use [VarSave] and [VarLoad] to save and load a list variable to and from disk. This is really the easiest way to save settings if you need them as strings. (You can store numbers too, if you wish.) See this example of how to do it:

HTH,