Jump to content

Create New Layer in Effect via CodeLab


Recommended Posts

From reading, I'm guess there is no way to create a new layer via CodeLab for an Effect?

 

I'd like to:

01. Copy SRC (Layer1 Selection) to new layer (Called Layer2).

02. Run effect code on Layer2.

03. Output DST to Layer2.

 

That way, the original image and effect image will both be present for comparison by

the user.

 

Can this even be done with compiled C# code?

 

Just wondering,

THX - DPS

The Rise of the Creative Class

by: Richard Florida

Link to comment
Share on other sites

BoltBait has written a new tutorial on the subject of extra surfaces: http://forums.getpaint.net/index.php?/topic/32107-how-to-write-an-effect-plugin-part-7-extra-surface/

Think of a 'surface' as a temporary layer/work space.

With your process you would be much better doing step 1 in the paint.net environment then processing the layer with your plugin. This is because new permanent pdn layers cannot be created by plugins. So any pixel output (excepting the clipboard) will be output to the layer from which the plugin was called.

Link to comment
Share on other sites

Try making the selection then Ctrl + C to copy it and Ctrl + Shift + V to paste in to a new layer. Now you can run your effect on the new layer.

Link to comment
Share on other sites

Yeah, that's too bad that layer creation can't be handled via script (only through user action).

 

For example, I'm creating a plugin to put a "label" (text) to identify parts of a program skin.

 

For example, it will draw a box around the part of the skin graphic where a button is located and

put a label that says something like "Open Button" next to it.

 

It'd be nice if at least the labels could be on a separate layer.

 

I guess I could:

01. Have users make a copy of the skin and put it in a new layer.

02. Have users pick a layer to run my plugin on.

03. Have the plugin delete the skin graphic.

04. Have plugin output the boxes and text.

 

Be nice if you could just script a new layer tho...

 

THX!

The Rise of the Creative Class

by: Richard Florida

Link to comment
Share on other sites

Also, I'm guessing that since the "Paste in to New Layer" isn't available via the script language,

that the "Paste in to New Image" is also not available.

 

THX
DPS

 

.:.::...:..::::OFF TOPIC::::..:.::.::.::

It's weird, as I'm working on an MS-DOS BATCH program and I noticed there's no PASTE

command either.

Yeah, just COPY <source> <destination>.

Maybe it's an "industry" thing?

The Rise of the Creative Class

by: Richard Florida

Link to comment
Share on other sites

Also, I'm guessing that since the "Paste in to New Layer" isn't available via the script language,

that the "Paste in to New Image" is also not available.

Correct.

This list of limitations might be worth reading through http://forums.getpaint.net/index.php?/topic/14566-what-is-and-isnt-possible-when-writing-plugins/

Link to comment
Share on other sites

Interesting read.

This has given me a "new" idea for BATCH programming...MENU BATCH!

All commands are menu commands! All programs (with menus) are batch programmable (somehow).

Cool!

 

Here's my codelab COPY rewrite...V=Vertical (Y), H=Horizontal(X)  (H,V)=point, TOP/BOT/LFT/RIT

...I hate X,Y, to me it's HVD

 

thanks!

The Rise of the Creative Class

by: Richard Florida

Link to comment
Share on other sites

uhh ... what?

Sorry, must have been (what we in Denver call) "wax typing" on that one.

 

You, know, why Is "X" Horizontal when graphing? That just makes it difficult to figure out.

X=H,Y=V, and I say "D" for Density ... now everyone knows what your talking about...

I tried some 3D modeling and all I can say is the "Z" axis really got me confused.

 

That said, when I program, I first do things manually. Then, I try to write some code

that does the same things I did manually (which is why MS-DOS BATCH missing

the PASTE command is soooo upsetting).

 

That said, I think the real test of a programming language is how much I can

program the steps to accomplish the algorithm in the same way I would perform

the steps manually.

 

Witch is the genius of MENU BATCH!

 

Anywayz...I can work with CodeLab (no prob ;)...keep up the good work yall,

I'll send you some shatter in the mail.

:bigeyes:

The Rise of the Creative Class

by: Richard Florida

Link to comment
Share on other sites

...

You, know, why Is "X" Horizontal when graphing? That just makes it difficult to figure out....

X and Y are standard Cartesian graphing coordinates taken from algebra. See here under Two Dimensions and also Notation https://en.wikipedia.org/wiki/Cartesian_coordinate_system.

It's a VERY COMMON system. We use it in programming to reference a 2D grid - like a screen. Every programmer will tell you instantly that (0,0) denotes the top left corner of the grid for example. It's just second nature.

If you're going to mess with these conventions, get used to answers like Rick's when you share code.

Link to comment
Share on other sites

Red ochre, I'm pretty sure that's the origin (ha, ha! an unintentional sort-of-pun) of y-down coordinates. I've gotten used to it, but I wish the standard were y-up, like in math. I find it makes such things as describing algorithms more difficult. When you say "as the height increases," do you mean "as you go higher," or "as the y coordinate increases"? It requires considerable care (and increased wordiness) to avoid that type of ambiguity.

Edited by MJW
Link to comment
Share on other sites

I think the X/Y thing is a left over from that whole NASA-50s-United Nations "one world" thing.

 

You know, one advantage it has is it's "readable" by all languages. I think most languages

have an "x" and a "y" in the language, and thus the meaninglessness of the variable names

is important (Vertical and Horizontal are probably different in most languages) as when they

all get together they can point at it and say "the X trajectory of  the nuclear warhead makes

me sad."...and EVERYONE in the room will know what he/she is talking about.

 

Still, I like variables that make sense.

 

Strange that X/Y hasn't changed with OOP languages currently prevailing. You know, most

OOP programmers like very verbose variables like:

number_of_cupcakes = 500

Mine would be NOC = 500

 

Like that "UP" idea for movement from points tho. H/V = [10,1] UP 5 = [10,6] DN 5 = [10/1]

...good stuff! THX!

 

PS: Somehow using variables in MS-DOS BATCH now seems more reliable to me...

%PEACE% + %OUT%

Edited by denverpotsmoker

The Rise of the Creative Class

by: Richard Florida

Link to comment
Share on other sites

According to Merriam Webster's Collegiate Dictionary, the first recorded use of the term "x-axis" was 1886. A bit before NASA. That's what I'd expect, since the independent variable has been been placed along the horizontal axis pretty much since Cartesian coordinates began, and X has long been the usual symbol for the independent variable, with Y for the dependent variable. Interestingly, the first recorded use of "y-axis" was even earlier; it was 1875.

Link to comment
Share on other sites

Link to comment
Share on other sites

Wow, I didn't know you guys liked the XY so much that you would denigrate someone like that.

 

Not cool!

 

But to get back on topic (since you guys derailed it pretty bad for admins)....

 

I think the whole 2D array for XY/HV is bad. Some people like counting up, then over (VH) and

this could easily be fixed by using single variables. I prefer HV (most of the time).

....

So fix it already. What's your problem homebrew?

The Rise of the Creative Class

by: Richard Florida

Link to comment
Share on other sites

So fix it already.

Can't fix something that isn't broken.

 

What's your problem homebrew?

I don't have a problem... banning you for being a detriment to this message board.

Do yourself a favor and give up the pot. It's not doing you any good.

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

 Share

×
×
  • Create New...