Problem with sampleImage in after effects CC 2015 (Extendscript / Expressions)

I have a weird problem with a script that adds and uses an expression containing sampleImage.

The script is intended to add a 'color control' for the selected layer, sample a pixel given RGBA value and this value is used.

I test this with a red pure solid.

Here's the script in a basic form:

var myComp = app.project.activeItem;

var selectedLayer = myComp.selectedLayers[0];

var addColorControl = selectedLayer.Effects.addProperty("Color Control");

var expr = "sampleImage([0,0], [0.5,0.5], true, (time+0));";

addColorControl.property(1).expressionEnabled = true;

addColorControl.property(1).expression = expr;

var res = addColorControl(1).value;

$.writeln(addColorControl(1).value);

After effects 2014, he wrote the following in the console:

1,0,0,1

Which is correct for the solid red.

But after effects 2015, the exact same script and circumstances (solid red), gives this answer:

0,0,0,0

However, if after I run the above script I then run this:

var myComp = app.project.activeItem;

var selectedLayer = myComp.selectedLayers[0];  

var getColorControl = selectedLayer.Effects.property(1);

$.writeln(getColorControl(1).value);

It prints the correct answer to the console:

1,0,0,1

As I said, it works very well in the previous version of the AE (2014), but not in the current version. This works not just some great scripts that I use, and it would be nice to be able to use it in the latest version has crippled.

Anyone has any ideas on this subject?

It reads like a bug.

To 13.5, we changed sampleImage to work asynchronously in some cases (so sometimes in the AE UI you will notice the 0,0,0,0 with a gray color value, which means the sampleImage is actually calculated).

But this is _not_ a case where sampleImage should be allowed to run asynchronously.

> However, if after I run the above script I then run this:

It probably works because it causes a delay, and at the time wherever it is done, output from sampleImage returned the expected result.

A work around is simply insert a .sleep $(1000), but maybe it's not 100% foolproof.

Tags: After Effects

Similar Questions

  • My (not so great) experience with Premiere Pro & after effects CC 2015 after barely a day of use.

    Right off the bat, let me say that I wish that I had not being updated until 2015 CC this morning. I blame the hype and all the exciting videos, showing off the new features to deceive me in...

    After waiting more than an hour to install everything on my Mac at work, I fell quickly on the first question when continuing on a CC 2014 project in Premiere Pro. The project has had some 4K footage with clips made in them, who I pre-rendered for an obvious reason: smooth playback. Who had worked perfectly fine in CC 2014. But in 2015, CC, it didn't yet... at all. Reposting clips did not cause to run any tool path smoothing, nor did lower the playback quality, even at 1/16 of the resolution (while in 2014 CC that would be more than enough to cause a perfect playback).

    For the same project I also need to do some work in some After Effects comps. So I opened my project and immediately, I noticed that my keyboard pressings were not record 9 of 10 times. I don't think I have to explain why this is especially annoying (and why I went to pounding my keyboard with my fists...).

    As if this was not frustrating enough, mounting Panel started to act up and remained permanently in the foreground, whenever I started a RAM Preview (I use a Setup dual monitor and my editing panel occupies essentially the right monitor). There is no way to make any application to the foreground while RAM previewing, so I ended up having to drag my editing about Panel out of the screen.

    Also, is there a way to stop the new RAM made preview? I don't know it is because of the issue of keyboard or that there simply cannot stop, since the SPACEBAR and '0' on the numeric keypad does not a billion times another thing that frustrate me even more.

    To top it off, I had to also motion-track one, and you have probably guessed Cela has also worked like a charm! * Cough *. Follow-up went well, but as soon as I tried to stop the analysis and you press the stop button, After Effects simply crashed.

    So yes, it was about my day at work. How was yours?

    Allright,-all right, I'll get to the point; Where and how do I go back to CC 2014?

    I'm done trying to force on my eyeballs to the frustration, I'll give CC 2015 another chance when these problems are solved.

    Thank you

    Rick

    Hi Daniel,.

    I've been looking around on the Forum and just found an easier way to do this via the updater of creative cloud itself:

    How to find and install a previous Version of Adobe Apps in CC 2015 | Adobe Customer Care Team

    The good thing is that I can now run the 2014 and 2015 versions without uninstalling one or the other.

    Thanks a lot for the tip and the response if!

    As for the issue of the first reading, I discovered that changing the rendering option in the project settings of the "GPU accelerated" for "software only" caused much less frame drops. This means that I can actually work with the 2015 first CC version! I'll stick however for now to the CC 2014 After effects version.

  • Problem with exporting from After Effects

    Hello everyone,
    I exported a video media of first cs5 windows (it was shot with the Canon 7 d).
    Video 1 video channel, 1 audio channel that contains a conversation and another audio channel that contains only music.
    After that I exported it, I imported the video into After Effects cs5, I added a few effects, and then I exported it as a video windows media.
    The audio settings are:

    Music mode
    voice audio codec windows meida 9
    audio format 20 Kbps, 22.05 khz, mono

    Even if the video of the first has been flawless, that of After Effects contains the conversation perfectly, but the music is very low and even erratic.

    Anyone encountered this problem?

    Use the audio compressed in AE. Use the ordinary WAVs and their depth of rate and little match native plug of your audio hardware, so AE not needd to resample and 'mix' it consistent for playback.

    Mylenium

  • Hi, I have a problem with after effects CC 2015

    Hello!

    I installed Adobe after effects CC 2015 as trial and when AF starting a message pops up saying: the faled asks to initialize properly (0cx000001d). Click OK to close the application.

    How can I solve this problem?

    Thank you!

    You must install Service Pack 1 for Windows 7

  • After effects CC 2015 (13.5.1) made problem or export ProRes 444

    Hi, I have after effects CC 2015 (13.5.1) installed on Mac OSX El Capitan, whenever I visit (export) a size model 720 x 576 with Apple ProRes 444 with Alpha my software crashes, gives me an error

    "< ExporterQuickTimeHost > < 5 >.

    Get QuickTimeCodecChunkingInfo return maxChunk

    = maxFrame = 2097152 458752 "

    Someone can help me fixing this problem. I'm doing a size model 1920 x 1080 with the same settings and the same codec, it renders perfectly. This problem never happened with OSX Yosemite. Help, please

    Thanks in advance

    FYI: The AfterEffects CC2015 13.6 update solved the problem of crash of ProRes described above!

  • I can not download after effects CC 2015 compared with clouds Creative

    I'm trying to download after effects CC 2015 compared with creative clouds but everytime I try the download of rises to about 45 percent, and it just says failed to install. When I click on more information to show me this:

    Exit code: 15

    Please see specific errors below for troubleshooting. For example, ERROR: DW051...

    -------------------------------------- Summary --------------------------------------

    -0 fatal Error (s), 2 error (s)

    ERROR: DW051: dependence of session support {147EC100-14BE-45EF-AB42-35BAEE7D02F0} DVA Adobe after effects CC 2015 13.5.0 has changed.

    : Error Media DB: 12

    -------------------------------------------------------------------------------------

    Any help would be appreciated.

    I've got it's working now, thanks for the help.

  • After effects CC 2015.3 Crash when I use Fast AMD R7 2 265 project option

    Hello

    After that effects CC 2015.3 crash when use fast project option.

    3.jpg

    Here's a video recording to clarify my problem.

    After Effect does not not using a quick project on Lenovo E550 with Amd R7 M265 - YouTube

    After effect use the Intel HD Graphics 5500 built in graphics card and good work.

    When I go to the quick option project aftermath addresses do not at all. Please help me.

    Kind regards

    Ashour

    Specifications:

    Lenovo Thinkpad E550 with AMD R7 M265 2G

    Processor Intel® Core™ i7

    Windows 10 pro x 64

    Intel® HD graphics card

    AMD Radeon R7 M265 2 GB

    DDR3L 1600 MHz 8GB

    15.6 "HD 1366 x 768 200 nit glare

    Webcam HD 720 p with micro double, optional

    240 Samsung SSD HARD drive

    Double Bay Microphone

    Headset/Microphone combo Harbour

    Dolby® Advanced Audio

    Up to 9 hours (internal battery 48 w/h)

    Gigabit Ethernet, b/g/n or a/c, WIFI

    Hello

    Finally fast project after effects CC 2015 option and here works on a video recorded for it.

    Quick project overview the Option works on legacy CC 2015 On AMD R7 M265 2 G - YouTube

    I think that there is a problem with the last after CC 2015.3 effect, I hope that adobe can fix for other perhaps users that they have the same problem and they want to use the last legacy CC 2015.3.

    Now I have just 4 days to try after effect, and unfortunately I can not buy it and Yes, after effect is an excellent program to design the query.

  • After effects CC 2015 crashes at 68% update - no reason given.

    After effects CC 2015 crashes at 68% update - no reason given. I can restart the Mac Pro and try again with exactly the same results. What is an Adobe problem? After effects CC 2015 still works fine on my computer, but there is something in the update which is a bug or a stranger. Adobe is working to fix this?

    Hi AudioEditor,

    Please see the links below:

    Error in downloading, installing or updating Adobe Creative Cloud applications

    Do not install updates | Failure of the update or U44M in Adobe Photoshop CS6 errors

    "Installation failed" error U44M1P7 with Adobe Creative Cloud or updates of Adobe Creative Suite 6

    Let us know if that helps.

  • Lack codec h264 in after effect CC (2015)

    Hello.

    Miss me the h264 codec in after effect CC (2015). the problem persists for about a year. I have this codec in first pro, but not after the effect. What can I do?

    After effects encodes is more directly in H.264 (he didn't do a great job of it in the past). You can return an intermediate codec to EI or send your AE comp directly to Adobe Media Encoder.

    I almost always rendering directly to EI. This is because AE CC 2014 multiprocessing. So, I'll work in 2015 CC to enjoy snappier interface and open the project file in CC 2014 to make with multiprocessing (as my system can use this feature very well in most of the projects).

    Here's the Adobe blog about uninstalling: using Adobe Media Encoder to create H.264, MPEG-2 and WMV videos get out of After Effects

    If you talk to a lot of Veterans around here, they will say that the AE h.264 encoder was buggy and did not do a good job. They call deletion "good riddance." The AE team is small enough, so put their resources to improve the work of EI to VFX compositing and motion graphics, and leave the team work Adobe Media Encoder encoding of things seems logical.

  • After effects CC 2015 (13.6.0) Undo does not work properly

    I have problem with cancellations. Undo does not work properly

    13.6.0.165

    Win 10 64-bit

    NVIDIA Gtx 970

    4770 K I7

    Does anyone have the link to update to fix after effects CC 2015 (13.6.1)?

    I can't wait for approval for the first version that I just applied.


    The update of the corrections after effects CC 2015 (13.6.1) is available. It fixes several bugs, including one in discussion on this topic.

    Details: http://adobe.ly/1QqMMc6

    Let us know how things work after installing the update.

  • After effects CC 2015 views only update

    Hello

    2015 CC running on windows 7 64 bit. Had this problem sometimes in cc before but apparently two more bad times with 13.6 update.

    Whenever I make a change in the timeline (no change) it seems a little bit of roulette or not display window will update, especially if trying to undo. A change in the parameters of resolution for the preview window will be temporarily to refresh the view, but changing the resolution seems to return to the display of updated cache managers obsolete. Purge the cache has no effect either. So far, the only solution seems to be a restart of After Effects which then update with the correct view.

    Before all this happens sometimes there's the caveat 'strange situation 0/1 '.

    Any help much appreciated, working in delays and having to restart After Effects each time that you make a keyframe or changing a diaper is obviously frustrating!

    The update of the corrections after effects CC 2015 (13.6.1) is available. It fixes several bugs, including one in discussion on this topic.

    Details: http://adobe.ly/1QqMMc6

    Let us know how things work after installing the update.

  • After effects CC 2015 (13.6) hangs at startup &lt; 140735107916544 &gt; &lt; GPUManager &gt; &lt; 2 &gt; Sniffer result Code: 7

    After effects CC 2015.1 (13.6) crashes on startup. GET after effects last Log Alert Message: < 140735107916544 > < GPUManager > < 2 > Sniffer result Code: 7

    > after spending 3 hours online with Adobe support, their recommendation was to restore the previous version. This apearently is a known problem

    The known issue is with versions of Mac OS x v10.10 before 10.10.5. If you use Mac OS x v10.10, then installing the 10.10.5 update is the recommended first step. Apple has some bug fixes in this version on the GPU.

  • After effects CC 2015 stutters / small freezes in performance

    I installed after effects CC 2015 on a Mac Pro and constantly, it freezes and stutters. It does not crash, it's just that everything I do stutters. Through menus just stops and then continues, stops and continues. It's very frustrating and nothing in the settings change work experience. Just to clarify, there is NO software crashes, it is the performance of work which is like an experience "stop and go". Does not work like that at all. Does not matter if I content in a project, a project of own always like that.

    I managed to get to the bottom of my problem. I had an older version of installed Colorista which is somehow incompatible with CC 2015; It has also caused Media Encoder 2015 crashing, and when I removed it, AE 2015 started acting normally.

  • Sound works in preview, but not when I made the video output! :( [ADOBE AFTER EFFECTS CC 2015]

    Hey!

    I'm pretty new to Adobe after effects CC 2015. I have a video that is about a minute, everything works as it should when I preview the it. But when I visited, with the right settings, the sound will not be rendered.

    So basically I can hear all the sONFERENCES when I saw it, but when I make it I cannot here any sound at all. I tried to get the sound on Auto and on. But nothing works.

    gg.png

    And Yes, some of the mp4 files I use for audio as well, but will not play the file audio mp3 or another. Some would like to help! I've had this problem for a few days now!

    We have a solution for this in the update after effects CC 2015 (13.6):

    http://Adobe.LY/1MVxHgX

    Try it and let us know how it works for you.

  • I get errors after effects CC 2015, Media Encoder, and also Cineware

    Hello

    I have problems with 2 things.  First of all, when I try to go to Adobe Media Encoder I get the following error:

    after effects media encoder error.PNGafter effects media encoder error2.PNG

    It works perfectly well first Pro CC.  If I open Media encode and import a legacy file that works fine as well.

    And when I try to create new cinema 4 D file:

    after effects cineware error.PNG

    There is NO movie theater that installed 4 d I can see on my system - where it is and how to download?  I tried to use import Photoshop 3D, but apparently we cannot do that more with CC?

    System: Windows 7

    Thanks in advance

    Dave

    The update fixes after effects CC 2015 (13.5.1) and Adobe Media Encoder CC 2015 (9.0.1) update are available: http://adobe.ly/1Il5JYe

Maybe you are looking for

  • Firefox crashes whenever I try to leave a page to a different site.

    It seems to happen only when I have more than one tab open, but everytime I try to leave the page initially opened, it crashes. This just started today (03/19/14) and I tried to reset Firefox but it did not remedy the problem.

  • iOS 9.3 / iPad2

    Hello. My iPad2 updated on the night of March - 22 and the morning could not activate. The message said: "your iPad could not be activated because the activation server is temporarily unavailable. Try to connect your iPad to iTunes to activate it, or

  • Why my Facebook page was scared without asking me it? Why don't my cursor "disappears" sometimes when I'm e-mailing or posting?

    I was on my Facebook page and the "rail" to shrink or expand the page appeared without any reason. All of a sudden then shrunken page if little, that I can't read it yet. Also, sometimes when I'm emailing or detachment, the cursor disappears. No matt

  • Hard drives - power

    Good evening I have a pavillion a6485.it desktop pc with windows 7 32 bitI'm going to buy a secondary internal hard drive for backup and expansion, but I have a doubt... the installed 300W power supply is the owner of the load on the system? Connect

  • Two-way sync with Google Apps Gmail/Verizon blackBerry smartphones does not

    To navigate on this forum, I see the two-way synchronization of read/delete messages with Gmail should work since early May. However, I was never able to get the two-way synchronization works successfully on my BlackBerry. (I have a Storm 9530 with V