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

    Default

    I built on Sven's Crop Box code above for my Crop Tool plugin. There are a couple of things that may interest others so I am posting the code here.
    Attached Files Attached Files

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

    Default Subroutine to save and restore status of most ZBrush settings

    Whenever a plugin takes over the ZBrush environment, the script or the user will probably change some of the slider settings, and possibly the current alpha, texture, stroke or material. This routine can be called at the start of the plugin script to save and at the end of the plugin script to restore ZBrush settings to their original state.


    [CODE]// -------------------------------------------------------------------------------
    // SUBROUTINE TO SAVE AND RETRIEVE THE STATE OF ZBRUSH
    // -------------------------------------------------------------------------------

    // At the time a plugin is called, the status of the various
    // ZBrush buttons need to be stored so that when the plugin is
    // exited they may be restored to their original status

    // example call: [RoutineCall, State, ZState]where ZState is 0 to save state and 1 to restore state

    [RoutineDef,State,
    [If, ZStateFlag = 0,
    // flag zero means save status of following items
    [VarSet, TMat, [IGet,MATERIAL:ItemInfo ] ]
    [VarSet, TObj, [IGet,TOOL:ItemInfo ] ]
    [VarSet, TTex, [IGet,TEXTURE:ItemInfo ] ]
    [VarSet, TMrgb, [IGet,DRAW:Mrgb ] ]
    [VarSet, TRgb, [IGet,DRAW:Rgb ] ]
    [VarSet, Tm, [IGet,DRAW:M ] ]
    [VarSet, TZadd, [IGet,DRAW:Zadd ] ]
    [VarSet, TAlp, [IGet,ALPHA:ItemInfo ] ]
    [VarSet, TStk, [IGet,STROKE:ItemInfo ] ]
    [VarSet, Tdsize, [IGet,DRAWrawSize ] ]
    [VarSet, TZint, [IGet,DRAW:ZIntensity ] ]
    [VarSet, TRGBint, [IGet, DRAW:RGBIntensity ] ]
    [VarSet, TFshift, [IGet, DRAW:FocalShift ] ]
    ,// Else
    // flag one means restore status for following items
    [ISet,MATERIAL:ItemInfo, TMat]
    [ISet, TOOL:ItemInfo, TObj ]
    [ISet, TEXTURE:ItemInfo, TTex ]
    [ISet, DRAW:Mrgb, TMrgb ]
    [ISet, DRAW:Rgb, TRgb ]
    [ISet, DRAW:M, Tm ]
    [ISet, DRAW:Zadd, TZadd ]
    [ISet, ALPHA:ItemInfo, TAlp ]
    [ISet, STROKE:ItemInfo, TStk ]
    [ISet, DRAWrawSize, Tdsize ]
    [ISet, DRAW:ZIntensity, TZint ]
    [ISet, DRAW:RGBIntensity, TRGBint ]
    [ISet, DRAW:FocalShift, TFshift ]
    ]
    ,ZStateFlag // value passed from main script
    ]
    [/CODE]

  3. #18
    Senior Member Follow User Gallery
    Join Date
    May 2007
    Location
    Bellevue,WA
    Posts
    500

    Default each subtool to a layer??

    Maybe I am the only one who might find it usefull but I would like to suggest a zscript that could automatize sending every subtool to a different layer.
    I prefer to compose my scenes placing the models as subtools rather than doing it layer by layer. Its a lot more precise...but have them in separate layers is usefulll also..
    Last edited by dargelos; 07-24-07 at 05:22 PM.

  4. #19
    Senior Member Follow User Gallery
    Join Date
    Nov 2012
    Location
    BELGIUM Li├Ęge
    Age
    35
    Posts
    160

    Default

    [EDITED] Double edged buttons with modifier keys - example 6 : One can think it should be better to make the trigger event 64|128 (mod key down/up) instead of 4, BUT IT IS NOT, sometimes ViewKeyboardStatus doesn't get updated on key up and also mod key down it gets triggered thousand times per second which is not cool.

    Cheers everyone

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
  •