Hi! I'm building my pergola and designing it beforehand in Houdini of course. I'm having a little trouble converting all my detail attributes into a wall of text into a font node like so:
From this: To this:
For now I've typed all the text by hand just to take a screenshot by I would like it to be done automotically. Any ideas? Thanks so much!
Try details(), however in this case its more typing than direct data-entry into the font sop.
If there's heaps of items you can parse a csv to point attributes, format the table as a detail string, then read the whole thing into font in one hit.
This isn't too bad with a little Python. You'll have more flexibility formatting your strings and such with Python over HScript.
Assuming your detail attributes already exist on some node, you just have to create an expression on the Text attribute of your Font SOP, then right-click and change the expression language to Python. Then try this code:
node=hou.node("../attribwrangle1")# this should point to the node with the detail attrsgeo=node.geometry()detail_attrs=geo.globalAttribs()output=""ifdetail_attrs:forattrinsorted(detail_attrs,key=lambdax:x.name()):value=geo.attribValue(attr)out="{} = {}".format(attr.name(),value)output=output+out+"\n"returnoutput
Python's string format function is great, you can do a lot with it beyond just simple substitution.
toadstorm This isn't too bad with a little Python. You'll have more flexibility formatting your strings and such with Python over HScript.
Assuming your detail attributes already exist on some node, you just have to create an expression on the Text attribute of your Font SOP, then right-click and change the expression language to Python. Then try this code:
node=hou.node("../attribwrangle1")# this should point to the node with the detail attrsgeo=node.geometry()detail_attrs=geo.globalAttribs()output=""ifdetail_attrs:forattrinsorted(detail_attrs,key=lambdax:x.name()):value=geo.attribValue(attr)out="{} = {}".format(attr.name(),value)output=output+out+"\n"returnoutput
Python's string format function is great, you can do a lot with it beyond just simple substitution.