Peter,
My first question is this: What are you doing that is not notifying the app that your plug-in's data model is changing?
It sounds like you have several hidden sliders which are controlled by a custom view through your -parameterChanged: method. While that should work, and the behavior you're seeing is probably a bug, it also seems like a less-than-optimal way to approach the problem. (If I misunderstand how your plug-in works, feel free to explain it in more detail.)
If you're not going to ever show your sliders, then you shouldn't have them. You should be able to have a custom data type backing up your custom UI, and you should update that custom data as appropriate (using [-FxParameterSettingAPI setCustomParameterValue:toParm:]) when the user manipulates the custom UI. Updating the custom data should then cause the app to re-render.
Of course, if you are going to show the sliders in certain contexts, then maybe what you're trying to do makes sense. If that's the case, you could still have the plug-in's data be stored in the custom data type that backs the custom UI and update it when the user changes the slider during those times they are visible.
Does that make sense? Maybe I'm not understanding what you're trying to do.
Thanks, Darrin On Feb 1, 2011, at 6:12 AM, Peter T wrote:
I was really hoping one of the collapsed group or hidden parameters behaviours would work, so a custom UI could drive native controls underneath?
Actually, I saw a work-around - change the custom UI's parameter value, in my case a simple NSNumber value toggling between YES and NO, to cause the renderOutput: method to be called for me.
This works, but since I've added code like the following in my custom NSView subclass (mouseDown: event, say):
[customApiAction startAction:self];
NSNumber *dummy = nil;
[apiParameterRetrieval getCustomParameterValue:&dummy fromParm:PARAMETER_ID];
BOOL toggle = ![dummy boolValue];
[apiParameterSetting setCustomParameterValue:[NSNumber numberWithBool:toggle] toParm:PARAMETER_ID];
[customApiAction endAction:self];
the rendering updates, shown in the Canvas window, are much slower? Native parameters don't suffer from this, and receive all, or nearly all render update changes (when visible in UI of course) regardless how fast or slow you move a float slider parameter say?
Any tips grateful.
Peter
-- Darrin Cardani
|