Linking text object string to String to Curve Node (GN) with Drivers?

Hi,
I’m looking for a way to automatically sync the text input I put into a text object (by Tab into Edit Mode, writing my string and leaving Edit Mode again) to the String input socket of the String to Curve Node in Geometry Nodes, ideally by using a Driver as the link. But I just don’t know how to get Data Path of the Text Object’s string, because there is now input field for the string in the text properties tab or anywhere else in the UI, as far as i know. Any ideas?
Maybe Drivers aren’t the best and prober way to do this anyway. I am happy to hear alternative solutions. Running scripts could be a solution, but by using this method the snyc would not be any dynamical. This would be a slight hassle as the modified text object will be duplicated and the string would be edited several times in the expected workflow.
Thanks!

Hi

Drivers cant achieve this I believe.

Whats your actual aim? To have some sort of typewriter effect?

1 Like

Good guess! Thanks for the answer. Yes, I have build a typwriter effect with the help of the slice string node. I also exposed the String input to the Group Input so I can modify the text from the modifiers panel. But I am dealing with numerous text object in the scene and it really trips me off clicking to the modifiers tab instead of the text properties tab. Basically a problem of muscle memory, but it slows down the workflow quite a bit. There are also other scenarios where I’d find the adressing of a text objects content as a Driver very helpful.

Yeah sorry

Python is probably your best bet:
Something like:
bpy.data.objects["Cube"].modifiers["GeometryNodes"]["Socket_2"] = bpy.data.curves["Text"].body

Good luck.

1 Like

Okay, cool.
As a Python noob I have to ask: Where should I put this code? Execute it as a script? Or can I implement it as a Driver in any kind?
Running as script would be a one time solution, not a dynamic linking when the text of the text object is changed, right?

You may consider dealing with the Text object directly and using the island index node instead of the string slice?

No, sorry - string bindings aren’t yet supported to my knowledge…

Go to python workspace - make a new file and copy the data paths and scripts there and run manually is the easiest - but as you said, not dynamic.

p.s. text data you can find in Data API view of the outliner (search for “Body Text”):

Right-click on property and select “Copy Full Data Path” and paste that into your scripts.

(personally I would just use the modifier’s GN inputs)

2 Likes

Okay, thanks!
Yeah, dealing with the text object directly would be an even better solution, as it also allows to change font, alignment etc. directly in the text properties tab.
Do you mean Mesh Island Node? I haven’t dealed with that before, but I am willing to wrap my head around. Do you have a hint on how to adress the text object content inside the GN Node Editor?

Put this directly on a text object. Is a simple “reveal 4 characters per second” effect:

Good luck.

2 Likes

Dude, that’s it! Made my day. Thank you very much. I could not have come up with that.
PS: I personally prefer to manually keyframe the reveal instead of using scene time, but that doesn’t interfere with the functionality of your solution.
Thanks again.

2 Likes