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

    Default plugin UI states issue

    Hello Marcus


    I have an issue with startup routine that manage the uistates, mainly the swicths items. yes again


    To help you to understand the problem ,i had create a test plugin so you can see the exact problem i run through.


    The plugin ui have 6 switches button.
    It creates a memblock at the top level using the [memgetsize] like as it s common to do it.

    The main Issue happen when switch from plugin to another, which force zbrush to reexecute the script entirely with the startup Routine.
    The Switch doesn't work correctly, i have to click twice before it get again responsive to my click.


    From what i know we need to delete the memoryblock after we change the button state. but when i have the [MemDelete, p_uiSwitchesState] line uncommented
    when i click on the switch it tell me "The Specified memory block couldn't be found."

    so i always keep it alive, which is no good at all.

    i let you few notes for feedback, so it's easy to see the functioning, but the source for the bug is still invisible for my eyes.

    you can dwl the plugin here :
    UIState_Plugin.zip

    Best Regards
    Nicolas
    Plugins & Toolsets for Zbrush 4R8 : zCycler Pro | Plugin Manager |Matiere 3d | Twitter | @Facelessmindz

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

    Default

    Hi Nicolas,

    1. Your memory test name is missing the "p_" at the beginning, so that block never exists.
    2. You create the memory block from file twice, so when you get the result into "testmem" the block always already exists, so that always fails.
    3. You don't need to delete the memory block.
    4. You don't need to call the "UIStateToFile" routine from within the Startup routine. It's called from each switch which is enough.
    5. You call the "Startup" routine from the end of the script which is the wrong place. It needs to be called before the interface is constructed so that the switch states are set correctly.

    uistate_plugin.txt


    HTH,

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

    Default

    1. yes i notice that, it was a mistake when i had packed
    2. even when i just create the mem from the file, it
    3. yes i understood that during the night test , i must to keep the mem alive so we can access data.
    4. ok my bad ;x
    5. yes but it always tell me the interface could not be found ,even when the startup routine is possitioned before the UI.

    With the script version you had fixed for me, it doesn't work for me.
    It works if I start a new zb session, and if i hot reload the plugin ( from another script )
    like that :

    [If, [IExists, "Zplugin:UIState Plugin" ],
    [IClose, "Zplugin:UIState Plugin"]
    ]

    [FileNameSetNext, "uistate_plugin.txt"]
    [IPress, "ZScript:load"]




    I tested that with Zb to ps cc plugin because the plugins operate the same way with startup and uistate features.

    I gonna pack you another version for you to see stay tuned
    and thank you a lot. Long time i try to fix that one but no success with it.

    That version works if you start Zbrush , not by loading the plugin.
    The problem is that plugin test is a skeleton of what i have and even on the toolset plugin i try to apply that, it still doesn't work, and it bug even on new zb session.

    UIState_Plugin-updated.zip
    Plugins & Toolsets for Zbrush 4R8 : zCycler Pro | Plugin Manager |Matiere 3d | Twitter | @Facelessmindz

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

    Default

    This version also has an error in the memblock naming - the block created using MemCreateFromFile has a different name. So the switches memblock is not created.

    I've no idea why the version I sent should give problems but I suspect you've got a conflict somewhere in your installation. I'd check what you've got in the ZPlugs64 folder. This method is the same as for many Pixologic plugins which generally work without problems. When they do cause problems it's invariably because the user has an old version also installed, or some other conflict.

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

    Default

    This version also has an error in the memblock naming - the block created using MemCreateFromFile has a different name. So the switches memblock is not created.

    yes sorry i did that mistake again when preparing the zscript for you.
    But actually even with that fixed, the script cannot found the switches.



    i cleaned up the Zplug64 directory, removing all plugin which are not official.and deleted the zbrushdata directory and restarted zbrush. nothing is solving the issue i get.
    but know you say that , i tested to remove my own plugins , which are a number of 6, and i can hot reload the uistate plugin now

    i keep you posted about the progress on that , thx you Marcus
    Plugins & Toolsets for Zbrush 4R8 : zCycler Pro | Plugin Manager |Matiere 3d | Twitter | @Facelessmindz

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

    Default

    You might try changing the Startup routine test from:

    [If,[IExists,"Zplugin:UIstate Plugin:Logo"],

    to:

    [If,[IExists,"Zplugin:UIstate Plugin:Switch06"],

    (So that the check is for the last switch of the interface.)

    Alternatively, use a memory block instead:

    [If,[MemGetSize,NK_StartupMem],

    and create the memblock at the very end of the script:

    [If,[MemGetSize,NK_StartupMem],,[MVarDef,NK_StartupMem,1,0]]

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

    Default

    i removed all other plugins, than i was able to understand why kind of conflict generated this issue.

    that line in startup routine
    [If,[IExists,"Zplugin:Matiere:About:Logo"]


    I have several plugins and all have this startup features
    the issue is that one :
    i use this same method :
    [If,[IExists,"Zplugin:zIllustrator:About:Logo"]


    etc..
    And that the source of the conflict
    now i rename all logo button to "Pluginname_Logo" instead, make sure it check a button that has a different name.
    Ffrom that i cleaned up a lot of stuff and follow a strict naming for my Memblock variables


    I had been able to fix 5 of 6 plugins already, it runs smoothly now, thank you a lot again for your precious help.
    Plugins & Toolsets for Zbrush 4R8 : zCycler Pro | Plugin Manager |Matiere 3d | Twitter | @Facelessmindz

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

    Default

    Glad you have solved the problem and that's useful information, thanks for posting!

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

    Default

    yeah that's interesting, do you think it's a bug, that IExists check the wrong button path ?
    If you can report that to the dev team ?
    Plugins & Toolsets for Zbrush 4R8 : zCycler Pro | Plugin Manager |Matiere 3d | Twitter | @Facelessmindz

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

    Default

    Quote Originally Posted by f☺celess
    yeah that's interesting, do you think it's a bug, that IExists check the wrong button path ?
    If you can report that to the dev team ?
    I've noticed before that it's not always necessary to use the exact path to things. This doesn't only apply to zscripted items. In that respect, it is a bug. But there may be very good technical reasons for having it that way. I'll look into it, and let the developers know if I find anything useful.

Posting Permissions

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