1. #1
    New Member Follow User Gallery
    Join Date
    May 2009
    Posts
    11

    Question String variable don't update

    I try to get tool's current file path by [IGetTitle] and put it in string but it works only at first time.

    Here is code:
    [CODE][IButton, "ZPlugin:mScripts2:ToolInfoTest","display tool infos",
    [VarDef,tPath,"0"]
    [VarSet,tPath,[IGetTitle,"Tool:Current Tool"]]
    [VarDef,tNote,[StrMerge,"Tool path is:\n",tPath]]
    [Note,tNote,,0]][/CODE]

    When I select specific tool and click this button it update variable and I get proper message. But when I select another tool and press my button it dont update variable and it display old note, path of first selected tool.
    What i'm doing wrong and what is best method to get selected tool's file path?

  2. #2
    Moderator Follow User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    8,673

    Default

    You're trying to set the variable tNote but are declaring it using VarDef. That's good for the first value but won't update unless you reload the zscript. Change it to VarSet and it should work fine.

    In general it is best to declare variables at the start of the zscript and outside buttons etc. (so that they are global variables). Local variables should be confined to routines.

  3. #3
    New Member Follow User Gallery
    Join Date
    May 2009
    Posts
    11

    Default

    Oh I see it now, I updated first variable but not tNote. It works now.
    Thanks Marcus!

    Next question.
    I'm doing something like batch render and I want gather all rendered images in new folder created automatically by zbrush. I found this but links to dlls are dead. This metod is still in use? How can I get those dlls?
    Last edited by Poniu; 06-07-12 at 11:26 AM.

  4. #4
    Moderator Follow User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    8,673

    Default

    I've limited web access at the moment but will try to provide an updated version this week.

Tags for this Thread

Posting Permissions

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