Hello guys,
So… I'm trying to add an attribute to a geometry, in the primitive level.
I tried it with an OBJ I downloaded and I got: GeometryPermissionError: Geometry is read-only.
So I tried again in a simple BOX node I've just created… same error. Cannot seem to add attributes to geometries.
My line of code:
geo.addAttrib(hou.attribType.Prim, ‘intensity’, 0.8)
What's the catch?
Thanks,
Francisco.
Python Geometry -- GeometryPermissionError
5124 3 1- Francisco de Villalobos
- Member
- 7 posts
- Joined: April 2015
- Offline
- goldleaf
- Staff
- 4199 posts
- Joined: Sept. 2007
- Online
Does that error happen when you run it from a Python SOP? Or where are you running that code?
This is what I put in a Python SOP, and that worked for me:
node = hou.pwd()
geo = node.geometry()
# Add code to modify contents of geo.
# Use drop down menu to select examples.
geo.addAttrib(hou.attribType.Prim, ‘intensity’, 0)
This is what I put in a Python SOP, and that worked for me:
node = hou.pwd()
geo = node.geometry()
# Add code to modify contents of geo.
# Use drop down menu to select examples.
geo.addAttrib(hou.attribType.Prim, ‘intensity’, 0)
I'm o.d.d.
- Francisco de Villalobos
- Member
- 7 posts
- Joined: April 2015
- Offline
- gootohell
- Member
- 1 posts
- Joined: April 2015
- Offline
-
- Quick Links