How do I create increasing numbers in the scene view

   1725   2   0
User Avatar
Member
25 posts
Joined: Nov. 2016
Offline
I want to make numbers that are displayed in the scene view, so as fonts. They are copied next to ruler lines. I want the numbers to be increasing and have tried to do so with a combination of copy stamp and python. I know my logic is flawed somewhere but I can't wrap my head around it to figure out other ways of doing this.

Attachments:
ruler.hipnc (104.3 KB)

User Avatar
Member
2535 posts
Joined: June 2008
Offline
You can stamp into the text field of the Font object but you must use back ticks to indicate that the stamp is an expression to be evaluated and not a string literal. Also there is a variation on the stamp function called stamps just for stamping string based variables.

Use the points on your original line as the source for your number copy. I have inserted an attribute wrangle which shows how to constructs a string based attribute that the copy node can use for stamping. You can use typical C based printf formatting to construct the string.

Python can't modify copies, after the fact, because the result from the copy is just geometry.
Edited by Enivob - May 22, 2017 16:23:57

Attachments:
Untitled-1.jpg (193.7 KB)
ap_ruler.hipnc (107.0 KB)

Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
25 posts
Joined: Nov. 2016
Offline
Very helpful explanation, thank you!
  • Quick Links