How to Fix the Error “After Effects Error D Returned Invalid Max Result”
Like the last post I made, this article is about how to fix a common error that occurs when using some effects in Adobe After Effects, a software for creating motion graphics and visual effects. The error message is “After Effects Error D Returned Invalid Max Result”, and it means that the effect cannot process the image data correctly and stops the rendering process. Rendering is the process of generating the final output of your project, such as a video or an image.
This error can be very frustrating and time-consuming, especially if you are working on a complex or large project. It can also affect the quality and creativity of your work, as you may not be able to use the effects you want or need. Therefore, it is important to know how to fix this error and prevent it from happening again.
In this article, I will explain some of the common causes and solutions for this error, and how to apply them in After Effects. I will also show you some examples of how to fix the error using different effects and footage. By the end of this article, you will be able to:
- Identify the cause of the error by disabling or removing the conflicting effects
- Disable or reduce the hardware acceleration options in the preferences or the project settings
- Pre-render the layer with the problematic effect and use the rendered file instead of the original layer
- Check and convert the footage properties to match the project settings
There are several possible causes and solutions for this error, depending on the situation and the effect involved. In this article, I will explain some of the common causes and solutions for this error, and how to apply them in After Effects. I will also show you some examples of how to fix the error using different effects and footage. I will assume that you already know the basics of creating and using tools in After Effects, such as layers, compositions, keyframes, masks, and so on. If you are not familiar with these concepts, you can check out some tutorials online or in the help menu of After Effects.
Cause 1: The Effect is Using Too Much Memory or GPU Resources
One cause of this error is that the effect you are using is using too much memory or GPU resources, and cannot handle the large image size or resolution of your project. This can happen with effects that use hardware acceleration, such as H.264 encoding, or effects that create complex calculations, such as Keylight or Deep Glow. Hardware acceleration is a feature that allows some effects to use the GPU (graphics processing unit) of your computer to speed up the rendering process. However, sometimes the GPU can run out of memory or power, and cause the error.
Solution 1: Disable or Reduce the Hardware Acceleration Options
A possible solution for this is to disable or reduce the hardware acceleration options in the preferences or the project settings of After Effects. This will make the effect use the CPU (central processing unit) of your computer instead of the GPU, which may be slower but more stable. To do this, follow these steps:
- Go to the Edit menu and select Preferences. Alternatively, you can press Ctrl+Alt+; on Windows or Command+Option+; on Mac.
- In the Preferences window, select Video Preview on the left side.
- On the right side, under GPU Information, uncheck the box that says Enable Mercury Transmit. This will disable the hardware acceleration for the video preview in After Effects.
- Click OK to save the changes and close the window.
- Go to the File menu and select Project Settings. Alternatively, you can press Ctrl+Alt+Shift+K on Windows or Command+Option+Shift+K on Mac.
- In the Project Settings window, select Video Rendering and Effects on the top.
- On the bottom, under Use, select Mercury Software Only from the drop-down menu. This will disable the hardware acceleration for the rendering process in After Effects.
- Click OK to save the changes and close the window.
Now, try to render your project again and see if the error goes away. If it does, then the problem was caused by the hardware acceleration. However, if the error still persists, then you may need to try another solution.
Solution 2: Pre-render the Layer with the Problematic Effect and Use the Rendered File Instead of the Original Layer
Another possible solution for this is to pre-render the layer with the problematic effect and use the rendered file instead of the original layer. Pre-rendering is the process of rendering a part of your project and saving it as a separate file, such as a video or an image. This can save memory and speed up the rendering process, especially if you are using a lot of effects or layers. To do this, follow these steps:
- In the Timeline panel, select the layer with the problematic effect. For example, let’s say you are using the Deep Glow effect on a text layer, and you get the error message.
- Go to the Composition menu and select Pre-render. Alternatively, you can press Ctrl+Shift+/ on Windows or Command+Shift+/ on Mac.
- In the Render Queue panel, under Render Settings, click on the Best Settings link. This will open the Render Settings window.
- In the Render Settings window, under Quality, select Best from the drop-down menu. This will ensure that the pre-rendered file has the highest quality possible.
- Under Resolution, select Full from the drop-down menu. This will ensure that the pre-rendered file has the same resolution as your project.
- Click OK to save the changes and close the window.
- In the Render Queue panel, under Output Module, click on the Lossless link. This will open the Output Module Settings window.
- In the Output Module Settings window, under Format, select a format that is compatible with After Effects, such as QuickTime or AVI. This will ensure that the pre-rendered file can be imported and used in After Effects.
- Under Video Output, make sure that the Channels option is set to RGB + Alpha. This will ensure that the pre-rendered file has transparency, which is important if you want to use it on top of other layers.
- Click OK to save the changes and close the window.
- In the Render Queue panel, under Output To, click on the Not yet specified link. This will open the Save As window.
- In the Save As window, choose a location and a name for the pre-rendered file. For example, you can name it Deep Glow Pre-render.mov and save it on your desktop.
- Click Save to save the file and close the window.
- In the Render Queue panel, click on the Render button. This will start the pre-rendering process, which may take some time depending on the size and complexity of your layer and effect.
- When the pre-rendering process is done, you will see a Done message next to the file name in the Render Queue panel. You can also check the file on your desktop and see if it looks good.
- Go back to the Timeline panel and delete the layer with the problematic effect. You don’t need it anymore, since you have the pre-rendered file.
- Go to the File menu and select Import. Alternatively, you can press Ctrl+I on Windows or Command+I on Mac.
- In the Import File window, locate and select the pre-rendered file that you just saved. For example, Deep Glow Pre-render.mov on your desktop.
- Click Open to import the file and close the window.
- In the Project panel, drag and drop the pre-rendered file to the Timeline panel, on top of the other layers. You can also adjust the position and timing of the pre-rendered file to match your project.
- Now, try to render your project again and see if the error goes away. If it does, then the problem was caused by the problematic effect, and you have fixed it by pre-rendering it.
Cause 2: The Effect is Conflicting with Another Effect on the Same Layer or a Different Layer
Another cause of this error is that the effect you are using is conflicting with another effect on the same layer or a different layer. This can happen when using multiple effects that use the SmartFX pipeline, a feature that allows effects to share image data and improve performance. However, sometimes one effect can prevent another effect from accessing the image data, resulting in the error. For example, let’s say you are using the Keylight effect to remove the green screen from a footage layer, and then you apply the Glow effect to make the footage look more bright and shiny. However, the Keylight effect may block the Glow effect from accessing the image data, and cause the error.
Solution 1: Disable or Remove the Conflicting Effect and See if the Error Goes Away
A possible solution for this is to disable or remove the conflicting effect and see if the error goes away. This will help you identify which effect is causing the problem, and decide whether you need it or not. To do this, follow these steps:
- In the Timeline panel, select the layer with the conflicting effects. For example, the footage layer with the Keylight and Glow effects.
- In the Effect Controls panel, click on the fx icon next to the effect name to disable it. For example, click on the fx icon next to Glow to disable it. You can also press Shift+E to toggle the effect on and off.
- Try to render your project again and see if the error goes away. If it does, then the effect you disabled was causing the problem. You can either remove it completely by selecting it and pressing Delete, or try to adjust its settings to make it work with the other effect. For example, you can try to lower the Glow Intensity or Glow Threshold values to reduce the effect of the Glow effect.
Solution 2: Change the Order of the Effects or Apply Them to Different Layers
Another possible solution for this is to change the order of the effects or apply them to different layers. This can help you avoid the conflict between the effects and make them work together. The order of the effects matters, because it determines the order in which they process the image data. For example, if you apply the Keylight effect first and then the Glow effect, the Glow effect will use the image data after the Keylight effect has removed the green screen. However, if you apply the Glow effect first and then the Keylight effect, the Keylight effect will use the image data before the Glow effect has added the brightness and shine. This can make a difference in the final result and the performance of the effects.
To change the order of the effects, follow these steps:
- In the Timeline panel, select the layer with the conflicting effects. For example, the footage layer with the Keylight and Glow effects.
- In the Effect Controls panel, click and drag the effect name to move it up or down in the list. For example, you can drag the Glow effect above the Keylight effect, or vice versa. You can also use the keyboard shortcuts Ctrl+Shift+Up or Ctrl+Shift+Down on Windows, or Command+Shift+Up or Command+Shift+Down on Mac, to move the effect up or down in the list.
- Try to render your project again and see if the error goes away. If it does, then the problem was caused by the order of the effects. You can also compare the results and see which order gives you the best outcome.
To apply the effects to different layers, follow these steps:
- In the Timeline panel, duplicate the layer with the conflicting effects. To do this, select the layer and press Ctrl+D on Windows or Command+D on Mac. You will see a copy of the layer above the original layer.
- In the Effect Controls panel, disable or remove one of the effects from each layer. For example, you can disable or remove the Keylight effect from the original layer, and disable or remove the Glow effect from the duplicate layer. This way, each layer will have only one effect applied to it.
- In the Timeline panel, change the blending mode of the duplicate layer to Add. To do this, click on the drop-down menu next to the layer name and select Add. This will make the duplicate layer blend with the original layer and create a composite image.
- Try to render your project again and see if the error goes away. If it does, then the problem was caused by the conflict between the effects. You can also adjust the opacity or the mask of the duplicate layer to fine-tune the result.