3 Replies Latest reply on Feb 15, 2012 10:04 AM by Rallymax-forum

    Exporter parameter range (minvalue~maxvalue) messed up when export a sequence twice

    Dinhmc01539

      Hi,

       

      I'm making an exporter plug-in using PPro SDK 5.5.

      I noticed that the value range of a param went wrong if I export a sequence twice.  For example, if I register "MyAwesomeParam" with min value of 10 and max value of 20, at first export if I enter 0, it jumps to 10 because the entered value is smaller than the min value. But in second export, if I enter 0, it stays 0.

       

      Have any of you encounterer this problem? Is there a workaround for it? Please tell me if you know anything about this, since the SDK guide and sample offered very little help.

       

      Thanks

        • 1. Re: Exporter parameter range (minvalue~maxvalue) messed up when export a sequence twice
          Rallymax-forum Level 3

          it's because AME caches settings of prior jobs. I noticed this too. it doesn't run exSDKGenerateDefaultParams(), only exSDKPostProcessParams(). So, you never had the code run that set the max, min etc.

           

          In exSDKPostProcessParams you need to read every parameter and than fix all the fields - the only thing you can trust is .value, all the others like .maxrange.value, .minrange.value .hidden, .disabled, etc are potentially corrupted so you need to fix them and write them back (ChangeParam())

           

          eg: This is my Frame Rate code in exSDKPostProcessParams. I setup the string labels but more importantly I read, fix and write the frameRateValues structure.

           

            // --------------------------
            // "Frame Rate (fps)"  [TEXT]: [DROPBOX]
            copyConvertStringLiteralIntoUTF16(STR_FRAME_RATE, tempString);
            lRec->exportParamSuite->SetParamName( postProcessParamsRecP->exporterPluginID,
              0,
              ADBEVideoFPS,
              tempString);
            // Get the preset
            lRec->exportParamSuite->GetParamValue(postProcessParamsRecP->exporterPluginID,
              0,
              ADBEVideoFPS,
              &lRec->frameRateValues);
            // Update local storage
            lRec->frameRate = lRec->frameRateValues.value.timeValue;
            lRec->frameFPS = (float)ticksPerSecond / (float)lRec->frameRate;
            // Fix the broken fields (only trust "intValue")
            lRec->frameRateValues.structVersion = 1;
            lRec->frameRateValues.rangeMin.timeValue = 1;
            lRec->timeSuite->GetTicksPerSecond (&lRec->frameRateValues.rangeMax.timeValue);
            lRec->frameRateValues.disabled = kPrFalse;
            lRec->frameRateValues.hidden = kPrFalse;
            lRec->frameRateValues.optionalParamEnabled = kPrFalse;
            // Write back to AME preset storage
            lRec->exportParamSuite->ChangeParam(postProcessParamsRecP->exporterPluginID,
              0,
              ADBEVideoFPS,
              &lRec->frameRateValues);

            // FRAMES PER SECOND DROP BOX VALUES
            lRec->exportParamSuite->ClearConstrainedValues( postProcessParamsRecP->exporterPluginID,
              0,
              ADBEVideoFPS);
            for (int i = 0; i < sizeof(frameRates) / sizeof (PrTime); i++)
            {
             tempValue.timeValue = frameRates[i];
             copyConvertStringLiteralIntoUTF16( (wchar_t *)frameRateStrings[i], tempString);
             lRec->exportParamSuite->AddConstrainedValuePair( postProcessParamsRecP->exporterPluginID,
               0,
               ADBEVideoFPS,
               &tempValue,
               tempString);
            }

          • 2. Re: Exporter parameter range (minvalue~maxvalue) messed up when export a sequence twice
            Dinhmc01539 Level 1

            Many thanks, Rally. You saved my day, but not my love to PPro SDK, sadly, since my plug-in has more than 100 parameters (Close to 150). Imagine I have to get and change them again...

            • 3. Re: Exporter parameter range (minvalue~maxvalue) messed up when export a sequence twice
              Rallymax-forum Level 3

              At least you're moving forward now. It took me months to work out these bugs.

              btw are you developing for cs5 only?