Jump to content

Exporting the position of objects on a layer


Recommended Posts

I'm wondering if there is a way to export the positions of objects.  I realise this is a slightly odd ask but I thought I'd check

 

Basically I'm building a .dds file made of multiple images which will be referenced in an xml file.  The format of the reference is to give x & y of the top left corner and the width and height of the object, thereby creating a map which specific graphics can be pulled from.  While I know the data I want is given in the status bar and it can be done manually using the magic wand there are a lot of graphics involved, and I'm wondering if such data for individual layers (i.e. where the top-left of the top-leftmost object within a layer are and what the widths/height are) is exportable in some manner.  If not then I'll just knuckle down and do it :D

Link to comment
Share on other sites

That doesn't sound quite like what the OP is asking for to me. I think they're trying to find out if there's any way of knowing the coordinates of an item within its layer, and the answer is no, there isn't. Sorry. See, a layer (every layer) is just a field of pixels. If there's nothing on the layer, it's a field of transparent pixels. If there is something on the layer, some of those pixels are colored instead. But wherever the item isn't, there's still those good old transparent pixels. Paint.NET doesn't know the difference between the object (the colored pixels) and the rest of the layer (the transparent pixels). The magic wand will search for that difference, but PdN doesn't know what that difference is until you ask.

Good luck!

  • Upvote 1

 

The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.
Amy: But how did it end up in there?
The Doctor: You know fairy tales. A good wizard tricked it.
River Song: I hate good wizards in fairy tales; they always turn out to be him.

Link to comment
Share on other sites

Thanks david, that was pretty much it.  I guess I was asking if there was a way to get the wand to cycle the layers and output the coordinate results.  It seems not, which is fair enough as it's a pretty unlikely need.

 

Guess I'd best get to work!

  • Upvote 1
Link to comment
Share on other sites

It seems not, which is fair enough as it's a pretty unlikely need.

A rare gem you are...you have no idea.
  • Upvote 1

No, Paint.NET is not spyware...but, installing it is an IQ test. ~BoltBait

Blend modes are like the filling in your sandwich. It's the filling that can change your experience of the sandwich. ~Ego Eram Reputo

Link to comment
Share on other sites

Thanks david, that was pretty much it.  I guess I was asking if there was a way to get the wand to cycle the layers and output the coordinate results.  It seems not, which is fair enough as it's a pretty unlikely need.

 

Guess I'd best get to work!

Sounds like a cool idea for a plugin, really.  It wouldn't be able to cycle through every layer, but maybe it could output the location of each contiguous block of pixels for the selected layer so you could run it with the "repeat" keystroke (Ctrl+F)...

 

I'm not a plugin developer, but if I were, I would totally do this, because...

 

 

A rare gem you are...you have no idea.

...pdnnoob is absolutely right.  :-)  We get entitled angry people insisting that Rick include their obscure functionality in the next version of PdN all the time.  Thank you for understanding that use cases are not universal and he has to focus energy on the things that most people need.

 

As he said.  Rare gem.  Stick around, I like you already.

 

The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.
Amy: But how did it end up in there?
The Doctor: You know fairy tales. A good wizard tricked it.
River Song: I hate good wizards in fairy tales; they always turn out to be him.

Link to comment
Share on other sites

try this:
 
updated below
 

it will find the upper left hand coordinates of the bounding box, it will give you 2 replies cause PDN calls it twice (once for the thumbnail?)

but the same set of coords

 

make sure there's no active selection
 
it will work with PDN 4
 

I think It's too user specific to make it into a topic 

Edited by TechnoRobbo
  • Upvote 2

Go out there and be amazing. Have Fun, TR
TRsSig.png?raw=1
Some Pretty Pictures Some Cool Plugins

Link to comment
Share on other sites

Truly excellent of you to do this.  

 

The output appears to be the top right corner of the object.  What I was after was two sets of co-ordinates: the top left x, y being the first set and the offset from those coordinates of the bottom right (effectively giving the size of the object in pixels as the second output) being the second.  Is that possible at all?

Link to comment
Share on other sites

'sokay, I can add another!  TR is another gem on this forum, that's for sure.

 

The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.
Amy: But how did it end up in there?
The Doctor: You know fairy tales. A good wizard tricked it.
River Song: I hate good wizards in fairy tales; they always turn out to be him.

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.

×
×
  • Create New...