1. #1
    Senior Member Follow User Gallery
    Join Date
    Feb 2015
    Location
    Paris
    Posts
    263

    Default few basic questions

    hi guys, i am back with some questions

    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
    Nicolas

  2. #2
    Senior Member Follow User Gallery
    Join Date
    Feb 2015
    Location
    Paris
    Posts
    263

    Default

    Answering to myself
    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
    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
    just get the selected Subtool than emulate the click on the Eye
    [IModSet,Tool:SubTool:SUBTOOL-NAME,25]

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

    Default

    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.

    2. 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"]
    ]


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

    HTH,

  4. #4
    Senior Member Follow User Gallery
    Join Date
    Feb 2015
    Location
    Paris
    Posts
    263

    Default

    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

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

    3. great news

    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 ?

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

    Default

    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.

  6. #6
    Senior Member Follow User Gallery
    Join Date
    Feb 2015
    Location
    Paris
    Posts
    263

    Default

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

    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

    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

    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.

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

    Default

    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,

  8. #8
    Senior Member Follow User Gallery
    Join Date
    Feb 2015
    Location
    Paris
    Posts
    263

    Default

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

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

    Default

    You're welcome!

  10. #10
    Senior Member Follow User Gallery
    Join Date
    Feb 2015
    Location
    Paris
    Posts
    263

    Default

    Marcus as i can't to thank you enough , I will send you my plugin for free when everything will be done

    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 &quot; or #x32 doesn't works at all :/

  11. #11
    Senior Member Follow User Gallery
    Join Date
    Feb 2015
    Location
    Paris
    Posts
    263

    Default

    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]]

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

    Default

    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!

  13. #13
    Senior Member Follow User Gallery
    Join Date
    Feb 2015
    Location
    Paris
    Posts
    263

    Default

    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
    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 :

    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

    7000 lines of code currently

  14. #14
    Senior Member Follow User Gallery
    Join Date
    Feb 2015
    Location
    Paris
    Posts
    263

    Default

    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

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

    Default

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

Page 1 of 5 1234 ... LastLast

Posting Permissions

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