1. #1
    Senior Member Follow User Gallery
    Join Date
    Jul 2002
    Location
    Copenhagen
    Age
    50
    Posts
    2,561

    Default Question: how to bring up palette through zscripting?

    Hi,

    In 3.1 I was thrilled to see the ability to assign hotkeys to the palette titles, thus allowing a palette pop up at the current cursor position. Very useful stuff in a modeling workflow, especially combined with the new user generated palettes.

    Of course I started thinking about how this could aid zscripting and the way we present them. Simple pop ups of a script's interface is of course useful but what if the hotkey press also had some bearing on the canvas. For example, going back to my XYZadjust zplugin or Digits' Widgets they both use a hotkey to poll the current mouse coordinates for a zsphere and then display in their interface the values for that Zsphere. I thought this would be possible now, but alas we are a tiny step away from zscriptor heaven

    The problem lies in that only a hotkey assigned to a palette can pop up said palette. A hotkey assigned to a script that tries to pop up said palette fails, or rather shows the palette until you move the cursor.

    I have tried assigning two hotkeys, one for the script and one for the palette and letting the script hotkey issue a IKeyPress to activate the palette.

    I have tried a hotkey script that issues an IShow to the palette, an IClick, IPress, [ISet, xxxx, 1] etc. Unfortunately nothing seems to allow the palette to remain visible.

    I am not sure where the problem lies. It could be the keyboard interupt is canceling the palette display. The cursor is to far away from the palette's title. I simply do not know.

    I hope somebody has some fresh ideas or perhaps Pixologic can chime in with a solution. In any case I hope people can see the benefit of this new 3.1 functionality and are interested in expanding it further. There are many cool possibilities, for example, imagine you only ever adjust diffuse, specular and ambient material values. With a hotkey activated pop up script you could poll the cursor position for the material and bring up a an interface with just those three material sliders. With user created menus you could even have the material preview in the pop up window. Of course that would also necessitate a means of constructing user created menus/palettes through zscripting. I cannot quite figure out if that is possible now. Is the IDialog command operational now? So many questions.

    Thank you for reading.
    Last edited by TVeyes; 08-11-07 at 12:41 PM.
    Mark

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

    Default

    Hi Mark,

    I have not been able to find a satisfactory way of calling a palette from a zscript either.
    It seems to me that some of the zscripting mouse click emulation features don't work quite as they used to. I'd like to find a way of putting the palettes in the trays in the same way as the Alt+T type hotkeys worked. A hotkeyed script with (for example) [IClick,29600,5,5] will work if pressed at startup but only the once.

    I did have a way of creating custom menus by zscript which worked quite well in 3.0. (I too would like the ability to create custom menus for my scripts.) The method can be made to work for 3.1 but it's less satisfactory as it needs more user interaction. I've not found a way of bypassing the name dialogs (or for subtools/layers also which is quite a restriction from a scripting point of view.) Neither method was quite as simple as I'd like and I may find another way (I've some ideas yet to try). I'll share the method in some form if I get it to work properly.

    As far as I know IDialog is not enabled.

  3. #3
    Senior Member Follow User Gallery
    Join Date
    Jan 2003
    Location
    NYC
    Posts
    1,626

    Default

    All the IKeyPress command letters simply seem to be broken, at least for those keys I've tried. Major problem in scripting...

    Sven

Posting Permissions

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