1. #1
    Senior Member User Gallery
    Join Date
    Feb 2007
    Location
    Wellington, NZ
    Posts
    157

    Default Length of Layerlist

    Ok, easy question -- when I do an Iget on the LayersScrollbar, how do I get both values from the result ?
    Tried storing everything in an array but nothing seems to come out of an Iget Tools:Layers: Layers Scrollbar and all I get is 0.
    Last edited by campi; 09-08-12 at 02:14 AM.
    Jens Kafitz
    Sr. Texture Artist, Weta Digital


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

    Default

    This is what I use to find the number of layers. The scrollbar position is found by using [IGetSecondary].

    [CODE]
    //****routine to find the number of layers*****************
    [RoutineDef,GetLayers,
    [VarSet,numberOfLayers,0]
    [If,[IsEnabled,Tool:Layers:Layers Scrollbar],
    //store current scroll bar position
    [VarSet,tmpLyScrPos,[IGetSecondary,Tool:Layers:Layers Scrollbar]]
    //set scroll bar to a maximum to ensure it is at the top
    [ISet,Tool:Layers:Layers Scrollbar,0,256]
    [VarSet,numberOfLayers,[IGetSecondary,Tool:Layers:Layers Scrollbar]+1]
    ,
    [If,[IsEnabled,"Tool:Layers:Layer Intensity"],
    [VarSet,numberOfLayers,1]
    ]
    ]
    ]//end routine[/CODE]

  3. #3
    Senior Member User Gallery
    Join Date
    Feb 2007
    Location
    Wellington, NZ
    Posts
    157

    Default

    Hey Marcus,
    whenever i use the ISet to set the scrollbar anywhere in my plugin Zbrush crashes immediately after the Routine is launched.
    I tried it with different routines and even something super simple as well and it just dies on me. Any thoughts ?
    Jens Kafitz
    Sr. Texture Artist, Weta Digital


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

    Default

    Quote Originally Posted by campi View Post
    Hey Marcus,
    whenever i use the ISet to set the scrollbar anywhere in my plugin Zbrush crashes immediately after the Routine is launched.
    I tried it with different routines and even something super simple as well and it just dies on me. Any thoughts ?
    Make sure you are setting two values. The first is always zero and the second the actual scrollbar position:

    [CODE]
    [ISet,Tool:Layers:Layers Scrollbar,0,256]//sets to the top of the list[/CODE]

Posting Permissions

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