Jump to: Board index » General » Fusion

Capitalize first letter of a word in Text Node

Learn about 3D compositing, animation, broadcast design and VFX workflows.
  • Author
  • Message
Offline

paperprod

  • Posts: 8
  • Joined: Wed Aug 31, 2022 8:57 am
  • Real Name: Teddy Castelnau

Capitalize first letter of a word in Text Node

PostWed Aug 31, 2022 9:10 am

Hi everyone!

I have recently switched to Resolve, I'm very happy but still lack some knowledge :-( . I recreated all the templates I previously created in After Effects. Right now I'm stuck and can't find a solution.

I need to write the correct expression to convert any entry in a text+ node to :

- convert everything to lowercase
- except the first letter that must be converted to Uppercase
- Add a checkbox toggle ON / OFF switch to default to original text / activate the text conversion

Does anyone know how to achieve this ?

Thank you!
Offline
User avatar

Kristof Indeherberge

  • Posts: 75
  • Joined: Fri Jul 01, 2016 8:15 pm

Re: Capitalize first letter of a word in Text Node -

PostThu Sep 01, 2022 8:04 am

Sure, do that node based using the Vonk tools (available through Reactor). There's a Text subset in there.

Pipe it into a TextCaseLower node, feed that into a TextCaseSentence, then into a TextSwitch node along with the original text. Use the switch to alternate between the two versions. The output of the Switch can be connected to any Text based InputControl of any other node.

If you want a "single" node to do all that, just turn the above nodegraph into a macro and link the macro's checkbox InputControl to the Switch's.

All things Vonk:
https://www.steakunderwater.com/wesuckl ... php?t=5412
Vonk, Text specific onwards:
https://www.steakunderwater.com/wesuckl ... 651#p41651

En-joy!


Kristof
Last edited by Kristof Indeherberge on Thu Sep 01, 2022 8:12 am, edited 2 times in total.
Offline
User avatar

Kristof Indeherberge

  • Posts: 75
  • Joined: Fri Jul 01, 2016 8:15 pm

Re: Capitalize first letter of a word in Text Node -

PostThu Sep 01, 2022 8:09 am

If you want to capitalize every single word, replace the TextCaseSentence node with a TextCaseTitle node.
Offline

xunile

  • Posts: 3106
  • Joined: Mon Apr 23, 2018 5:21 am
  • Real Name: Eric Eisenmann

Re: Capitalize first letter of a word in Text Node -

PostThu Sep 01, 2022 5:29 pm

You can also use this expression in a second Text+ node that references the first.

string.upper(string.sub(Text1.StyledText.Value,1,1)) .. string.lower(string.sub(Text1.StyledText.Value,2))
Attachments
2022-09-01 (1).png
2022-09-01 (1).png (405.73 KiB) Viewed 1434 times
2022-09-01 (2).png
2022-09-01 (2).png (415.09 KiB) Viewed 1434 times
Win 10 Home | Intel i7 - 10700f 64 GB 1 TB GB SSD 2 TB SSD
RTX-3060 12 GB | Resolve Studio 18.6.6| Fusion Studio 18.6.6

Win 10 Home | Intel Core I7-7700HQ 32 GB 1 TB NVME SSD 1 TB SATA SSD
GTX-1060-6GB | Resolve 17.4.6
Offline

paperprod

  • Posts: 8
  • Joined: Wed Aug 31, 2022 8:57 am
  • Real Name: Teddy Castelnau

Re: Capitalize first letter of a word in Text Node -

PostFri Sep 02, 2022 6:48 am

Wow! Thank you very much guys! This solved my problem! I ended up using the expression as it is the quickest and easiest way for me to work with other editors when I create a drfx bundle without requiring them to install anything else.

However I find the Vonk Ultra project very interesting. I tried it but every time I add the text switcher, once I switch to the second input, Resolve crashes. Maybe I'm doing something wrong?

My test comp :

- 2 vTextCreate in which I filled the test Texts "TEXT A" / "TEXT B"
- 1 vTextSwitch to which I connected the 2 previous nodes
- 1 Text+ node. I connected the text field to the output of the switch.

It displays the 1st output of the switch correctly TEXT A, then click on 2nd, crash.
Offline
User avatar

Kristof Indeherberge

  • Posts: 75
  • Joined: Fri Jul 01, 2016 8:15 pm

Re: Capitalize first letter of a word in Text Node -

PostSat Sep 03, 2022 7:12 am

Thanks, I don't run Resolve myself (Fu standalone is my tool) but perhaps Andrew knows...
Offline

paperprod

  • Posts: 8
  • Joined: Wed Aug 31, 2022 8:57 am
  • Real Name: Teddy Castelnau

Re: Capitalize first letter of a word in Text Node -

PostMon Sep 05, 2022 9:54 am

Ok thanks!


Today while I was updating my templates with the expression to capitalize every first letter, I encountered a new issue...

I have 2 text+ nodes connected to a switch. The 1st text node is the original text, the other one is an instance text node which text field has been deinstanced to put the expression in it. For every template I updated this way, it worked great except for the ones that have text animation in text field, like followers for example.

Once I desinstance the text field of the 2nd text+ node, and put the expression, it looses the original follower animation completely, even if I can see the animation has been "copied". Tried to duplicate the first text+ node instead of making an instance node, same issue. As I wrote, I'm still new to fusion. I don't understand why it's not working.

Any idea?
Offline

paperprod

  • Posts: 8
  • Joined: Wed Aug 31, 2022 8:57 am
  • Real Name: Teddy Castelnau

Re: Capitalize first letter of a word in Text Node -

PostThu Sep 08, 2022 10:26 am

Ok, got it...my bad. Just had to put the expression in the text field of the follower instead of the original text+ node. Still have to learn a lot :-)

Thank you all!
Offline

Hataki

  • Posts: 22
  • Joined: Thu Feb 25, 2021 1:26 pm
  • Real Name: Klais Surik

Re: Capitalize first letter of a word in Text Node -

PostThu May 09, 2024 4:44 am

paperprod wrote:Wow! Thank you very much guys! This solved my problem! I ended up using the expression as it is the quickest and easiest way for me to work with other editors when I create a drfx bundle without requiring them to install anything else.

However I find the Vonk Ultra project very interesting. I tried it but every time I add the text switcher, once I switch to the second input, Resolve crashes. Maybe I'm doing something wrong? I recall a time when I need a great deal of assistance from academic text experts. I needed assistance with the term paper I was writing. And I was searching for a place to read reviews about this or that business. I came into the paper24 reviews here, where you can read evaluations written by actual clients before choosing to use the service. However, I can personally attest that, on numerous occasions, things went quite well.

My test comp :

- 2 vTextCreate in which I filled the test Texts "TEXT A" / "TEXT B"
- 1 vTextSwitch to which I connected the 2 previous nodes
- 1 Text+ node. I connected the text field to the output of the switch.

It displays the 1st output of the switch correctly TEXT A, then click on 2nd, crash.


I too by trial and error only figured out how to replace there.

Return to Fusion

Who is online

Users browsing this forum: No registered users and 14 guests