detecting parent child relationships

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

lukasz

detecting parent child relationships

Post by lukasz »

this is more of a abstract question because I think the exection would be relatively easy. But I am trying to figure out how to tell detect if one [lets say rectangular filled marquee] is shape is within another. so almost like a parent child relationship in html goes? was thinking about getting top botom left and right of a layer called parent then checking all layers below it (maybe they have "child" naming sceme, so i can match by layer name) if the top bottom left and right are >=/<= the one above it. not sure if there is an easier way someone can suggest? so it is basically detecting if a box is inside another box.

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

csuebele

detecting parent child relationships

Post by csuebele »

Not really sure if how you described parent/child relationship applies to layers other than in groups or clipping layer. However, if you just wan to see if the content of a layer will fit within another layer, you can get the layer's content bounds, which will give you the corner locations, and then you can compare them with other layers.