1. #16
    Moderator User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    8,597

    Default

    Quote Originally Posted by Sygnus View Post
    But there's always another question, yes? I was creating the buttons and assigning hotkeys directly from the script, as a parameter... and I found that sometimes the hotkey stops working after the first use. Also tried assigning the hotkey with ISetHotkey, but with the same result. The only way I found to bind the hotkeys for good was to alter the startup hotkeys txt. Am I doing something wrong?
    I've not tested [ISetHotkey] all that much but I have noticed that in more recent versions of ZBrush the hotkey part of the zscript button code does not always work. It seems quite likely that this also affects [ISetHotkey].

    If you're wanting to set hotkeys on the fly then this could be a problem but it wouldn't be too difficult to set up your plugin so that it modifies the StartupHotkeys on first run (so long as you notify the user!).

  2. #17
    Member User Gallery
    Join Date
    Apr 2004
    Posts
    57

    Default

    See? I like the way you think!

    It really wouldn't be hard... and it would be easier still to have it done from the C# server app, as it would also solve the problem of placing the dlls and scripts on the right places. A little 'install' button would do the trick.

    By the way, what is the proper way to have a script loaded at the startup? Create a sub-folder on the zstartup/zplugs did not do the trick. Do I have to create a launcher script and put it on the ZPlugs root folder?

    This may seem like a dumb question after all I went through but... if this is the case, how do I call a script from another?

  3. #18
    Moderator User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    8,597

    Default

    If you create your zscript as a plugin then you put the compiled zscript (the ZSC file) in the ZStartup/ZPlugs folder and your plugin buttons will be available each ZBrush session. All you need to do to create a plugin is to make sure the button paths are the correct form, and that you create the necessary sub-palette (if you need one). So:

    [CODE]
    [ISubPalette,"ZPlugin:My Plugin Menu"] //creates a new menu in the ZPlugin palette

    //a plugin button:

    [IButton,"ZPlugin:My Plugin Menu:My Button","What this button does",
    //do stuff
    ,,.5]// the '.5' is the button width - half a palette-width

    [ISwitch,"ZPlugin:My Plugin Menu:My Switch",0,"What this switch does",
    // on code
    ,
    // off code
    ,,.5]

    [ISlider,"ZPlugin:My Plugin Menu:My Slider",50,1,0,100,"What this slider does",
    //do stuff when value is changed
    ,,1]
    [/CODE]

  4. #19
    Member User Gallery
    Join Date
    Apr 2004
    Posts
    57

    Default

    Quote Originally Posted by marcus_civis View Post
    If you create your zscript as a plugin
    Do I have to do something special to create it as a plugin? What I did was what you described above: created a sub-palete on the ZPlugin menu and created my buttons inside it.

    Quote Originally Posted by marcus_civis View Post
    then you put the compiled zscript (the ZSC file) in the ZStartup/ZPlugs folder and your plugin buttons will be available each ZBrush session. All you need to do to create a plugin is to make sure the button paths are the correct form, and that you create the necessary sub-palette (if you need one).
    I actually managed to get this far... but since I'm using a few dlls, I thought it would be better if the plugin had its own subfolder... and when I moved it there, it did not load at startup anymore.

    So my idea was to create a simple launcher scritp and have it start the one on the subfolder, but I don't know how to call one script from anoter.
    Last edited by Sygnus; 04-25-12 at 11:19 AM.

  5. #20
    Moderator User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    8,597

    Default

    Quote Originally Posted by Sygnus View Post
    So my idea was to create a simple launcher scritp and have it start the one on the subfolder, but I don't know how to call one script from anoter.
    You can do this if you want - you just use this code:
    [CODE]
    [FileNameSetNext,"MyDataFolder/MyZScript.zsc"]
    [IPress,ZScript:Load]
    [/CODE]

    But then the user will only see the button of the launch zscript until they press the button, which is OK but a bit messy. It's surely no more difficult to have your main plugin ZSC in the ZPlugs and just point it to your plugin's data folder when it needs it? That's how all the Pixologic plugins work.

    And no, there's nothing more to do to create a plugin, provided you follow my code example.

  6. #21
    Member User Gallery
    Join Date
    Apr 2004
    Posts
    57

    Default

    Well, you were right (again).

    Took the time to implement most of the changes you suggested (The install button is not there yet, but it will be before the end of the week).

    So I came back to this post just to say thanks once more and to tell you that it worked, and that it would not have got this far (actually, it would not have got anywhere) whithout your help.

    I'll create a new thread on the ZTools forum and see if I can get a few testers, and will sleep a little, for a change.

    Thanks a lot!

    Sygnus

  7. #22
    Moderator User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    8,597

    Default

    Great! And no problem.

  8. #23
    Member User Gallery
    Join Date
    Feb 2007
    Posts
    64

    Default

    Hey this is awsome.
    Some info on how to create the C++ wrapper would be greatly appreciated.

    Also would this work with mono dlls ?

    Would like to try and pull this off on in Xcode (Mac).
    My c++ is not good, but c# is good.
    Last edited by romm; 05-04-12 at 06:53 AM.

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
  •