Skip to main content
artnerdray
New Participant
November 20, 2022
Answered

Is there a way to make an Integer into string?

  • November 20, 2022
  • 1 reply
  • 648 views

New to this...

 

I was trying to create a text using 5 digits of random numbers.

 

I looked for an hour or more and haven't found a way. Considering there are only two nodes for string in the Value Processor I'm begining to think it can't be done.

 

I wanted to make a text node. Make an Input Parameters with an integer set it at 10000 min and 99999 max and be done. But there no text (string) data so the node is blank.

I tried looking at what is possible in the Value Processor but only saw two nodes for String. And none of them were "To String".

I didn't see an obvious way to make a random number in the Value Processor. Still plenty of room for me to learn I guess. 

This topic has been closed for replies.
Correct answer Luca Giarrizzo

Hello,

 

Unfortunately, there is no straightforward way to convert values into strings in function graphs. There are workarounds, depending on what you want to achieve:

 

If you wish to display a value in an image, you can use an atlas which includes all numbers and symbols you need, then use a Pixel Processor node to build an image of the number out of the atlas by compositing the numbers together.

 

If you wish to set the string for the Text property of a Text node out of an integer value, you can use Designer's Python API to acquire the integer value, do the conversion in Python and pass the result to the Text node.

 

Best regards.

 

1 reply

Luca Giarrizzo
Community Manager
Luca GiarrizzoCommunity ManagerCorrect answer
Community Manager
November 21, 2022

Hello,

 

Unfortunately, there is no straightforward way to convert values into strings in function graphs. There are workarounds, depending on what you want to achieve:

 

If you wish to display a value in an image, you can use an atlas which includes all numbers and symbols you need, then use a Pixel Processor node to build an image of the number out of the atlas by compositing the numbers together.

 

If you wish to set the string for the Text property of a Text node out of an integer value, you can use Designer's Python API to acquire the integer value, do the conversion in Python and pass the result to the Text node.

 

Best regards.

 

Luca Giarrizzo | Quality Engineer, 3D & Immersive | Adobe