setting font text WITHOUT copy stamp?

   4269   5   0
User Avatar
Member
65 posts
Joined: Feb. 2017
Offline
I copy a font to a line of points. I'd like to set the font text to the corresponding point number. Is there a way to do this with VEX/python that doesn't involve a copy stamp? Or is this one of those times were copy stamp is really the only tool that can do the job?
Edited by aoakenfoArchiact - April 10, 2017 14:26:01
User Avatar
Staff
6205 posts
Joined: July 2005
Offline
You could do this with Python, but I wouldn't recommend it. It is merely theoritically possible in VEX, I certainly would not recommend that.

However, that does not mean copy-stamp is the best answer. With 16 especially, we are encouraging a move away from Copy-Stamp to directly using attribute lookup. For example, if you run a For Each point SOP loop you can use the point() expression setup your font text.

Attached shows a few examples building this up. The final one compiles the foreach loop, letting the font sop be computed in a parallel across all your points.

Attachments:
copystamp.hip (92.1 KB)

User Avatar
Member
65 posts
Joined: Feb. 2017
Offline
Thanks!

Attachments:
gold_jerry.gif (1.3 MB)

User Avatar
Member
65 posts
Joined: Feb. 2017
Offline
@jlait So how would you workaround copy stamp in this example? I took a a few tries at it, but each attempt felt convoluted (and broken). I'd love to see your take on it.
Edited by aoakenfoArchiact - April 11, 2017 14:48:47

Attachments:
cs1.png (33.7 KB)
cs2.gif (333.3 KB)
copy_stamp_example.hipnc (71.7 KB)

User Avatar
Member
28 posts
Joined: Nov. 2015
Offline
The new Webinar on Geometry Worflows [youtube.com] cover using foreach loops instead of copy stamp.
User Avatar
Staff
6205 posts
Joined: July 2005
Offline
I tend to start with a Copy to Points, as shown in the attached. Then, when I realized I want to vary the copy on each point, I wrap the copy to points in a For Each loop. I set the loop to each point and remove the name attribute. I need a way to identify which point I'm working with. If it is particles, I already have ‘id’, but generic stuff like this I throw in an enumerate SOP to give me ids.

Now when I want to have an expression be “stamped” I just use the point() function to read the point “id” value. What is nice is I can also read any other attributes, I don't have to setup any atamping explicitly.

In this case I'd also not use a timeshift, but instead bake the time offset directly in the sin() expression in the transform. But that is more a stylistic thing…

Attachments:
copyscreenshot.png (44.6 KB)
copy_stamp_example_loop.hipnc (81.0 KB)

  • Quick Links