Jump to content
Developer Wiki and Function Reference Links ×

Create new layer/Create new Class


grant_PD

Recommended Posts

There's a lot of moving about to different palettes, to the point where it's slowing down my workflow. I realized this as I was working in photoshop today. My workflow is to know that I need/want a new layer, create layer on the fly/worry about naming it later, keep drawing.

VW makes organization so time consuming that I find that I'm not paying enough attention to the actual drawing itself.

Link to comment

Here is a start on a script to do what you want. It creates a new layer with the same scale as the current layer and a dummy name including the date so you don't end up with a duplicate.

You could easily make this into a menu command and assign it a keyboard shortcut.

Use as you see fit.

Procedure MakeSL;

{creates a new layer with a name of Scratch plus the date. Assigns it a light grey }
{layer color, and sets the layer scale the same as the active layer.}
{Use at your own risk.}

{November 15, 2011}
{? 2011, Coviana, Inc - Pat Stanford pat@coviana.com}
{Licensed under the GNU Lesser General Public License}

const  Fore=30583;  {RBG Value for light/medium Grey}
 Back=61166;  {RGB for light Grey}
var

H1,ALH:	handle;
L1:	string; {Scratch Layer Name}
R1:	real;

Procedure SetLayerColors;
Begin
LPenFore(Fore,Fore,Fore);
LPenBack(Back,Back,Back);
LFillBack(Back,Back,Back);
LFillFore(Fore,Fore,Fore);
end;

begin

L1:=concat('Scratch ',date(2,1)); {Set the layer name to date/time}
ALH:=ActLayer;

if GetLayerByName(L1)=nil then 
begin
	R1:=GetLScale(ActLayer);
	Layer(L1);
	SetScale(R1);
	SetLayerOptions(4); {Show/Snap Others}

	h1:=FLayer;
	While h1<> nil do
		begin
			Layer(GetLName(h1));
			SetLayerColors;
			h1:=NextLayer(h1);
		end;
end;

	Layer(L1);
	SetPref(11,True);
	RedrawAll;
end;

Run(MakeSL);

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...