1. #1
    Member Follow User Gallery
    Join Date
    Dec 2004
    Location
    Ypsilanti, MI
    Age
    46
    Posts
    79

    Default Few Potential Bugs - Strings and SubTools

    Hello,
    I'm working on a script that tries to automate several processes and provide the user with a minimalist interface.

    1) I have a globally defined variable called "unique_name" that holds the users login info (psuedo login implemented). I store the information with:

    [VarSet,unique_name,[StrAsk,"<subject ID>","Please enter subject ID"]]

    However, when I set the variable at logout with: [VarSet,unique_name,"undefined"] it doesn't change what's in the string. Both the login/logout are triggered by separate buttons.

    2) I'm trying to get my model to load in a particular state with the proper SubTool activated. However, calling: [IPress,Tool:SubTool:Sub1] doesn't always work. Sometimes it selects Sub1, sometimes it goes to Sub2. I tried saving the tool in a state I want it to be when loaded, but it doesn't seem to honor the changes made to the SubTools and their visibility.

    3) similar to the above, when hiding/showing a SubTool the numbers seem to change. For example, I turn off Sub2 and get: [IModSet,Tool:SubTool:Sub2,3] from the recorder. I unhide the subtool and get: [IModSet,Tool:SubTool:Sub2,10]. Finally, I hide it again and get: [IModSet,Tool:SubTool:Sub2,2]. For this, I'm just trying to find a way that I can hide/unhide subtools on the fly.

    4) is there a way in which I can prevent the standard ZBrush commands from wiping out my NoteBar? I want to add a message that stays in the NoteBar (or anywhere) and change only when I tell it to. I want to avoid doing the "script reload" trick since I have a lot of variables/buttons/etc.

    Any ideas or possible workarounds I could use to get around these. I haven't tried memory blocks for the strings yet, but any other tips would be greatly appreciated.

    Thanks

    E.

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

    Default

    Hello E,

    1)
    I can't see what the problem is here. I tested the code that you give and it returned the expected results:
    [CODE][VarDef,unique_name,""]

    [IButton,Login,,
    [VarSet,unique_name,[StrAsk,"<subject ID>","Please enter subject ID"]]
    [Note,#unique_name]
    ]

    [IButton,Logout,,
    [VarSet,unique_name,"undefined"]
    [Note,#unique_name]
    ][/CODE]

    2)SubTools are difficult. The simplest way to navigate them is by using IPress to press the SelectUp or SelectDown buttons. You can test to see if these are enabled using [IsEnabled and if they're not you've reached the top or bottom of the list.

    3) What mods you get from a subtool depends on where on the subtool strip you click - there are some unused things there that vary the result. But anything <=7 is invisible, >7 visible. Having established what state the subtool is in, you can use [IClick, to reverse it.

    4) NoteBar messages are wiped whenever a new message is loaded or the NoteBar is cleared. Messages only stay for a few seconds anyway. Using IFreeze can sometimes hide them altogether.

    If you're using the Tutorial Window then you can use a Caption but you will need to reload the zscript to update it. The only other possibility is to use a Note. You can have that appear for a specified time but it will interrupt your script for the duration.

    HTH,

  3. #3
    Member Follow User Gallery
    Join Date
    Dec 2004
    Location
    Ypsilanti, MI
    Age
    46
    Posts
    79

    Default

    Thanks again for your help, Marcus. Definitely appreciated.

    1) The string issue seemed to have been related to scope. I created a temp string variable right before printing out my Note that contained the full note message. defining this globally or putting the StrMerge inside the note seemed to have fixed the problem.

    2) Great idea regarding the SubTools. A simple loop fixed that.

    3) IClick helps. Thanks

    4) That's unfortunate. Do you think this is something that might be changed in future releases? (changing buttons, full progress bar control, etc.)

    Thanks again for your help. It will ensure this gets done on time. Cheers!

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

    Default

    I'm glad you found the stuff useful.

    1) Sometimes using [Var,myVariable] instead of simply putting the variable name helps. If you are using a Loop variable in a StrMerge it is pretty much essential to use [Val,n] (where n is the loop variable):
    [CODE]
    Loop,8,
    [VarSet,subtoolPath,[StrMerge,"Tool:Sub Tool ",[Val,n]]]
    ,n][/CODE]

    4) I've no knowledge of what is planned for future releases. Depending on what you are trying to do you may be able to keep a NoteBar message showing by repeatedly calling it. You can get a progress bar with the NoteBar like this:
    [CODE]
    [Loop,loopCount,
    [NoteBar,"Operation in progress... please wait...",n/loopCount]
    //commands
    ,n][/CODE]

  5. #5
    Member Follow User Gallery
    Join Date
    Dec 2004
    Location
    Ypsilanti, MI
    Age
    46
    Posts
    79

    Default

    Hmmm...ok. On another project I'll mess with reloading the script to get the desired user feedback. Thanks again.

Posting Permissions

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