Math.Round for shape layers land on whole pixels?

Trying to keep my shape on whole pixels layers to avoid blur of subpixel.

For one-dimensional properties, it works fine:

Math.Round (value);

But for two dimensional props, I am running into errors with this stuff:

Temp = Math.round (content("Rectangle_1").content ("mapped Rectangle 1") .value .size)

(temp [0], temp [1])

Temp = Math.round (content("Rectangle_1").content ("mapped Rectangle 1") .size)

(temp [0], temp [1])


I don't know that my syntax is off. Real estate in berries always give me problems. Can you help me?

Missing just a semicolon at the end of the first line.

In response to your second question, Yes - in fact it works:

[Math.round(value[0]), Math.round(value[1])]

Dan

Tags: After Effects

Similar Questions

  • You can change the default values for shape layers?

    Specifically, I want the default paths Trim "connect multiple traces' '' individually '' and default STROKE line Cap and line join defined respectively on"Round cap"and"join Round '.

    I know that I can copy and paste these properties also but I wonder on changing the default settings - perhaps in a preferences file? Thank you

    No, there is no way to change the default values. If you have a set of properties that you always want to use, you can save them as a preset.

  • How to set a layer style and not have some shape layers overlap?

    I don't know how to explain this very well, but I've created a mp4 to demonstrate what I worked on. I want to make sure when I apply a shadow effect drop, that all layers are affected but aren't above the knees. It is the video.

    432ab2436daeb31bba0be2f195b072d1.png
    Shape layer 2 are the lines.

    When you want to delve into problems the first thing we do is select all the layers that you have problems with, press the U key to reveal all changed properties and analyze what you see in the timeline panel. I guess right here because you don't have given us no indication of your workflow, but it makes sense that you have applied the two-tier drop shadow layer style. I'm just guessing that you used the Layer Styles and not the effect due to the title of your post.

    Since you already have the animation and now want to add a drop shadow the best thing to do would be to compose two layers prior shape and then apply a layer style or effect to the demo. Looks like you have the shadow applied to all text as layers so it would make sense to dial previously all layers, you want to have

    I probably would have used a rectangle rounded, converted the rectangle rounded for a Bézier path and the shape of the path of animation and used paths pads to get the circle to rectangle rounded on a layer of simple shape animation but I certainly would be made first before you add the same effect to all layers.

  • Math.Round () and Math.Random)

    Hello

    Do we have the equivalent methods in J2ME for Math.round () and Math.Random ()? I could not find in Java.util.Math or net.rim.device.api.Math

    Thank you.

    Reshma

    @ JavaMEUser, you can write your own class of math for your application, use the following code...

    public static int round(float f)  {     return (int)(f + 0.5F);   }public static long round(double d) {                return (long)(d + 0.5D);   }
    

    Thank you!

  • New in After Effects 13.8.1 - with audio shape layers!

    I just wanted to share a little funny bug. the shape layer has no audio effect applied, and he still has an audio setting. It don't bother me much, although the last thing I need when I'm manipulating shape layers is another rocking to watch in the timeline panel

    Here are the steps to reproduce the problem in my current workstation:

    1 import audio into your composition - in my example, it was the WAV format. but you can add a solid layer with audio tone effect.

    2. put within a publication

    3 pre model the master model (no matter if it's a holiday attributes or move attributes) and get inside the demo

    4. Add a shape layer

    Here is my current workstation card:

    This happens once I reset my preferences. Please share if you encounter this bug too.

    Roei, thank YOU.

    We have received reports from several users on another problem, which we have not been able to reproduce: by clicking on the layer switches (solo, lock, motion blur, etc.) sometimes unnecessarily vortices open the properties of a layer.

    It turns out that this problem is related to what you just posted on the redundant audio properties. The problem of the twirling property only occurs on these same layers.

    The bug occurs when you work in a model that has been composed before and this model contains a layer with audio, when you add a new layer to this model (any type of layer except the cameras or lights), if this layer should not have audio it will win the audio properties in any case. When you click on a layer switch (for example, solo, lock, a blur of movement, etc.) these layers with redundant audio properties will be automatically twirl open their properties.

    This bug started After Effects 13.8.0. There are still in 13.8.1. I have described it in our bugs database and ask so that it can be fixed in our next release.

    The twirling of the property problem can't for layers that have real audio. for example, with audio images, or a solid with the effect of the tone. This does not happen for the layers without audio created before the bug conditions occur (computer pre composed containing a layer with audio).

    I found a few solutions workaround for this problem.

    The simplest solution is to add the effect of audio signal to the affected layers and then disable audio (the switch icon small speaker) for these layers. The problem only occurs on the layers that have no audio, so the addition and then cut audio takes layers on the bad state.

    There is another, more cumbersome workaround that effectively eliminates the redundant audio properties:

    1. In the model problem, select all the layers having audio.
    2. Remove (temporarily, it gets canceled at step 5) these layers.
    3. Select all the remaining layers (or at least those with the redundant audio properties).
    4. Activate a switch layer for all selected layers, such as Solo or lock. Redundant audio properties will disappear.
    5. Cancel twice: once to cancel the toggling the layer switch and a 2nd time to undo the deletion of step 2.

    Redundant audio properties won't return after the cancellation. Unfortunately, this only solves the problem for existing layers. Adding new layers will still get the attached redundant audio properties.

    In any case, my thanks to you once again, Yang, to post the steps to repro the problem. That's the key for me to discover the cause of the problem, much more annoying.

  • Shape layers across the horizontal artifacts

    Facing a strange problem with shape layers create horizontal lines of single pixel between my compositions during scaling. Import of work in AI. It's suddenly with no fill. Created a new comp, dragged work for model, right-click on the layer > create vector shapes. At this point, everything seems as it should. When I resize it I get lines as shown on the attached screenshots. They appear in the final output as well.

    artifacts-100.png

    artifacts-400.png

    This problem is fixed in update fixes after effects CC 2015.3 (13.8.1). This update, available now, can be installed by using the creative Office Cloud app, or by choosing Help > updates within any Adobe application.

  • Math.Round all dimensions

    Hi, guys. I need math.round sizes. For example:

    "350 000 mm"-> "350 mm",

    "420 001 mm"-> "420 mm"

    "mm 419,97"-> "420 mm.

    and so on. All in a script.

    The thing is that I know how to play with the numbers and characters at the same time, I only know how math.round numbers.

    Thank you.

    There are different ways to solve this, one's of them

    var s_number = "419.97 mm";
    var delimeter = ' ';
    var a_number = s_number.split(delimeter);
    $.writeln(Math.round(a_number[0]) + delimeter + a_number[1]);
    
  • No Math.round. Now what?

    I'm trying to round a number that comes out of one of my workflow to the first decimal place for reports, but VCO does not have the Math.round function.   Someone at - it none of the recommendations on another way to do it?

    vCO has Math.round (); Simply not documented in the research of the API...

    var float1 = 1.2345;
    System.log(Math.round(float1));
    

    [18:37:45.563 2012-05-16] [I] 1

  • What does the plus sign after that certain elements mean?  that is '"+ Math.round (& s);".

    Hello

    I was wondering what the sign made in the following line of code: ' "+ Math.round (-s); ". 

    What is + s ?

    What's doing for + Math.round ?

    Thank you

    Linda

    Someone is very careful and ensuring that the processed or calculated value is a number. "Once could languages as easily the ' Number()" constrictor.

    Since the Math.round and product only numeric values, it is redundant and unnecessary.

  • Maintain performance when you work with several shape layers (~ 50)

    Hey guys, I worked on a few recent projects where I need to animate a large number of shape layers cascading, adorning it, with different properties of the animation. When I arrived at the point of use of 30-60 shape layers or more, and they all sort of scale, position, animations etc, my computer slows down to a complete analysis. Then forces me to use a single shape layer and Repeater functions. These can work well, sometimes and not cripple the flexibility too, UNTIL you need to incorporate various colors. At this point, I usually spend my shape layers to masks and place a layer underneath with different colors according to the needs. Animations of form then show these colors, but it does not work for a complex object, which, in itself, requires a lot of colors. so...

    What type of workflow you all to work with more complex semi both objects? I say to myself that I must be missing something, because it's become really limit. Everyone works only with 256 GB of memory RAM?

    FYI, my computer specs are:


    6 core Intel Xeon 2 x 2.66 GHz

    32 GB 1333 MHz DDR3 ECC

    ATI Radeon HD 5870 1024 MB

    OS X 10.9.4 (13E28)


    Thank you!!

    Motorhomes can accelerate your insights if you use the disk cache, but there will be nothing to expedite your first ram preview or a ram preview after a keyframe to change except a better optimized system. All that it takes to slow things down is an effect or film file that causes the AE to begin to use the power of CPU and memory.

    As test I just created a gradient filled rectangle, added keyframes rotation, duplicate the layer so I have 64 copies on my Mac Mini and tried a preview ram from the same model with 1 single layer. Almost no difference in time it took to get an overview of 10 seconds. Thrown into a processing of scale for all layers and once again, not a lot of difference between the layer shape and 64. To make things much more difficult, I change the rectangle a polygon and animated everything in the transform properties starter, put in place a composition with 128 duplicates and a model with a single layer. 2.5 seconds for a ram in the quarter preview ground for a single layer, 10 seconds for a RAM Preview to 128 layers. It is more than acceptable for me for an old Mac Mini for two years with 16 GB of ram. Increase in the factor of 50% zoom with resolution set to Auto double the ram preview duration that was still acceptable.

    This makes me wonder what is happening in your composition. All the effects or other things going on? You have optimized your system for maximum performance? There are links with suggestions to do throughout this site as well as the recommendations of Adobe available here: after effects performance optimization

  • After Effects does not let me merge shape layers?

    I got after effects cs6. I'm working on the construction of a somewhat complex shape, made of 5 shapes with the pen tool and I wanted to merge together. but it is not letting me. I looked at the documentation and it says: all you need to do is select the forms you want to merge and Ctrl + G or layer > Group shapes. Doesn't work for me, though. Group shapes is grayed out in the menu.

    It's pretty frustrating for me cause I spent a bit of time, making this shape. I hope I'm missing something simple... just if I wanted from the known, that he was going to be it's boring I would of just made the shape in illustrator.

    Thanks for the help

    You have all your forms in a separate shape layer.

    Copy and paste all the paths in the form of a unique shape layers.

    Then in a single shape layer select all the paths and make your group.

    This:

    becomes this:

  • Math.Round question

    I'm looking to use math.round to round a decimal number double and then eliminate any leakage zero.

    What I have in a button field runs a javascript script returns "undefined". Change the original.value result.value passes the value for the second field, but before conversion to two decimal places. Using text fields without designating a specific format automatically removes the zeros on the right.

    original var = this.getField ("Text3")
    var result = Math.round(original*100)/100

    getField("Text5").value = result.value

    Well, you keep this way, and in line 3 result.value lead change. Only field objects have a value property, and the result is not a field property.

  • We just do the last update on Photoshop - that's why whenever we now open photoshop you have to select all the toolbars we want.  They used to be there for example, layers, tools, colors, etc., but now, we have to select each time

    We just do the last update on Photoshop - that's why whenever we now open photoshop you have to select all the toolbars we want.  They used to be there for example, layers, tools, colors, etc., but now, we have to select each time

    You look at the new start screen and files recent screen.  Press ESC to return to your usual workspace.

  • by selecting the shape layers photoshop 2015

    Hello

    Today upgraded to photoshop 2015,

    In my work, I use a lot of pen / combined with normal layers of shape layers

    Normally I use the path Selection tool to select my layers of path, but since the new update

    I can, select t them more also not with the right mouse click on, so it's a little frustrating

    to find my diapers, anyone experience the same problem or someone knows how to do things in 2015.

    Thnks,

    Set the selection tool of the path to "all layers".

  • Not appearing is not in the shape layers panel

    Hello

    I'm new to PS CS5, when I create a vector shape with the pen tool or rectangular selection tool etc. the form does not appear in my layers panel.

    Is this a normal behavior?

    If this is the case, how I reselect a form after that I did?

    TIA,

    Andy

    Looks like you can either create forms using the vector path tool. There are 2 buttons on the top left of the toolbar. Spending paths to the "shape layers" and you should see them. See screenshot.

Maybe you are looking for

  • Two sent messages in the sent box

    Whenever I have someone send an email, there are two the same message in the Outbox. Why? I send only one, but I see two. Have attempted to drop Thunderbird, erased all the appdata, always the same. Tried just about everything... What have I done wro

  • Can I upgrade my CPU now?

    Hey everybody: I think the upgrade of my compact dc7800 mini tower CPU of the current E4500 @ 2.20 GHz, for an E8500 3.16 GHz These chips are only $15, should I do it? (I already use graphics Radeon HD 6570 and 4 GB of DDR2 RAM at 333 MHz) The E8600

  • Do not understand why "the node fpga Audio IN Terminal is 16-bit signed integer"?

    Hello I work with myRIO 1900 for my project of ANC. Audio IN of the fpga node gives its type terminal data as integer signed 16-bit. So, finally the exit on the nodes of the fpga is fluctuating between two values - 1 and 1. But I want the actual valu

  • How to get a torque wrench in labview data?

    I have a torque wrench N.I. and need to export data when you perform a calibration for (labview to) and get the program show me if the couple is correct or not. I don't know how to start... I really need support. an example would help. Thank you... B

  • How to make the dvd on my computer?

    Remember - this is a public forum so never post private information such as numbers of mail or telephone! Ideas: You have problems with programs Error messages Recent changes to your computer What you have already tried to solve the problem