Jump to content

Recommended Posts

Posted (edited)

Hi,

When I instance packed geometry onto points with the Copy to Points SOP, it seems that each point gets an intrinsic attribute called geometryid that tells it which geometry to copy onto it. But the value of this attribute is some obscure internal identifier. Is there some way to modify the geometry that the points are referencing, after the Copy To Points SOP? Obviously this is easy to do before the Copy To Points, but in my specific case I need to do it after.

 

Thanks for any tips!

Edited by jamesearnest244

Share this post


Link to post
Share on other sites

You can use the unpack node. That will restore the geometry. Make your change, then pack it back up.

Share this post


Link to post
Share on other sites
Posted (edited)

Right, I just want to avoid slowing down the cooking by having it stored as geometry at some point in the network. Isn't there a way to just directly change the geo that the points are referencing?

Edited by jamesearnest244

Share this post


Link to post
Share on other sites

geometryid is a read only primitive intrinsic and cannot be directly modified.

 

You can however use python to update the embedded packed geometry https://www.sidefx.com/docs/houdini/hom/hou/PackedGeometry.html

node = hou.pwd()
geo = node.geometry()

for prim in geo.prims():
    prim.setEmbeddedGeometry( node.inputs()[1].geometry() )

Put this code in a python sop to replace the all the packed prims geo to whatever is plugged into the next input of the python sop.

 

If possible, it's best to wait til the very end of your network to do the copying to points, the variant attribute can be used to determine which packed geo is copied on to each point. and this is a more efficient approach then using python to replace embedded geometry.

 

Another option that is preferable to the python method is to use packed disk primitives, these have an intrinsic called "unexpandedfilename" which is the path to the geometry data they reference on disk.

This intrinsic can be overwritten via vex (https://www.sidefx.com/docs/houdini/vex/functions/setprimintrinsic.html) to change the geometry that the points are referencing.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×