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

    Default

    ZbrushFactory,

    You can do it like this. Note that [IModSet] is not always reliable; it is best to test the Mod and then simply click on the subtool to make it visible/invisible.

    This example runs through all the subtools and turns them off if necessary. (Note there is no error checking to see if a polymesh is selected, if there is more than one subtool, etc.) :

    [CODE]
    [IButton,TurnOffAllSubTools,"Loop through all subtools and turn them off",
    //this avoids an error if the top subtool is selected & hidden
    [If,[SubToolGetActiveIndex]==0,//if the top subtool is selected
    [SubToolSelect,1]//select the second subtool
    ]
    //loop through all subtools
    [Loop,[SubToolGetCount],
    [SubToolSelect,[Val,n]]//select the subtool by number
    [VarSet,subToolPath,[IGetTitle,Tool:Item Info]]//get subtool name
    [VarSet,subToolPath,[StrExtract,subToolPath,0,[StrLength,subToolPath]-2]]//trim off period
    [VarSet,subToolPath,[StrMerge,"Tool:Sub Tool:",subToolPath]]//set the path
    [If,([IModGet,#subToolPath]>=17),//check the mod
    [IClick,#subToolPath]//click to turn it off
    ]
    ,n]//end loop
    ][/CODE]

  2. #17
    New Member Follow User Gallery
    Join Date
    Apr 2004
    Location
    Poland / UK
    Posts
    4

    Default

    Thx Marcus. I solved the problem.
    Last edited by ZbrushFactory; 10-15-12 at 03:09 AM.

  3. #18
    New Member Follow User Gallery
    Join Date
    Apr 2004
    Location
    Poland / UK
    Posts
    4

    Default

    If you don't mind Dragotron , I put one more question in your Thread.
    I don't want make a rubbish on the forum.

    Marcus maybe you have idea how to check if subtool is zsphere ?

    I have idea that I can check this by name, but what will happend when user will change name :/. This complicate all . There is some flag or marker that we can recognize zsphere from others sub tools like, for example, PolyMesh ?

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

    Default

    Quote Originally Posted by ZbrushFactory View Post
    Marcus maybe you have idea how to check if subtool is zsphere ?
    You can test for the different ZTools like this:

    [CODE]
    [If,[IExists,Tool:SubTool:Append],//we have a 3D tool
    [If,[IExists,Tool:Geometry:SDiv],
    [If,[IExists,Tool:AdaptiveSkin:Make Adaptive Skin],
    [Note,"This is a ZSphere"]
    ,//else there's no Adaptive Skin option
    [Note,"This is a Polymesh"]
    ]
    ,//else there's no Geometry SDiv slider
    [Note,"This is a Parametric primitive"]
    ]
    ,//else there's no SubTool Append button
    [Note,"This is a 2.5D tool"]
    ][/CODE]

  5. #20
    New Member Follow User Gallery
    Join Date
    Apr 2004
    Location
    Poland / UK
    Posts
    4

    Default

    Cleverly. Thanks.

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
  •