Search - User list
Full Version: Geometry unpacked from folder isn't writable? Why?
Root » Rigging » Geometry unpacked from folder isn't writable? Why?
kodra
For example, this Python SOP (assuming Base.skel exists):


geo = node.geometry()

skel = geo.unpackFromFolder("/Base.skel")
skel.addAttrib(hou.attribType.Global, "frame_range", (1, 1))
skel.setGlobalAttribValue("frame_range", (1,120))

results in:

hou.GeometryPermissionError: Geometry is read-only.


It's a bit weird tho... geoitself is writable, why isn't the geometry unpacked from it? What's the correct way to handle it? Just create a new hou.Geometry()then copy()?
tamte
try doing this:
skel = geo.unpackFromFolder("/Base.skel").freeze()
edward
Just to explain, the geometry objects returned by unpackFromFolder() can be a reference to the geometry directly inside the packed primitive for efficiency reasons. So doing "freeze()" gives you a writable copy of the geometry.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB