Jump to content
shadowst17

Viewer States and onDraw indices

Recommended Posts

Hello, I'm wondering if anyone has had any issues getting hou.GeometryDrawable objects to set the "indices" parameter onDraw when manipulating the attribute data on the geometry data it's referencing in Houdini 18.0. 

 

For example I have a curve tool i've made and you can select multiple CVs. I have a hou.GeometryDrawable that is linked to the points geo inside the node. I create a list of points I want to select and feed that into the onDraw function.

def onDraw(self, kwargs):
     handle = kwargs['draw_handle'] 
     self.anchor_selected.draw(handle, {"indices": self.selectedPnts})

This works but I also have a handle that I create to move said selected points and as soon as I move the handle all the points are drawn with the selection hou.GeometryDrawable as if it's disregarding the indices. I can go back to select individual points again after the handle is no longer moving. It's not specifically to do with position, any attribute on the geometry that is changed breaks the drawable too. I've tried manually drawing at the end of the onHandleToState or force recooking the node that the hou.GeometryDrawable is referencing but no luck.

I don't know if this is a bug, an intentional limitation or possibly done to keep it optimized.

 

I wish I could attach a file but it's work related.

 

I guess I can just do it the way the example files have where you create the geo and points on the node and store them in a dictionary then iterate over them. Feels like it would be a more inefficient way to do it but I guess going the route I have with this problem probably one of the reasons not to do it this way. 

Edited by shadowst17

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

×