Pixel Bender and aeUIControls

Posted on 05. Sep, 2009 by Jerzy Drozda Jr in Blog

After publishing Introduction to Pixel Bender tutorial where I showed you guys how to build a simple cropping plugin I got a lot of emails and comments asking specifically how to create certain types of parameters in Pixel Bender code that show up in After Effects as Angle Control, Checkbox and other UI elements, so I’ve decided to create this small list for you to help you out with this. If you don’t want to read the entire post just download the provided zip for some examples.

Download: UI Controls Demo (After Effects CS4)

Basic controls
Here’s a list of basic user interface controls that look pretty much the same as expression controls.

  • Angle Control
    You don’t need to set up minValue and maxValue attributes, because they are ignored in this case. Besides it wouldn’t make much sense, would it?

    parameter float myAngle
    <
    defaultValue: 0.0;
    aeDisplayName: "My Angle";
    aeUIControl:"aeAngle";
    >;

  • Checkbox Control
    Checkbox only returns true or false values (on and off), so it also does not need minValue and maxValue attributes.

    parameter bool myCheckbox
    <
    defaultValue: false;
    aeUIControl: "aeCheckbox";
    aeDisplayName: "My Checkbox";
    >;

  • Color Control
    This is valid as a float3 and float4 variable type, however After Effects uses float4data type (RGBA). Even though the color picker dialog does not allow you to define the alpha value of the color you’re defining it makes much sense to use the float4 instead of float3. Defining minValue and maxValue also makes no sense in here.

    parameter float4 myColor
    <
    defaultValue: float4(1.0, 0.0, 0.0, 1.0);
    aeUIControl: "aeColor";
    aeDisplayName: "My Color";
    >;

  • Point Control
    This is one out of two very specific controls. As you see in the code below it does not have minValue and maxValue attributes just like the examples above, but it’s also missing the defaultValue attribute. Instead theres aePointRelativeDefaultValue attribute. The key word here is “relative” because the the values are not pixel coordinates. They represent a point that is relative to the image size. For instance, value of float2(0.5, 0.5) would set the default position at the middle of the layer. However – this relative position is converted to pixel coordinates in After Effects and then those values are being used by your Pixel Bender code.

    parameter float2 myPoint
    <
    aePointRelativeDefaultValue: float2(0.0, 0.0);
    aeUIControl: "aePoint";
    aeDisplayName: "My Point";
    >;

  • Slider Control
    This is the most basic control you can have. No need to explain how it works. Just look at the code below. Explains itself.

    parameter float mySlider
    <
    minValue: 0.0;
    maxValue: 100.0;
    defaultValue: 0.0;
    aeDisplayName: "My Slider";
    >;

Additional controls
There are also some things that you can’t do with expression controls.

  • Percent Slider Control
    It works exactly the same as the regular slider, but the display format of the value is in percentage.

    parameter float myPercent
    <
    minValue: 0.0;
    maxValue: 300.0;
    defaultValue: 0.0;
    aeUIControl:"aePercentSlider";
    aeDisplayName: "My Percent";
    >;

  • Popup Control
    This you won’t find in the Expression Controls group. It creates a dropdown menu with the predefined values. String values are held in the aePopupString attribute, but if you want to create an if statement in your Pixel Bender code than treat it as a regular array and check against index values. In this example Red is 0, Green is 1, and Blue is 2. Remember to define minValue and maxValue.

    parameter int myPopup
    <
    defaultValue: 0;
    minValue:0;
    maxValue:2;
    aeUIControl: "aePopup";
    aePopupString: "Red|Green|Blue";
    aeDisplayName: "My Popup";
    >;

  • One Channel Color Color
    I guess this one could be handy in some cases, but so far I had no use for it. This works and looks just like a slider with one difference: if you do not provide minValue and maxValue attributes then they will be based on the bit depth of your project. I guess it could be used as a threshold parameter, but if you ask me it makes no sense. For 8bpc the minValue would be 0, and maxValue would be 255. Ok. But in 32bpc I’d expect to be able to go beyond 1.0 on the slider (unlimited maxValue), however in order to do that I’d have to define the minValue and maxValue on my own, and this defeats the purpose.

    parameter float mySingleColor
    <
    defaultValue: 0.0;
    aeUIControl:"aeOneChannelColor";
    aeDisplayName: "My Simgle Color";
    >;

What about Layer Control?
Basically there isn’t one. In order to be able to pick another layer you need to create an additional source in the kernel. After Effects will allow you to use as many additional sources as you like, however Pixel Bender Toolkit only allows two sources, so you will only be able to test your code in After Effects. The big downside is that you can’t add any metadata for this additional source, so it will always show up in the user interface as “Input 2″, “Input 3″ and so on.

input image4 src1;
input image4 src2; // layer control - sort of...
output pixel4 dst;

How does it translate to graphs?
It’s all very similar, although it takes some time to figure out. Instead of listing all the parameters again in this post I’ve decided to give you two Pixel Bender files to look at. One is a simple kernel, and the other is a simple graph. Both of the files to exactly the same thing… nothing.

Download: UI Controls Demo (After Effects CS4)

  • Twitter
  • Facebook
  • LinkedIn
  • StumbleUpon
  • Digg
  • Technorati
  • del.icio.us
  • Google Bookmarks
  • Wykop
  • Reddit
  • email
  • Print

Tags: ,

61 Responses to “Pixel Bender and aeUIControls”

  1. Tom Hauville

    05. Sep, 2009

    again, very awesome and useful info! I’m going to bet that the AE community sees a sudden flood of PB plugins, due to your efforts!

    Reply to this comment
  2. blankman

    05. Sep, 2009

    cool stuff, thanks a lot!

    Reply to this comment
  3. Dextrmania

    05. Sep, 2009

    Hey maltaannon to be honest with u i didnt like u the first time i checked out ur tutorials here but when i purchased MILG5….man,what r u?beleive it or not man,u r the best in after effects i wonder how good results u were scoring in maths in ur high school!!!

    Keep it up man pls,keep it up….

    Reply to this comment
  4. AndrewYY

    05. Sep, 2009

    it’d be awesome if we could customize input2 with metadata (like aeDisplayName).

    Reply to this comment
  5. Dextrmania

    06. Sep, 2009

    i have one question out of this topic maltaannon…its coz i think ur head is on this post that im asking u in this comment area.
    can u wiggle the opacity of a layer so that it is opaque at some parts of the and transparent at the others?for example lets say we have many boxes lined up and arranged so they all fit in the composition size exactly(5*5).
    can i randomly make their opacity change,but only from 0 to 100 so that they r not half opaque or so?and then use that as a mask.pls help me with this.

    Reply to this comment
  6. cheap handbags

    09. Jul, 2010

    notice me!

    Reply to this comment
  7. maximumrfan

    01. Sep, 2010

    Is it possible to bunch some controls into groups like say one group being angle controls, another group being some slider controls?

    Reply to this comment
  8. Chris Forrester

    16. Feb, 2011

    Great stuff just what I have been looking for. Some of the examples from the Pixel Blender manual have not been working for me or giving errors when I have copied and pasted them. Great to know there is this source of information that I know works.

    Hope to be making my own small utility plugins soon!!

    Just a shame I am behind the times on such a great tool.

    Many Thanks!
    -C

    Reply to this comment
  9. air max 2011

    23. Jun, 2011

    very good,look http://www.airmaxdiscount.net may get you a surprise.

    Reply to this comment
  10. air max 2011

    09. Jul, 2011

    perfect,more and more people like you post.

    Reply to this comment
  11. air max 2011

    21. Jul, 2011

    PERFECT,www.nikeairmaxdiscount.net

    Reply to this comment
  12. lar

    23. Jul, 2011

    I can’t believe how much I don’t know. Thank you give me more information on this topic you. I am really grateful and touched.

    Reply to this comment
  13. Name (required)

    09. Aug, 2011

    Thanks for your great post.I gonna be back definitely to check the new.
    It is great that something interesting here could be found.Excellent work!

    Reply to this comment
  14. sac à main

    27. Aug, 2011

    Your essay is good, I like it very much. Here I would like to share with you some things
    Replica Handbags: http://www.replicabagsell.com

    Reply to this comment
  15. dfvdrfe

    03. Sep, 2011

    From 1968,since the establishment of The North Face,the high quality feather winter jackets in The outdoor sports lovers enjoy great popularity,especially SIERRA PARKA by the love of the climbers down.SIERRA PARKA of winter coats series products originate in the 1970 s,so far SIERRA PARKA series winter clothes products are still in down and sales.

    Reply to this comment
  16. dsadaewed

    03. Sep, 2011

    Celine bags and the new arrivals of celine handbags are always designed by its creative director Phoebe Philo who wishes to express a contemporary minimalist style through these celine luggage series.Here is the celine 2011 bags for you.

    Reply to this comment
  17. green laser pen

    05. Sep, 2011

    Thanks for posting! I really enjoyed the report. I’ve already bookmark this article.http://www.elaserpen.com

    Reply to this comment
  18. マジコン

    07. Sep, 2011

    Thanks for great sharing with us,i will tell more of my friends about it

    Reply to this comment
  19. belstaff leather jacket

    10. Sep, 2011

    Thanks for great sharing with us,i will tell more of my friends about it http://www.belstaffleatheroutlet.com

    Reply to this comment
  20. moncler uomo

    13. Sep, 2011

    I bought a discount moncler uomo yesterday.

    Reply to this comment
  21. moncler men

    13. Sep, 2011

    Thanks for great sharing with us,i will tell more of my friends about it

    Reply to this comment
  22. moncler jassen

    29. Sep, 2011

    Come on. look at the moncler dames. Go to buy some.

    Reply to this comment
  23. sito moncler

    30. Sep, 2011

    I bought a discount moncler stivali yesterday.

    Reply to this comment
  24. Marius

    01. Oct, 2011

    Hi!
    Very useful info, really helped me.
    I would like to ask, like maximumrfan asked before, is it possible to create groups of controls? It would be really nice if you answer. Thank you.

    Reply to this comment
  25. Ken Griffey Shoes

    08. Oct, 2011

    Strong support from the pillars of the bridge would not fall a hundred years, tenacious support from the roar Benz rail train. Because they have benefited from the support structure of the triangle.

    Reply to this comment
  26. canada goose

    15. Oct, 2011

    Fashional canada goose just show yourself now.

    Reply to this comment
  27. cheap Canada Goose

    18. Oct, 2011

    your blog!
    So shocking and great! Just one suggestionrvb fd

    Reply to this comment
  28. shuijin

    18. Oct, 2011

    Reply to this comment
  29. ugg-schoenen

    20. Oct, 2011

    http://www.ugg-schoenen-nl.com Nieuwe uggs schoenen amsterdam

    Reply to this comment
  30. Moncler Jassen

    20. Oct, 2011

    http://www.jassenmoncleronline.com shop in Belgium. Kopen Moncler Jassen,jas,Polo,muts,laarzen,tassen,vest,truien online. tot 85% korting, gratis verzending! Modieus Heren|Dames|kinderen kleding jassen moncler online

    Reply to this comment
  31. Reply to this comment
  32. Moncler Online

    27. Oct, 2011

    Amsterdam jassen moncler dames online,
    2011 Nieuwe moncler jassen online kopen,
    Goedkope Moncler Dames Jassen,

    Fashion kleding Winter moncler online winkel,
    2011 Moncler Amsterdam verkoop,
    Modieus jassen moncler online,

    Fashion kinderen kleding Winter moncler kinderen,

    Goedkope Moncler Heren Jassen,
    http://www.jassenmoncleronline.com
    Kopen Moncler Dames Heren Kinderen Jassen online! Kleding om te dragen Warm en comfortabel !tot 85% korting in winkel!

    Reply to this comment
  33. Although the prom dress to change much with the tide of the time, that continues being one of the prm gown more popular in the world, that also the fashion between us.

    Reply to this comment
  34. tods on sale

    04. Nov, 2011

    prm gown more popular in the world, that also the fashion between us.

    Reply to this comment
  35. Red bottom shoes discout

    04. Nov, 2011

    During long distance jogging, in which sufficient shock absorption is important, the chances of personal injury with a inflexible feet plus athletic shoes with minor cushioning are wonderful.

    Reply to this comment
  36. After a while, my wife suggested to buy a silicone case for new cell phone. But my son refused to do so at once.

    Reply to this comment
  37. Mukluks Boots Sale

    10. Nov, 2011

    Thanks for great sharing with us!

    Reply to this comment
  38. Moncler Quincy

    10. Nov, 2011

    NICE FOR YOUR SHARING!

    Reply to this comment
  39. leopard uggs

    10. Nov, 2011

    I can’t believe how much I don’t know.

    Reply to this comment
  40. nike heels dunk

    11. Nov, 2011

    Today you wear high heels.
    As for Women and jordan high heels, this is the inseparable relations, Tom Ford master evidence: “don’t wear the high-heeled shoes woman how talk up sexy?” High heels and sex appeal is relevant? The answer is: “of course!” The temptation of high-heeled shoes Wear women nike heels online in a split second sexy, charm and confident outbreak, twisting the waist is born swaying pose. High heels as if the women winning weapons, a pair of high-heeled heels, the increase absolutely is not only highly, but from the heart of the confidence and poise. Jordan heels in the fashion circle constantly with different fancy beauty attracts the eye, Cheap nike heels for women with protean, or sexy, or restore ancient ways, or luxury…… High-heeled shoes so attractive, how to choose a pair of suitable for your high-heeled shoes need to consider. The beauty of high-heeled shoes is, and can immediately figure, spin crus line, is from the vision think proportion more slender, make body curve has the ups and downs. Wearing high heels is really not comfortable shoes, but want to choose to the shoe, is no imagination in so uncomfortable, besides the point little pain, rather than it can bring the benefits of it, again calculate what? 4 to 6 cm high-heeled for you Somen famous Health experts found that wear the high-heeled shoes of 4 to 6 cm the most help to reduce weight, this highly heels can effectively consumption waist abdomen is adipose metabolic rate, let you of the lower abdomen flat, sexy! But often wear the high-heeled shoes of 4 to 6 cm, the biggest problem is that it will make your back pressure, produce acerbity keenly feel, suggest you are sleeping in a soft mattress, reduce back pressure. In addition, when the back muscles when stiff, which is easier to hit in the back of the bladder throughout the so that you will be feeling cold hands, reduced immunity. Suggest you don’t wear low back pack, lest back cold!!!!!

    Reply to this comment
  41. マジコン

    18. Nov, 2011

    great job!, good to read and agree with your words.thanks for great sharing with us,i will tell more of my friends about it .Very good article it was helped me to check once again.

    Reply to this comment
  42. moncler jassen

    19. Dec, 2011

    I am gonna to bookmark this page in order for future reference,Thank you for taking time and effort in researching and providing these blogs that are accepting guest posts and moncler jassen dames.

    Reply to this comment
  43. Rolex Watches Replicas

    13. Feb, 2012

    http://www.rolexwatchesreplicaae.com
    rolex mens watches,rolex womens watches,rolex used watches,replica rolex watches

    Reply to this comment
  44. GHD IV Salon Style

    15. Feb, 2012

    But certainly, we understand the school has its reasons for having certain policies in place.”

    Reply to this comment
  45. Hem cinch-cord save and lock all the heat your body produce! Shop now!

    Reply to this comment
  46. fendi pumps

    20. Feb, 2012

    cngg

    Reply to this comment
  47. pandora bracelets

    23. Feb, 2012

    Thank you for taking the time to publish this information very useful!I’m still waiting for some interesting thoughts from your side in your next post thanks These articles written too great,they rich contents http://www.uspandorabracelets.com

    Reply to this comment
  48. ferrari puma

    29. Feb, 2012

    Thanks very much, I have learned a lot from your post. Well done, really! also have a good train at http://www.ferraripumasale.com/.

    Reply to this comment
  49. puma canada

    29. Feb, 2012

    Blogger wrote this article is the embodiment of the contemporary trend, I benefited, also pls visit my website: http://www.pumashoescanada.com/, thx

    Reply to this comment
  50. mbt sale uk

    29. Feb, 2012

    The author is worth our respect, his articles make inspired me, my articles is http://www.mbtsaleuk.org.uk/, pls feedback

    Reply to this comment
  51. Through this article, I deeply understand the author’s soul, I think this article is beneficial, can inspire people,my links is http://www.christianlouboutincheap2012.com/ thx

    Reply to this comment
  52. puma cheap

    29. Feb, 2012

    Very good article, from which we can learn a lot of things, here also can be learned more from http://www.4pumashoes.com/.

    Reply to this comment
  53. abercrombie milano

    13. Mar, 2012

    I agree with most of your points, but a few need to be discussed further, I will hold a small talk with my partners and maybe I will look for you some suggestion soon..

    Reply to this comment
  54. replica sungasses cheap

    04. Apr, 2012

    Reply to this comment
  55. louis vuitton

    26. Apr, 2012

    a small talk with my partners and maybe I will look for you some suggestio

    Reply to this comment
  56. Adidas jeremy scott

    26. Apr, 2012

    Adidas jeremy scott is more influential world sports brand, unique style, high-quality products and a dynamic style has won the praise of customers. Thousands of varieties have more than one hundred kinds of brand sports apparel, adidas js wings all the best quality.jeremy in the scott continue their great fashion and art to bring us the most stylish design. There is no doubt that these sunglasses bring you more mysterious. And think this is your focus will be in the crowd.In recent years, sports shoes have been out of the dramatic performance, adidas wings and consumers hope that they look low-key. From the aesthetic look forward to these brands in China, an anonymous, jeremy scott wings,looks like everyone is the same. In addition, consumers want to say yes, they are citizens of the world, rather than athletes. Has a rich history, jeremy scott adidas these stories behind the traditional brand sports shoes, to meet customer demand in Europe and the United States. Adidas the originals hardland shoes with a low profile design, but they are the same fashion. Js Wings Shoes has a strong sense of personal style, and the mystery of the elusive, it shows the kind of spirit. Subtle design to production, Adidas jeremy scott is never outdated museum.Whether you’re out for a walk, buy jeremy scott adidas,or movement, you need a comfortable and appropriate shoes. There are all kinds of brand fashion shoes, shoes and all kinds of footwear for people of different ages.As well as a surprise, buy jeremy scott was to re-examine a web site. There is one final brand.

    Reply to this comment
  57. casque dr dre ferrari

    13. May, 2012

    Reply to this comment
  58. dr dre beats lamborghini

    13. May, 2012

    if anybody like music power better visit casque beats by dre france.

    Reply to this comment
  59. beats cheap

    13. May, 2012

    ha ha a nine beautiful .

    Reply to this comment

Leave a Reply