The Position of the upper left corner of any shape layer

Hi guys,.

So for the last two days, I worked on a script that would allow me to centre X number of layers in the middle of the container model, as if the selected layers were just one layer. So my approach to achieve this goal is first to know the positions of the four corners of each layer. My code so far works perfectly with AVLayers and TextLayers, but it does not always with ShapeLayers. Here's the formula I use to calculate the position of the upper left corner of the shape layers:

x = position [x] - [x] anchorPoint - (layerWidth / 2)

y = position [y] - [y] anchorPoint - (layerHeight / 2)

So the formula assumes that the anchor point is in the middle of the shape layer if the anchor point is [0, 0], and which seems incorrect.

Untitled2.png

And it's Layer Properties.

Untitled.png

So the question is, what is the way to calculate the position of the upper left corner of ANY shape layer?

Thank you very much!

It should work as long the layer was not filmed:

var C = app.project.activeItem;

var L is C.layer ("shape Layer 1");.

var r = L.sourceRectAtTime (C.time, false);

var s = L.property("Scale").value;

var p = L.property("Position").value;

var a = L.property("Anchor_Point").value;

var ul = [p [0] + (r.left - a [0]) * s [0] / 100, p [1] + (r.top - a [1]) * s [1] / 100];

Dan

Tags: After Effects

Similar Questions

  • I create a text field and I can't get the text to start typing in the upper left corner

    I created a pdf file for and added to the text boxes. The text want to start in the middle left of the text field and I can't seem to start in the upper left corner. Any suggestions?

    Set as Multiline field, under Properties - Options.

  • Get the position of the upper left corner?

    Hey guys,.

    by geometricBounds [1] and geometricBounds [0], I can get the starting positions of my objects.

    In my case I need the position of the upper left corner. When you rotate an object, the geometricBounds always reflect a bounding box so that I can not get the desired coordinates.

    How can I get the properties of the "points of departure" (the upper left corner of my object)?

    Thank you very much!

    You have entered the field coordination complex spaces here.

    In short, you can use resolve() to find the anchor points on one

    object. But you have to decide in what coordinate space to get the

    results.

    Your best bet is probably to use spread coordinates. The point 0,0

    who is in the middle of spread.

    So, given a pageItem i, try:

    i.Resolve (AnchorPoint.TOP_LEFT_ANCHOR, CoordinateSpaces.SPREAD_COORDINATES);

    If you want to deepen this topic, Marc Autret has a good guide PDF

    on that.

    Ariel

  • How to position text in a text field so that it starts in the upper left corner, rather than in the Middle?

    Once more, I'm working on another form for the boss.  It is a form of assessment where you make a section for comments.  I know how to select the text field so it will allow several lines, but I can't find a way that allows me to set the starting point of the text in the upper left corner of the text box and then sink.  It always starts in the Center.  If I do the text box too small as an up/down arrow icon is displayed and the user must drag the arrows up or down to read the comments and is not the effect I want to create.

    Thank you.

    M Campbell

    With the field of selected text, switch to the view of paragraph. You can switch between ' change the caption and value ","Change Caption"and"Change value"by clicking on the chevron. Select alignment for the caption and the value.

    Steve

  • OFF Auto placing the image in the upper left corner of the scene

    Can someone help, I'm a logo on the stage using a load button, the command is

    I managed to call in an image in the folder of the image using a button, but it is placed in the upper left corner.

    1 button using:
    on (release) {}
    loadMovie ("images\\logo1.jpg", 1);
    unloadMovieNum (2)
    }

    I want to make sure that when I press the button using the ACE over the image is at the center of the screen
    the stage size is 800 x 600

    ANY IDEAS GUYS

    Flash will put any new content loaded in the upper left corner, the point (0,0), if you do not give a location. The simplest solution is to use a movieClip.

    1. create a new movieClip in the library. Don't give him any content.
    2. drag an instance of this empty movieClip on the stage at the location where you want the content loaded to show.
    3. This movieClip instance name empty.
    ("4 load in new content to this clip: clipName.loadMovie("images\\logo1.jpg ");
    5 adjust the position of the empty clip on the stage as needed.

  • All my & lt; div & gt; s stack upward into the upper left corner

    Try my hand as a result of Dreamweaver tutorial directives to make formatting CSS with absolute positioning, rather than from previously tested code and not having not much of chance. Page looks fine in design DW 8.0.2/Mac window. However, when previewing the page in Safari, the divs are placed in the upper left corner, not in their "absolute" is positioned on the page.

    It has a few graphics in the banner that affect rather than leave a distance of 1px. It is the only area where I have lost instructions in the tutorial I think.

    Beginning of the code for the attached page. Thank you.

    Thanks for the article.

    Pollyanna, assuming that the use of the program in the way that says tutorials would produce a usable page. It's always to the coding by hand, right?

    Strange that the inspector said 100px when I entered the positions here the code doesn't work. Don't even think to check. And really weird as DW isn't making things like the use of margins automatically for the placement of the div, or at least this amount as a more automated option. That's what I bought DW, do "the right thing" for me, otherwise I could also use BBEdit. I'll have to read the article more carefully tomorrow and then to determine my new strategy. I hope that DW will automate things for me somehow. I wish DW tutorials reflect best practices DW at least!

    I spent a lot of time-re-hand coding a site frankensteined with many resizable & floating elements. I started with a tested model prepared by someone experienced much more than me who had more div inside div tags than anything I had ever seen. Some of the divs puzzle me. But it worked. It was a real problem to understand and change well. I was hoping to avoid this through the book (DW). HA! Teach me... Back to the treadmill...

    In any case, thanks for the article.

  • Well confused. I use click on Favorites in the upper left corner of the screen. I can still but I can't access the properties of the bookmark

    I used to just right click on a bookmark of Bookmark menu in the upper left corner of the screen. Now when I right click on Favorites, I can't get any of the choice to highlight, they are subject, and nothing happens. But if I add bookmarks little star at the high right to help customize I can access an area of the one bookmark away. Seems that just suddenly happened. I like to use the left side of the screen, but cannot access the properties there. Any difficulty?

    Devil well, now, all is well, seems to set just after a reboot. So solved my problem all by my lonesome. Please disregard.

  • Show 'the story' 'bookmarks' etc. on the upper left corner

    I returned from vacation and had malicious software. In addition, I don't have the usual tabs in the upper left corner when my home page opens. How to bring back these tabs?

    Were you able to remove malware? Our technical support article lists the tools free other Firefox users have found useful: Troubleshooting Firefox problems caused by malware.

    If the bar classic menu set is missing, you can display it temporarily by pressing the ALT or by pressing F10.

    To be displayed, you can use one of the following methods to display the list toolbar, and then select it there:

    • Right click on a place empty on the tab bar (or the button '+')
    • Press the Alt key to activate the classic menu bar > view > toolbars
    • in customize mode > show/hide toolbars

    Does it work?

  • How can I get the little tab of Firefox in the upper left corner of my browser window? He disappeared with the last update

    There is a little tab on the upper left corner of my browser window that says Firefox. I used to be able to hit that and have quick access to history, print etc. rather than working from the menu on the left three lines. How can I get that back?
    Thank you

    It has been replaced by the 3 lines on the side button. You can either use that (it's actually faster to access your frequently used objects) or customize Firefox How to make the new look of Firefox as the old Firefox

  • 23 FF has a tab in the upper left corner. I made the change of url to empty, but it's still there. How can I get rid of it for good? W7 Ultimate

    F 23 has a tab box in the upper left corner. I made the change of url to empty, but it's still there. How can I get rid of it for good? W7 Ultimate. There was no box in another version of FF.

    Hello, apparently this option has been removed intentionally in preparation for a redesign of the browser which will land in firefox later this year. You can use the following extensions to work around this issue if: https://addons.mozilla.org/firefox/addon/hide-tab-bar-with-one-tab/

  • After FlashPlayer 11.04, a site with videos, like YOUTUBE opens a separate process and videos appear in the upper left corner and cannot be moved.

    After update to a version after FlashPlayer 11.02 when you open a window with flash videos on, next to the Firefox process in the taskbar appears a new process with the Flash Player icon and the video window is placed in the upper left corner and cannot be moved. If there is more a video on this page when you click on that Flash Player icon, you can see a list of all the videos.

    Using Flash Player 11.02 this problem does not occur and I used this solution for quite awhile, but now, if I use this version, I get a black window with an error message on security reasons, but if I click on it it plays without any problems. Although in a few Web sites that require Flash, he says he needs at least version 10, but I 11.02 but does not recognize it and ask to be upgraded.

    It's very weird because that doesn't happen in my laptop, I have a desktop computer with the exact same windows and version Firefx and this happens. I already tried uninstalling Firefox completely and even remove all plugins and extensions, and the problem persists.

    Uninstall Flash player also solves this, but then I wonder to upgrade the Flash player. This problem occurs in Chrome or IExplorer 10:

    http://Tinypic.com/view.php?pic=15pn2ab & s = 4

    http://Tinypic.com/view.php?pic=24v2u4l & s = 4

    Recent crashes of some multimedia content (this includes the Youtube videos, some flash games and other applications), in collaboration with Firefox are most likely caused by a recent update of Flash 11.3 and/or Real Player browser plugin to malfunction.

    To resolve this problem, follow the steps in these articles in the Knowledge Base:

    Flash Plugin - maintain and troubleshoot

    Adobe Flash plugin has crashed - avoid that it happen

    11.3 Flash does not load video in Firefox

    We'll find other information on more technical issues under these links:

    http://forums.Adobe.com/thread/1018071?TSTART=0

    http://blogs.Adobe.com/asset/2012/06/inside-Flash-Player-protected-mode-for-Firefox.html

    Please tell us if it helped!

  • I installed firefox 16 and when it happens my whole screen turns a reddish color and nothing appears that firefox symbol in the upper left corner.

    I have always used firefox. Two days ago, when I opened it, my screen becomes reddish and the firefox emblem is in the upper left corner and nothing else is on the screen--no text, no command, nothing. I uninstalled and installed again, same thing. Help!

    Thanks for the suggestions, but on the contrary, I restored my system to 2 days when everything worked correctly. It's all working now. The only great thing that has happened in these two days was a Java Update installation. I wonder if this has a conflict with Firefox. I have not applied this update of Java at that time.

  • Was a change made? : before the jpeg photo showed up at the upper-left corner of my screen, with a white background for the screen. The image now appears in the center of the screen, and the rest of the screen is completely black.

    By the way, when I put the url in Safari, it's the same as before, namely the image appears in the upper left corner, and the bottom of the screen/monitor full is white.

    You can try it with this URL to jpeg:
    http://www.antiquegamblingchips.com/Crest/bison.jpg

    Yes, it is a new feature in Firefox 11, which was designed to improve the readability of images. You can install the https://addons.mozilla.org/en-US/firefox/addon/old-default-image-style/, which restores the change if you don't like it.

  • Where is the "Firefox" printed logo which is supposed to appear in the upper left corner of the page?

    When Microsoft installed Firefox on my computer there was a small, orange, with "Firefox" logo printed in it in the upper left corner of the page. He went, and the guests of teaching direct use me to go. How can I get it back?

    Thanks Matt. Another person told me how to remove the menu bar and BAM he was there, someone else says to press F11 and it works also. As I told them, I am 62 yr.s old, has not been raised with these wonderful machines, but I'm slowly learning. Thanks again!

  • Where is the back botton arrow in the upper left corner of the Office?

    Why and where is the back botton arrow in the upper left corner of the desktop, or the computer? The arrow that you can click if you want to return to the previous page of your screen?

    If there is no menu bar use first 'Alt' to display the toolbars.

    Show customize them with view > toolbars > customize

    then in the lower left corner of the dialog box customize, you want what he read

    Show: icons

    Rear or before the wording or the arrows will be grayed out if there is anything in the tab to go back or move forward, respectively.

    Photo shows approximately what you would see without the bar menu at the top, or with the bottom menu bar. Part of the image showing the appearance with the menu bar toolbars has a few customizations described in the 41-46 steps in what follows in addition to the first steps 1-10 on the page mentioned in the note of my initial response.

Maybe you are looking for