Jump to content

Making an effect - how to disable or detect the live preview when parameters are being edited?


Recommended Posts

Hello! I've been making an Effect plugin recently and I've hit a roadblock. It's designed to catch redundant colours in pixel art - so for instance if you have two very similar shades of pink in the same spritesheet, this would identify them and prompt the user on which they want to keep. Naturally, this means a dialogue prompt comes up when the effect runs. However I've noticed that when the effect's UI is up, it starts running the Render() function immediately - which means while you're trying to change the parameters, it starts spamming you with dialogue boxes...

 

Basically, I need a way to prevent all that code in my Render() function from running during the preview, so it'll only render when the user clicks "Okay" after choosing the parameters. It'd be ideal if I can detect this - like with a simple check for "Is the parameters window still open" or something - but I'd still be satisfied with just making it not run at all. I'm using CodeLab to make this, if that's relevant. This is basically the last thing I need to figure out before I can get this working, so I'd really appreciate any help!

Ukiki Brick.pngukiki brick

Link to comment
Share on other sites

23 minutes ago, floralQuaFloral said:

Basically, I need a way to prevent all that code in my Render() function from running during the preview

 

You would need to write your Effect in Visual Studio with a Windows Forms dialog to have control over when Render is executed.

 

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...