0

I am developing an Apple Motion effect's plugin using the FxPlug v4.3 SDK. Everything compiles and works great, however, there's one unpleasant problem. When I apply a filter, in the Motion inspector I see that the button parameter's name is duplicated, i.e. the name is written on the button body and duplicated on the left side. I didn't find anything on this topic in the documentation.

In this regard, I have two questions:

  • Is it possible to get rid of the param name on the left while still having it on the button body?

  • Is it possible to move the push button to the center of the parameter's field?

Here's a code.

#import <FxPlug/FxPlugSDK.h>
@objc private func buttonTapped() { ... }

creationAPI.addPushButton(
    withName: "Generate",
    parameterID: 42,
    selector: #selector(buttonTapped),
    parameterFlags: .init(kFxParameterFlag_DEFAULT)
)
1
  • 1
    I think you should ask Apple for a modification of the API. Commented Oct 1 at 8:31

1 Answer 1

0

Currently, using the FxPlug 4.3 standard method for adding a push button, it is impossible to get rid of the duplicated text on the left side of the parameter field in Apple Motion (oddly enough but Motion engineers are facing the same problem). Instead, we need to use the FxPlug's native method to create a custom parameter that will allow us to leave the Objective-C's addCustomParameterWithName: string argument empty (in Swift it is withName: argument), however the button title can be assigned separately in a custom NSView.

[creationAPI addCustomParameterWithName:@""
                            parameterID:42
                           defaultValue:@0
                         parameterFlags:kFxParameterFlag_CUSTOM_UI];

[windowAPI remoteWindowOfSize:contentSize 
           reply:^(NSView *parentView, NSError *error) {

    if (parentView != nil)
    {
        NSView* buttonView = [[self createViewForParameterID:42] autorelease];
        [parentView addSubview:buttonView];
    }
    else
    {
        NSLog(@"Error creating view: %@", error);
    }
}];

Then setup your NSButton in a custom NSView.

NSButton *button = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 100, 30)];
[button setTitle:@"Generate"];
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.