Results 1 to 10 of 19

Thread: Selection to Stencil

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2006
    Location
    UK
    Posts
    186

    Selection to Stencil

    This script creates a stencil from a selection. Only painted areas are included.

    1) Select area
    2) Run script


    Questions for Ambient:
    1) Since some scripts are useful as macros, will we be able to bind them to keyboard shortcuts?
    2) Is there a command to fill a selection with the forground colour?






    Code:
    //===========================================================================
    //===========================================================================
    //                            ArtRage Script File.
    //===========================================================================
    //===========================================================================
    
    
    //===========================================================================
    // Version Block - Script version and ArtRage version:
    //===========================================================================
    
    <Version>
        ArtRage Version: ArtRage 3 Studio Pro
        ArtRage Build: 3.5.0
        Professional Edition: Yes
        Script Version: 1
    </Version>
    
    
    //===========================================================================
    // Header block - Info about the painting/person who generated this script:
    //===========================================================================
    
    <Header>
        // === Project data
        Painting Name: "Untitled"
        Painting Width: 1600
        Painting Height: 860
        Painting DPI: 72
        //Mask Edge Map Width: 1600
        //Mask Edge Map Height: 860
        // === Author data
        Author Name: "Charlie"
        Script Name: "Selection to Stencil"
        Comment: "Convert selection to stencil"
        Script Type: ""
        Script Feature Flags: 0
    </Header>
    
    
    //===========================================================================
    // ArtRage project features. Sets the startup state of the script:
    //===========================================================================
    
    
    //===========================================================================
    // Script data follows:
    //===========================================================================
    
    
    
    <Events>
    Wait: 0.000s    EvType: Command    CommandID: Copy
    Wait: 0.000s    EvType: Command    CommandID: Paste
    int nLayer = CurrentLayerIndex()
    Wait: 0.000s    EvType: Command    CommandID: CID_SelectSpecificLayer    ParamType: uint32    Value: { nLayer }
    Wait: 0.000s    EvType: Command    CommandID: CID_CreateStencilFromSpecificLayer    ParamType: uint32    Value: { nLayer }
    Wait: 0.000s    EvType: Command    CommandID: CID_DeleteSpecificLayer    ParamType: uint32    Value: { nLayer }
    Wait: 0.000s    EvType: Command    CommandID: Deselect All
    Attached Files Attached Files
    Last edited by Charlie; 07-27-2011 at 12:53 PM. Reason: Attached script
    Charlie

    ArtRage for Art | EnergyXT2 for Music | Blender for 3D

  2. #2
    Join Date
    Jun 2011
    Location
    Hamburg Germany
    Posts
    472
    Hm, your script didn't produce any stencil for me, but rather a nice error message instead

    edited: OK, forgot to save as UTF 16. Now works as intended
    Last edited by Strandy; 07-23-2011 at 04:08 AM.

  3. #3
    Join Date
    Aug 2007
    Location
    Germany
    Posts
    1,070
    very useful! thanks a lot!

  4. #4
    Join Date
    May 2006
    Location
    UK
    Posts
    186
    Attached script to first post
    Charlie

    ArtRage for Art | EnergyXT2 for Music | Blender for 3D

  5. #5
    Join Date
    May 2009
    Location
    3438 ft above sea level
    Posts
    2,950
    Hiya Charlie,
    any chance of a script version that converts the opposite way from stencil to selection in the future ?
    "I paint because I love to cut mats" (Arthur Alexander)

  6. #6
    Join Date
    May 2006
    Location
    UK
    Posts
    186
    I'll have a go at Stencil to Selection but it makes you realise that there is a lot of overlap between stencils, selections and masks.

    I'd like to be able to lock a stencil position and change it's transparency for example.
    Charlie

    ArtRage for Art | EnergyXT2 for Music | Blender for 3D

Posting Permissions

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