2 Replies Latest reply: Apr 21, 2010 2:32 AM by evertonlandBis RSS

    How to do cheap rendering while user modifies parameters?

    evertonlandBis

      Dear all,

       

      I am playing around with my first AE plugin. At the moment (and for the foreseeable future) each frame takes some time to render. Enough to make the modification of parameters through sliders really uncomfortable, since at each value through which the slider is dragged a rendering event is fired. There is even one fired by just clicking on the slider without dragging.

       

      I would like to delay rendering then until the user is done playing around with the slider and has settled on a particular value for a reasonable time (let's say half a second for example). I looked around, saw the Parameter Supervision section of the documentation and did something nasty: whenever I get a PF_Cmd_USER_CHANGED_PARAM I register a timestamp and I only render when the current time is over 0.5 seconds after the last parameter change event.

       

      Upon trying this it was clearly not the way to go: the composition onto which my effect is applied is not rendered while the parameters are being changed, and when I stop the sliding the last render command is issued too shortly after the last parameter change as to be considered. This has the effect of turning the view in the composition window completely black. In order to get the picture back I have to force the rendering by other means such as previewing the composition.

       

      So (sorry for the long introduction) my question is finally, what would be the correct approach to do what I want to do? Is there a good way to tell when  the user has 'settled' on a value? As opposed to firing parameter change and rendering events like crazy I mean.

       

      Thank you all for your attention.

       

      Best.

        • 1. Re: How to do cheap rendering while user modifies parameters?
          shachar carmi Community Member

          i looked and looked and couldn't find a way to toggle the 'Live Update' comp switch at will.

          that would have been awesome.

           

          the only addition to the solution you have already devised would be to use PF_OutFlag_FORCE_RERENDER,

          to could help you solve the "left blank until updated" problem you're having.

           

          OH!

          i have another solution but it's kind of sneaky...

          during interactions you could render nothing and report PF_Interrupt_CANCEL.

          that would tell AE not to use you're plug-ins output, and hopefully (i never tried this), will invalidate the update of the whole frame.

          hhhmmm....

          that's crazy enough to work.

           

          you could play nicer and just use PF_ABORT and PF_PROGRESS.

          if you check them frequently enough, then maybe AE will tell you the user is still changing the param before the experience gets sluggish.

           

          yup.

          i'm pretty happy with that last one.

          hopefully AE will give you hints about the user still making changes.

          i never tried that, so please post back your findings, as i might implement that s well. (sorry for using you as a guinea pig...)

          • 2. Re: How to do cheap rendering while user modifies parameters?
            evertonlandBis Community Member

            Hey, I'll gladly be your guinea pig for this kind of thing if you take the time to give me such suggestions

             

            I'll have to get back to you in a couple of days, since right now I'm trying to solve a functionality problem with the plugin which has higher priority, but I'll definitely let you know how your idea goes.

             

            Thanks a lot for your time.