Re: Forcing a render in response to custom parameter push
Re: Forcing a render in response to custom parameter push
- Subject: Re: Forcing a render in response to custom parameter push
- From: "Hugh Denman" <email@hidden>
- Date: Sun, 7 Oct 2007 16:50:24 +0100
There was some traffic on this list recently about forcing a render in response to a button push. I stated that I had working code using a hidden float parameter. I've just realised that this method doesn't actually work; it looks like a bug in FCP's FxPlug hosting.
Here are two of the parameters I add. First, an ordinary visible parameter:
[parmsAPI addFloatSliderWithName :@"Range"
parmId :kRangeID
defaultValue :6.0
parameterMin :0.0
parameterMax :100.0
sliderMin :
0.0
sliderMax :100.0
delta :0.1
parmFlags :kFxParameterFlag_DEFAULT];
Next a hidden parameter designed to force a render (GPP_LOG is our in-house logging macro):
BOOL addedForceRender = [parmsAPI addFloatSliderWithName :@"Dummy force render"
parmId :kForceRenderID
defaultValue:6.0
parameterMin:0
parameterMax:
100.0
sliderMin:0
sliderMax:100.0
delta:
0.1
parmFlags: (kFxParameterFlag_HIDDEN /*| kFxParameterFlag_DONT_DISPLAY_IN_DASHBOARD | kFxParameterFlag_NOT_ANIMATABLE*/)];
if (!addedForceRender) GPP_LOG(GPPLog::error, "addedForceRender parm failed!");
The code I use in reaction to a mouse press is shown below. Initially I was incrementing both the visible parameter and the hidden parameter. This forces a render fine. However, when the increment on the visible parameter is commented out (as below), I don't get the re-render. As the parameter definitions are identical apart from the 'hidden' flag, I have to guess that this is a bug in FCP?
Thanks,
Hugh
- (IBAction)analyze:(id)sender
{
using namespace GPP;
id actionAPI = [_apiManager apiForProtocol:@protocol(FxCustomParameterActionAPI)];
GPP_LOG(GPPLog::diagnostic, "analyze method called");
[actionAPI startAction:self];
id getAPI = [_apiManager apiForProtocol:@protocol(FxParameterRetrievalAPI)];
id setAPI = [_apiManager apiForProtocol:@protocol(FxParameterSettingAPI)];
if ( setAPI != NULL && getAPI != NULL)
{
double time = [actionAPI currentTime]; double tmpValue;
GPP_LOG(GPPLog::diagnostic, GPP_LOGDUMP(time));
BOOL success;
success = [getAPI getFloatValue:&tmpValue fromParm:kForceRenderID atTime:time];
if (!success) GPP_LOG(GPPLog::error, "Error calling getFloatValue!");
else GPP_LOG(GPPLog::diagnostic, GPP_LOGDUMP(tmpValue));
tmpValue+=1;
success = [setAPI setFloatValue:tmpValue toParm:kForceRenderID atTime:time];
if (!success) GPP_LOG(GPPLog::error, "Error calling setFloatValue!");
/*
success = [getAPI getFloatValue:&tmpValue fromParm:kRangeID atTime:time];
if (!success) GPP_LOG(GPPLog::error, "Error calling getFloatValue!");
else GPP_LOG(GPPLog::diagnostic, "Got motion range: " << tmpValue);
success = [setAPI setFloatValue:(tmpValue+1) toParm:kRangeID atTime:time];
if (!success) GPP_LOG(GPPLog::error, "Error calling setFloatValue!");
*/
}
[actionAPI endAction:self];
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden