feat: hide non-texture OFX params from node graph + host coordinate standardization

Hide non-texture OFX params from node graph
  --------------------------------------------
  OFX plugins like ColorCorrect expose dozens of scalar parameters as
  node inputs, making nodes extremely tall and pushing Source/Mask far
  down. Previously attempted via kInputFlagHidden, but that also hid
  them from the parameter panel.

  Fix: move the filter to NodeViewItem::IsInputValid() instead.
  For OFX plugin nodes (getPluginInstance() != nullptr), only
  kTexture inputs are rendered as ports. Scalar parameters remain
  fully visible in the parameter panel.

  Files: app/widget/nodeview/nodeviewitem.cpp
         app/node/plugins/Plugin.cpp

  Standardize OFX host coordinate system
  --------------------------------------
  Olive's OFX host had partial and inconsistent coordinate handling.

  1. Fix Project coordinate methods
     - getProjectSize() / getProjectExtent() / getProjectOffset()
       now multiply X by pixel_aspect_ratio(), returning canonical
       coordinates per the OFX spec.

  2. Fix Clip default RoD
     - OliveClipInstance::getRegionOfDefinition() default now returns
       {0, 0, width*PAR, height} instead of raw pixel coords.

  3. Add parameter coordinate system conversion
     - DoubleInstance / Double2DInstance / Double3DInstance now check
       _descriptor.getDefaultCoordinateSystem().
     - For kOfxParamCoordinatesNormalised:
         get: internal pixel value -> normalised (divide by extent)
         set: normalised plugin value -> pixel (multiply by extent)
     - DefaultValueForParam() also converts normalised defaults to
       canonical before storing in Node, keeping Olive internal/UI
       values consistently in pixel space.

  Files: app/pluginSupport/OlivePluginInstance.cpp
         app/pluginSupport/OliveClip.cpp
         app/pluginSupport/paraminstance.h
         app/node/plugins/Plugin.cpp
This commit is contained in:
2026-05-14 21:54:18 +08:00
parent e012f16083
commit 4aa4d59770
5 changed files with 171 additions and 18 deletions
+12 -1
View File
@@ -31,6 +31,7 @@
#include "config/config.h"
#include "core.h"
#include "node/nodeundo.h"
#include "node/value.h"
#include "pluginSupport/OlivePluginInstance.h"
#include "nodeview.h"
#include "nodeviewscene.h"
@@ -753,7 +754,17 @@ void NodeViewItem::UpdateOutputConnectorPosition()
bool NodeViewItem::IsInputValid(const QString &input)
{
return node_->IsInputConnectable(input) && !node_->IsInputHidden(input);
if (!node_->IsInputConnectable(input) || node_->IsInputHidden(input)) {
return false;
}
// For OFX plugin nodes, only show texture inputs in the node graph
// to avoid excessively tall nodes with dozens of scalar parameters.
// Scalar parameters are still visible in the parameter panel.
if (node_->getPluginInstance() != nullptr &&
node_->GetInputDataType(input) != NodeValue::kTexture) {
return false;
}
return true;
}
void NodeViewItem::SetRectSize(int height_units)