Re: Reset of Custom parameter = no work?
Re: Reset of Custom parameter = no work?
- Subject: Re: Reset of Custom parameter = no work?
- From: Paul Miller <email@hidden>
- Date: Wed, 02 May 2012 17:18:05 -0500
On 5/2/2012 5:13 PM, Darrin Cardani wrote:
Paul,
I'm not able to reproduce the problem. But maybe I'm missing something. Here's what I'm doing:
Darrin - yes, what you're doing and what I'm doing look roughly
equivalent. Let me go back and see if I can boil mine down to a simpler
example and see if the problem goes away. Thanks for checking.
In -addParameters, I have a custom parameter that starts out with an empty NSData object:
[parmsApi addCustomParameterWithName:@"Custom Param"
parmId:4
defaultValue:[NSData data]
parmFlags:kFxParameterFlag_CUSTOM_UI];
In -parameterChanged:, I stuff a value into it, like this:
- (BOOL)parameterChanged:(UInt32)parmId
{
static BOOL hasChanged = NO;
[_customView setNeedsDisplay:YES];
if (!hasChanged)
{
hasChanged = YES;
NSLog(@"Updating data!\n");
UInt32 number = 42;
id<FxParameterSettingAPI> paramSetter = [_apiManager apiForProtocol:@protocol(FxParameterSettingAPI)];
[paramSetter setCustomParameterValue:[NSData dataWithBytes:&number length:sizeof(number)]
toParm:4];
}
return YES;
}
Then in -renderOutput:, I print out the value:
NSData* data = nil;
[parmsApi getCustomParameterValue:&data
fromParm:4];
UInt32 dataSize = [data length];
UInt32* savedData = (dataSize != 0) ? (UInt32*)[data bytes] : nil;
NSLog (@"data size = %d, value = %u\n", dataSize, savedData ? *savedData : 0);
This prints "0" until I change a parameter. Then it prints "42". Then when I hit the reset button, it goes back to printing "0".
Does that seem like it's testing the same thing as what you're testing? If not, can you give me the scenario where it's not working for you? If so, what version of Motion/FCPX are you seeing this in?
Darrin
On Apr 30, 2012, at 7:01 AM, Paul Miller wrote:
Okay this one I think is legit.
I have a custom parameter that I've initialized with a default "empty" NSData (0 length). Once I've assigned some data to the parameter (using a custom UI), if I press Reset, the custom parameter does not get its default value set back - it remains the last-modified value.
Can anyone confirm this?
_______________________________________________
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
_______________________________________________
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