Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working with additional mesh input #35

Open
3 of 4 tasks
tkarabela opened this issue Oct 13, 2020 · 5 comments
Open
3 of 4 tasks

Working with additional mesh input #35

tkarabela opened this issue Oct 13, 2020 · 5 comments

Comments

@tkarabela
Copy link
Contributor

tkarabela commented Oct 13, 2020

OFX supports multiple inputs via inputDefine() on OfxMeshEffectHandle, which is not currently supported by the Blender host.

Use case examples from native Blender modifiers:

We should definitely support the first use case; the second use case is not directly applicable to OFX, since we do not have such metadata for the meshes, but it's handy for interactive use (moving the second mesh vs. tweaking float3 parameter of the effect in UI).

Come to think of it, this feature may need some design work on OFX spec side to make sure it's usable - just giving the effect two meshes in their local coordinates without hinting at their relative position seems quite limiting, considering how one typically works with native Blender modifiers.


Edit from @eliemichel:

  • Basic integration
  • Supporting input transform
  • Unsetting the input object crashes blender
  • Objects are not persistent fo file reload (spent some time on this, but unsuccessfully)
@eliemichel
Copy link
Owner

For the first case, your last note is indeed soemthing I had not taken time to think about. Using local coordinates would really make sense in the spirit of reusing existing data buffer as much as possible, but this means adding some kind of kOfxMeshPropTransform to the spec.

Regarding the second point, where only the transform is used, we can use parameter subtypes. The original OpenFX API has such "role" distinction between parameters of the same underlying type; for instance a double parameter may be an angle, a timecode, etc: https://openfx.readthedocs.io/en/master/Reference/ofxParameter.html#types-of-double-parameters We could have a "locator" subtype. To take the whole transform into account, we'll need to play with group parameters maybe.

@eliemichel
Copy link
Owner

eliemichel commented Jan 2, 2021

Additionnal inputs are beginning to get supported.
Remaining bugs:

  • Unsetting the input object crashes blender
  • Objects are not persistent fo file reload (spent some time on this, but unsuccessfully)
Blender_.C__tmp_untitled.blend.2021-01-02.19-50-06_reenc.mp4

@tkarabela
Copy link
Contributor Author

This looks great! :) I'll have a look at it this week when I have time.

@tkarabela
Copy link
Contributor Author

Just noting a bug I found when I started playing around with it:

  • switching to edit mode when the input object is selected crashes Blender

This is a bit strange since editing the object to which the modifier is attached does work, just not editing the object selected as input. When cooking, the extra mesh has non-NULL Blender Mesh*, but mloop etc. are all NULL, instead it looks like the data is stored in the edit_mesh attribute.

Possibly BKE_mesh_wrapper_ensure_mdata() is the correct function to get out of this.

Screenshot from 2021-01-15 00-44-39

@eliemichel
Copy link
Owner

Oh thanks for this report, as well as the suggestion, I'll look into it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants