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

Animated Font Family doesn't render #482

Closed
hellocatfood opened this issue Apr 22, 2020 · 11 comments
Closed

Animated Font Family doesn't render #482

hellocatfood opened this issue Apr 22, 2020 · 11 comments

Comments

@hellocatfood
Copy link
Contributor

hellocatfood commented Apr 22, 2020

Problem

Animating the Font Family value of the Text node using an expression shows in preview mode but changes aren't rendered.

Expected behavior:
Each frame of an animation should have text rendered using a different font.

Actual behavior:
Only the first font is used on each frame

Steps to Reproduce

I’ve been trying to recreate something like the intro sequence to the Enter the Void film. See it below from approx 01:10 (warning: flashing images):
https://www.youtube.com/watch?v=wNtxgxYY7sI

I entered the following expression into the Font Family value of the Text node

if frame >= 0:
	Text1.name.set(frame)

ret=Text1.name.get()

When I press play the Font Family value and font displayed in the preview updates each frame. However, when I try to render it just the first font for each frame.

Project file attached
animated_font.zip

Versions

  • Natron version/commit 2.3.15
  • OS version: Ubuntu 19.10

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@devernay
Copy link
Member

@rodlie this is because of this line: https://github.com/NatronGitHub/openfx-arena/blob/master/Text/TextOFX.cpp#L1653

Natron considers that this parameter cannot be animated, and thus does not render a new frame.

Workaround: animate the text, or set an expression for the text (which can simply be "the text"). This will trigger a new render at each frame.

@rodlie Is there a specific reason for not animating this parameter (and many others in openfx-arena)?

Usually, we should only mark as setAnimate(false) parameters that prevent the plugin to work correctly when animated.

@rodlie
Copy link
Contributor

rodlie commented May 14, 2020

I know. There was a reason for it, but I don't remember why.... I will check this weekend.

@rodlie
Copy link
Contributor

rodlie commented May 27, 2020

The ChoiceParam is dynamic, because of this the actual font name must be stored in a secret StringParam. Animating the ChoiceParam will not affect the StringParam. I can add an override and get the font name from the ChoiceParam if it's animated, but then the options keyed (the font name) from the ChoiceParam can never be guaranteed since it's dynamic (if you load the project on a different computer or alter your fontconfig cache).

@devernay
Copy link
Member

devernay commented Jun 6, 2020

@rodlie was a fix commited?

@rodlie
Copy link
Contributor

rodlie commented Jun 6, 2020

I have not changed anything, as said I can enable animation on the ChoiceParam and add an override that uses the value from the ChoiceParam if it's animated, but if any changes happens to the fontconfig cache the result will differ when loading the project. It's not a good solution in my opinion.

A workaround is to use Pango Markup to change the font family, can be done with a simple expression.

@devernay
Copy link
Member

devernay commented Jun 6, 2020

Can you document the pango markup solution?

@devernay
Copy link
Member

devernay commented Jun 6, 2020

Or should the secret stringparam be non-secret (visible) and canAnimate?

@rodlie
Copy link
Contributor

rodlie commented Jun 6, 2020

Sure, that could be an alternative. Will do some test tomorrow.

@devernay
Copy link
Member

devernay commented Jun 6, 2020

If it works this way, you should also note in the tooltip for both params that only the string param can be keyed/animated

@rodlie
Copy link
Contributor

rodlie commented Jun 6, 2020

Will do, I'm currently testing.

rodlie added a commit to NatronGitHub/openfx-arena that referenced this issue Jun 6, 2020
@rodlie
Copy link
Contributor

rodlie commented Jun 6, 2020

Fixed. Animation works and I didn't notice any regressions.

@rodlie rodlie closed this as completed Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants