12 Replies Latest reply: Jan 29, 2014 4:33 PM by shachar carmi RSS

    Hidden knob still shows background image

    maxweel Community Member

      Hi guys,

      angle controls seem to have strange behavior when hidden and when the effect is saved as Fx preset, or simply deleted and then re-created by undoing the deletion.

      I tried to reproduce it in as simple a way as possible:

       

      - add the following case in the switch of the EntryPointFunc of the example Effect/Paramarama of the SDK:

       

       

      case PF_Cmd_UPDATE_PARAMS_UI:
      
      
                {
                          AEGP_SuiteHandler suites(in_data->pica_basicP);
                          A_Err err = A_Err_NONE, err2 = A_Err_NONE;
      
      
      
                          AEGP_EffectRefH effectH          = NULL;
      
      
                          ERR(suites.PFInterfaceSuite1()->AEGP_GetNewEffectForEffect(0, in_data->effect_ref, &effectH));
      
                          if (effectH)
                          {
                                    AEGP_StreamRefH streamH          = 0;
      
      
                                    ERR(suites.StreamSuite2()->AEGP_GetNewEffectStreamByIndex(0, effectH, ANGLE_DISK_ID, &streamH));
      
      
                                    if (streamH)
                                    {
                                              ERR(suites.DynamicStreamSuite2()->AEGP_SetDynamicStreamFlag(streamH, AEGP_DynStreamFlag_HIDDEN, FALSE, true));
      
                                              //Release the handle
                                              ERR2(suites.StreamSuite2()->AEGP_DisposeStream(streamH));
                                    }
      
      
                                    ERR2(suites.EffectSuite2()->AEGP_DisposeEffect(effectH));
                          }
                }
      
      
                break;
      
      

       

      - build and apply Paramarama to a solid, the angle control won't be visible:

       

      param1.JPG

      - then delete the effect

      - Undo the operation, I get this:

       

      param2.JPG

       

      This only seems to happen in this case or when the effect is saved as Animation Preset.

       

      Am I doing something wrong in the code that hides the control? I wrote this quickly and it's not the actual code I had issues with, but the same issue occurs so that's the most important. I read another thread on the forum wher controls would re-appear in such situations, but the issue was different and related to parameter groups.

       

      Thanks

        • 1. Re: Hidden knob still shows background image
          shachar carmi Community Member

          well, your code is conditional to the getting of an effect ref. (as it

          should be!)

          there are situations where the effect still has not reference or associated

          layer, such as during global setup and a few other occasions.

          PF_Cmd_UPDATE_PARAMS_UI is supposed to be called when the effect is already

          displayed, but that could be the case.

          put an "else" block for the if(effectH), and see if you get hit a

          breakpoint there. if so, the indeed AE is calling you at a time it's not

          giving a ref in.

          • 2. Re: Hidden knob still shows background image
            maxweel Community Member

            Hi Shachar, thanks for the answer.

            No, I added some breakpoints to check that and I seem to be getting the effectH and streamH properly, and err and err2 remain equal to zero.

             

            But still: you can see that everything gets indeed hidden, except the background image!

            Am I doing something very wrong or am I forgetting to ask AE to update the param? I'm having trouble believing nobody ever came across something like that, I guess I must be missing something.

             

            Thanks again,

             

            Kevin

             

            EDIT: I forgot to say that actually when you hit Undo or load an Fx preset it seems that AE displays the plugin the exact way it was saved, and that is before it calls PF_Cmd_UPDATE_PARAMS_UI.

            So basically, AE is recreating the instance of the effect as displayed in my second screenshot and the code in my PF_Cmd_UPDATE_PARAMS_UI case has then no effect on the UI.

            • 3. Re: Hidden knob still shows background image
              maxweel Community Member

              OK, this is getting weirder: if I use the PF_ParamFlag_COLLAPSE_TWIRLY flag when hiding the angle param, I can delete and undo at will, everything looks fine: no more zombie knobs.

               

              However when saving as animation preset and loading the preset the issue is still there ...

              • 4. Re: Hidden knob still shows background image
                shachar carmi Community Member

                is UpdateParamsUI at all called when applying an effect preset?

                • 5. Re: Hidden knob still shows background image
                  maxweel Community Member

                  Yes it is, but I think this is a bug with angle controls. I added the PF_ParamFlag_COLLAPSE_TWIRLY flag to the PF_ParamDef before creating the control so that they are closed when appearing:

                   

                    def.flags = PF_ParamFlag_COLLAPSE_TWIRLY;
                    PF_ADD_ANGLE( "Knob",
                    0,
                    diskID);
                  

                   

                  and now everything works fine.

                   

                  So thanks again for the help but unless I'm missing something there doesn't seem to be anything very logical happening here!

                  • 6. Re: Hidden knob still shows background image
                    shachar carmi Community Member

                    congrats! you've discovered a bug in AE! you get have it named after you!

                    :-D

                    what version of AE are testing on? (these issues differ from version to

                    version.

                    • 7. Re: Hidden knob still shows background image
                      maxweel Community Member

                      Lol, imagine if they started adding all the names of all the people finding bugs to the splashscreen! ... I guess it would crash and someone would have to report it, then his/her name would be added to the screen as well, etc

                       

                      It's funny (or rather ironic) how I could find a workaround a few hours after posting here even though I've been strugling with this for a couple days now, sorry I wasted your time with the UpdateParamsUI thing.

                      Anyway, I've seen the "bug" (if it is one) both in 11.0.4 and CC 12.1 (I'll check on 12.2 later on), I'll report it.

                       

                      Thanks again!

                      • 8. Re: Hidden knob still shows background image
                        shachar carmi Community Member

                        i did not help. you came up with the work around.

                        and thanks for reporting back! that's how a common knowledge base is built.

                        • 9. Re: Hidden knob still shows background image
                          maxweel Community Member

                          One more question Shachar: is hiding the control during the first PF_Cmd_UpdateParamsUI (like in the code I posted) the best way of creating a hidden parameter (I mean one that needs to be revealed at some point later on)? Or is there a flag that can create the parameter hidden?

                           

                          I'm just wondering if that isn't the reason why the controls get messed up.

                          • 10. Re: Hidden knob still shows background image
                            shachar carmi Community Member

                            using the AEGP suites, you can hide parameters during any call.

                            however, PF_Cmd_UpdateParamsUI is the best place to make such operations,

                            as that's the only call you KNOW, for sure, that some change that requires

                            UI attention is happening.

                            it will call you when the effect is applied, loaded, copied, ect...

                            the reason you had problems was that you stumbled upon an AE bug.

                            you managed you code just fine.

                            • 11. Re: Hidden knob still shows background image
                              maxweel Community Member

                              Still, I never realised that but it seems a bit weird to create the params visible then hide them straight after creation, I was just wondering if they couldn't be created hidden straight away but without affecting their UI so that they can be made visible later on.

                              • 12. Re: Hidden knob still shows background image
                                shachar carmi Community Member

                                nope. the visibility flag is a stream flag, and these can only be set when

                                there's a stream. during param_setup, there's still no stream.