Skip to content

Commit 9c72afe

Browse files
committed
Require hosts to call instanceChanged action after loading project
Fixes #184. Signed-off-by: Gary Oberbrunner <[email protected]>
1 parent 80a1ade commit 9c72afe

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

include/ofxCore.h

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,24 @@ These are the actions passed to a plug-in's 'main' function
321321

322322
/** @brief
323323
324-
This action is the first action passed to a plug-in's
325-
instance after its creation. It is there to allow a plugin to create any
326-
per-instance data structures it may need.
324+
Called when an instance of a plugin is created by the host. The plugin can
325+
create any per-instance data structures it may need. Plugins may also
326+
enable/disable their params here, based on other param values or clips.
327+
328+
When a host creates a plugin instance from a saved project with a connected
329+
clip, the host must either:
330+
331+
- connect all params and clips to an effect *before* calling createInstance,
332+
and support the \ref OfxTimeLineSuite so the effect can call
333+
\ref OfxTimeLineSuiteV1::getTime in createInstance (so the plugin can call
334+
\ref OfxImageEffectSuiteV1::clipGetRegionOfDefinition),
335+
336+
OR:
337+
338+
- call `instanceChanged` after `createInstance` and after the host has
339+
hooked up all clips, with property \ref kOfxPropType = \ref kOfxTypeClip and
340+
\ref kOfxPropChangeReason = \ref kOfxChangePluginEdited, and ensure that
341+
\ref OfxImageEffectSuiteV1::clipGetRegionOfDefinition works in that action.
327342
328343
@param handle handle to the plug-in instance, cast to an \ref OfxImageEffectHandle
329344
@param inArgs is redundant and is set to NULL
@@ -399,6 +414,13 @@ These are the actions passed to a plug-in's 'main' function
399414
used to determine what was the thing inside the instance that was
400415
changed.
401416
417+
Note: when a host loads a plugin instance from a saved project, if the input
418+
clips are not connected at that time, the host must call `instanceChanged`
419+
after \ref kOfxActionCreateInstance and after the host has hooked up all clips, with
420+
property \ref kOfxPropType = \ref kOfxTypeClip and \ref kOfxPropChangeReason =
421+
\ref kOfxChangePluginEdited, and ensure that \ref OfxImageEffectSuiteV1::clipGetRegionOfDefinition works in
422+
this action.
423+
402424
@param handle handle to the plug-in instance, cast to an \ref OfxImageEffectHandle
403425
@param inArgs has the following properties
404426
- \ref kOfxPropType The type of the thing that changed which will be one of..

0 commit comments

Comments
 (0)