3
$\begingroup$

Does somebody figure out how to replace a certain string character with a certain mesh in geo nodes? I've tried but the slice string node doesn't allow field input. This screenshot is not geonodes, just so you can understand me. enter image description here

This other one is what I have in geonodes. enter image description here

Thank you very much. Miguel

$\endgroup$
5
  • $\begingroup$ Please be so kind and tell us more. Did you create the characters in Geometry Nodes, or are they available as mesh? How are your Geometry Nodes built? Is there a screenshot of it? Possibly it would also be good if you could share your blend file with us: blend-exchange.com Thank you! $\endgroup$
    – quellenform
    Commented Nov 24, 2022 at 18:29
  • $\begingroup$ Hi! Thank you very much for your response. It's a random string inside GN that I want to replace with a different mesh for each character. I mean all A's a cube, all B's an sphere ... like that. I update the post with a gn screenshot (older one was "handmade") and the blend file. Thank you! $\endgroup$
    – Miguel
    Commented Nov 24, 2022 at 19:37
  • $\begingroup$ Interesting question, because there is no String to Value node. Hm. The solution will probably be a bit clumsy in this case. ...think about it. $\endgroup$
    – quellenform
    Commented Nov 24, 2022 at 21:23
  • $\begingroup$ @quellenform It'S actually a pity that there's nothing like that. Not exactly String to Value, maybe, but something like Character to Code for example, so that like in Excel you can have a character and get its ASCII code from it. This way you could put the objects in a collection and assign each index to an ASCII code, like "Code-65 = Index of Collection Object". $\endgroup$ Commented Nov 25, 2022 at 7:19
  • $\begingroup$ Yes, both of them would help. I'm trying with string length but I can't find the solution. The other problem that I see is that slice string node doesn't allow field input so.... how could we do this for a random number of characters? $\endgroup$
    – Miguel
    Commented Nov 25, 2022 at 16:36

1 Answer 1

0
$\begingroup$

I have found an answer but sadly not an elegant one. I use a Math node to check a character then use a switch to set an appropriate output value (In my case a position in a texture colour ramp).

Unfortunately, this means that every character has to have three nodes for it - Math, Value, and Switch.

Of course, I will eventually use a slice string to get one character at a time from a longer string and set vaious objects' colours accordingly but it would have been so much easier if there was a character to ASCII or similar.

My (poor) solution

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .