feat: group OpenFX plugins under dedicated "OpenFX" category with sub-groups

All OpenFX plugins were previously hardcoded to return kCategoryUnknown,
  causing them to pile up under "Uncategorized" in the node creation menu.

  This commit introduces a two-level grouping system for OFX plugins:

  1. Add new kCategoryOpenFX top-level category
     - Node::CategoryID enum extended with kCategoryOpenFX
     - PluginNode::Category() now returns {kCategoryOpenFX}
     - Node::GetCategoryName() returns "OpenFX"

  2. Add secondary sub-grouping support
     - Node base class gains virtual SubCategory() method
     - PluginNode implements SubCategory() backed by sub_category_ member
     - sub_category_ is set in the constructor from the plugin's OFX context:
         Filter     → "Filter"
         Generator  → "Generator"
         Transition → "Transition"
         others     → "General"

  3. Update NodeFactory::CreateMenu()
     - When a node belongs to kCategoryOpenFX and provides a non-empty
       SubCategory(), creates a second-level submenu under "OpenFX"
     - Nodes without a sub-category are placed directly in the top menu

  Expected menu layout:
    OpenFX
      ├── Filter
      │     ├── ColorCorrect
      │     └── ...
      ├── Generator
      ├── Transition
      └── General

  All 4 test suites pass.
This commit is contained in:
2026-05-14 21:05:29 +08:00
parent b2de04962d
commit e012f16083
5 changed files with 54 additions and 9 deletions
+18 -1
View File
@@ -250,6 +250,18 @@ olive::plugin::PluginNode::PluginNode(
OFX::Host::ImageEffect::Instance *plugin)
{
plugin_instance_=plugin;
const std::string &ctx = plugin_instance_->getContext();
if (ctx == kOfxImageEffectContextFilter) {
sub_category_ = tr("Filter");
} else if (ctx == kOfxImageEffectContextGenerator) {
sub_category_ = tr("Generator");
} else if (ctx == kOfxImageEffectContextTransition) {
sub_category_ = tr("Transition");
} else {
sub_category_ = tr("General");
}
bool has_texture_input = false;
QHash<QString, QString> group_labels;
QHash<QString, QString> page_labels;
@@ -505,7 +517,12 @@ QString olive::plugin::PluginNode::Name() const
QVector<olive::Node::CategoryID> olive::plugin::PluginNode::Category() const
{
return { olive::Node::kCategoryUnknown };
return { olive::Node::kCategoryOpenFX };
}
QString olive::plugin::PluginNode::SubCategory() const
{
return sub_category_;
}
QString olive::plugin::PluginNode::Description() const