hou.GeometryDrawable not displaying in /obj

   2108   6   2
User Avatar
Member
86 posts
Joined: 1月 2015
Offline
I created three different OTLs that are all functionally clones of each other, except one is a LOP, another a SOP, and another an OBJ node.

For all three, I have a view state that has a TextDrawable and a GeometryDrawable (all exactly the same).

In all three cases, the TextDrawable will show up as expected - but in /obj specifically, the GeometryDrawable doesn't get drawn.

The code is the same for all three, so I'm not sure what's happening here - is there something different I have to do for /obj?
User Avatar
Member
72 posts
Joined: 4月 2016
Offline
How are you providing the geometry to the drawable? The geometry drawable needs to get it's geometry from a sop node, so you need to make sure that you pass it the geometry from the sops inside of an object and not from an obj node.
User Avatar
Member
86 posts
Joined: 1月 2015
Offline
The geometry is defined within the sopnet of the /obj node. I sent this directly to support and it was filed as a bug - #105955

If you want to see for yourself, I've attached two example hda's to this post - one is in SOPs and the other in OBJ - they both define their own view state that do exactly the same thing, but the /obj one is clearly incorrect in terms of what's being drawn in the viewport.

Attachments:
sopGeoDrawable.hda (5.7 KB)
objGeoDrawable.hda (11.1 KB)

User Avatar
Member
72 posts
Joined: 4月 2016
Offline
oh sorry, your post says GeometryDrawable, but my brain read it as SimpleDrawable! If you need a quick workaround, the SimpleDrawable should currently work at the obj level. Thanks for the bug report.
User Avatar
Member
86 posts
Joined: 1月 2015
Offline
hm, SimpleDrawable is a reasonable workaround for the time being (thanks for the suggestion), but there are some issues that would still require using GeometryDrawable ultimately, specifically the ability to set the drawMode to Face (ie Simple's options of Wireframe or Current do not suffice), and having the ability to control when the object re-draws.
User Avatar
Member
72 posts
Joined: 4月 2016
Offline
Okay, does setting the when the drawable is shown give you enough control over when the object is drawn, or is there a case where that doesn't suffice?

https://www.sidefx.com/docs/houdini/hom/hou/SimpleDrawable.html#show [www.sidefx.com]
User Avatar
Member
86 posts
Joined: 1月 2015
Offline
I need to update the drawable in response to a couple of different events, in particular when the user changes frames when the user clicks with the mouse. For tracking frame changes, I have to store the current frame in onEnter(), and then check in onDraw() if the frame has changed. For mouse events I can just use onMouseEvent(), but for either case, I have to keep a pointer to my SOP node and invoke cook(force=True) in order to get the drawable to update.

With GeometryDrawable I can just invoke draw(), and it handles all that neatly. I don't have to track if the frame has changed, nor do i have to keep a pointer to my sop node in order to force cook it.
  • Quick Links