1. #16
    Senior Member Follow User Gallery
    Join Date
    Aug 2003
    Posts
    281

    Question Thank you very much

    Hey, Marcus
    Thank you very much for your reply.


    On the first question, I actually want to use the code in the software to calculate the internal image, but I do not want to change the current model file, now I hope that use the code will inevitably change the model state, such as the material has been applied to the model, but I can now use another method to restore the texture and material effects on the model.


    On the second question, I applied this script, ZBrush can not start, there should be a script error.

    PS:This is my teaching video page.

    https://www.youtube.com/channel/UCEp...kTgzquPC5WAPSA
    Last edited by tdrs; 11-29-16 at 01:48 AM. Reason: fix

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

    Default

    Quote Originally Posted by tdrs
    On the second question, I applied this script, ZBrush can not start, there should be a script error.
    I'm sorry, that was just a code snippet. It needs to go inside a button like this:

    [IButton,???,"Change background image",
    [IShowActions,0]
    [IConfig,4.73]

    [VarSet,txtrFile,"ZBRUSH_ZTextures\Panoramas\pixologic_bourran1 .jpg "]//path to file you want to load
    [VarSet,txtrName,[FileNameExtract,[FileNameResolvePath,txtrFile],2]]//gets the name of the file only
    [If,[FileExists,txtrFile],
    [FileNameSetNext,txtrFile]
    [IPress,Texture:Import]
    [IPress,Light:Background:Texture]
    [IPress,[StrMerge,"PopUp:",txtrName]]
    ]

    ]//end of button



    Thanks for posting the videos!

  3. #18
    Senior Member Follow User Gallery
    Join Date
    Aug 2003
    Posts
    281

    Question

    Hey, Marcus
    I copied this piece of code as a macro, click on it without any changes,

    Here is one of my previous macro scripts,How should I add your new code to this script?

    //ZBRUSH MACRO - Recorded in ZBrush version 4.73
    [IButton,???,"lightcap setup 02",
    [IShowActions,0]
    [IConfig,4.73]
    [FileNameSetNext,"ZBRUSH_\ZTextures\Panoramas\pixologic_bourran1.jp g"][IPress,Texture:Import]
    [FileNameSetNext,"ZBRUSH_ZLightCaps\LightCap02.ZLD"]
    [IPress,Light:LightCap:Open]
    [ISet,Render:BPR RenderPass:SPix,0]
    [ISet,Render:Render Properties: Details,1]
    [IUnPress,Render:Render Properties:Shadows]
    ,,0.2]

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

    Default

    Sorry about that. The ZBC BB Code is inserting a space in the file name where there shouldn't be one. Try the attached file instead.

    AddTxtr.txt

    And here is your macro with the code inserted:

    LightCap02.txt

  5. #20
    Senior Member Follow User Gallery
    Join Date
    Aug 2003
    Posts
    281

    Question

    Now I have a total of eight buttons, click on each button will load an image.


    I am following your code to modify these scripts.


    But I found that as long as the texture map thumbnail(Light》background) loaded an image, click the other button, the thumbnail can not switch to other images...

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

    Default

    Quote Originally Posted by tdrs
    But I found that as long as the texture map thumbnail(Light》background) loaded an image, click the other button, the thumbnail can not switch to other images...
    Hmm. I've done some tests and it looks as though this is one of those problems that happen with zscript sometimes. I've tried various things without success - sometimes turning the model black, sometimes crashing ZBrush!

    I'll continue to try and find what's wrong but so far I don't have a solution...

  7. #22
    Senior Member Follow User Gallery
    Join Date
    Aug 2003
    Posts
    281

    Cool

    OK,I know.
    Thank you very much for your help.

  8. #23
    Senior Member Follow User Gallery
    Join Date
    Aug 2003
    Posts
    281

    Default ask

    Hi,marcus

    I'm converting my macro script into a plugin, but I'll just add the button code now.
    I would like to ask, how to add the ZBrush icon, slider and switch to the plug-in, can you give me some code demonstration?

    The red area is what I don't understand,


    In addition, there are several scripts are more complex, I do not know how to modify.
    Such as ID and 4_Color 3_Object Pass2.


    Thanks very much!

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

    Default

    I've attached a simple plugin that has a slider and a switch.



    My_Plugin.txt

    This is basically all you can do in zscript. A button can have height as well as width specified, and it can have an image (such as the 3D Print Hub plugin has). But the switch and the slider can only have width.

    So much of what you highlight in red can't be done in zscript.

    For the scripts that are too complex for you, I'm not sure what the problem is. Can you post the code?

  10. #25
    Senior Member Follow User Gallery
    Join Date
    Aug 2003
    Posts
    281

    Default

    Hi, Marcus
    For the switch, slider code, I also know.
    I also looked at the command list.


    I just don't know how to change the functionality of the software into a plugin option,
    For example Render:Render Propertiesetails slider


    Now I want to convert the customize palette options into plugin options.

    The script
    https://www.dropbox.com/s/n851jmgm8yjf8s9/QRender.txt?dl=0



    3_Object ID, 3_Restore and 4_Color Pass2
    The contents of these three parts are similar, and now I can't make them work properly in the plugin.



    Thank you very much for your help.

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

    Default

    You'd need to create a slider (or a switch or button, depending on what you were adapting) and then set the ZBrush item from it like this:

    [ISubPalette,"Zplugin:BPR Render"]

    [ISlider,"Zplugin:BPR Render: Details",3,1,1,4
    ,"Best Preview Render maps detail level"
    ,[ISet,"Render:Render Properties:Details",[IGet,0]]
    ,0
    ,1]


    In this code the [IGet,0] means "get the value of this interface item" so that line of code sets the Render:Render Properties:Details slider to whatever the plugin slider is set to.

    However, note that the plugin slider will not update if you adjust the Render:Render Properties:Details slider. There's no way for a plugin to monitor the ZBrush interface. And as I said, things like the light position widget can't be duplicated in a plugin. If you want others to use your plugin then you may find it simpler giving them a custom interface configuration file along with the plugin.

    For the 3_Object ID, 3_Restore and 4_Color Pass2, these all use a routine called "DoIt" and you have three routines in your plugin with that name. That means there's no way for ZBrush to know which routine should be called. Renaming them so there aren't duplicates should fix the problem:

    QRender_rev.txt

    HTH,

  12. #27
    Senior Member Follow User Gallery
    Join Date
    Aug 2003
    Posts
    281

    Default

    ok,i see

    Thank you very much for your help.

  13. #28

    Default

    According to your script, I can load light preset, which is to replace the current set of lights, but I hope that lights on / off, because I close other lights, only to open a light, I will only adjust the light effect, then open the other lights.

  14. #29
    Senior Member Follow User Gallery
    Join Date
    Aug 2003
    Posts
    281

    Default

    Upgrade to R8, and I fixed some script changes.
    I found a problem.
    when I used the light switching function,Performs scene rendering while switching lights, but there is no such content in the script,
    So I would like to ask what is the reason for this?

    light.zip

    Thank you very much!

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

    Default

    I'm not getting that. It will do that if you have Best render selected in the Render palette - that's normal behaviour - but I don't get it for Preview or BPR.

Page 2 of 2 FirstFirst 12

Posting Permissions

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