Paul, I'm not able to reproduce the problem. But maybe I'm missing something. Here's what I'm doing: 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 (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/pro-apps-dev/dcardani%40apple.com
This email sent to dcardani@apple.com
_______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/pro-apps-dev/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com