Hey guys,
trying to add a prefix to my current path with a python sop.
for p in geo.prims():
path = p.attribValue(“path”)
p.setAttribValue(“path”,“/something/originalpath”)
that sets the value fine but I need to concatenate the existing path and not sure how to do that?
Thanks!
Prefix path Python
1990 3 1- ludwigvon
- Member
- 27 posts
- Joined: June 2016
- Offline
- ludwigvon
- Member
- 27 posts
- Joined: June 2016
- Offline
- friedasparagus
- Member
- 402 posts
- Joined: June 2014
- Offline
Strings in python are sequences of characters so you can concatenate them like lists or tuples, see python docs [docs.python.org]:
for p in geo.prims(): orig_path = p.attribValue("path") new_path = "prefix_" + orig_path p.setAttribValue("path", new_path)
Henry Dean
- ludwigvon
- Member
- 27 posts
- Joined: June 2016
- Offline
-
- Quick Links