Python Geometry -- GeometryPermissionError

   4826   3   1
User Avatar
Member
7 posts
Joined: April 2015
Offline
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.
User Avatar
Staff
4174 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)
I'm o.d.d.
User Avatar
Member
7 posts
Joined: April 2015
Offline
Thanks a lot! That worked for me too!
User Avatar
Member
1 posts
Joined: April 2015
Offline
I start houdini 14 and right after it says OpenGl fatal error i dont want to buy a new graphics card so what can i do?
solitaire klondike [solitaire-champ.com]
  • Quick Links